1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
|
<html>
<head>
<title>Camstream: CamStream API documentation</title>
<link rel="stylesheet" href="../../tech.css" type="text/css">
</head>
<body>
<!-- Generated by Doxygen 1.3.7 -->
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div>
<h1>AudioSample.h</h1><a href="_audio_sample_8h.html">Go to the documentation of this file.</a><pre class="fragment"><div>00001 <span class="comment">/* audiodevs: Abstraction layer for audio hardware & samples</span>
00002 <span class="comment"> Copyright (C) 2003-2004 Nemosoft Unv.</span>
00003 <span class="comment"></span>
00004 <span class="comment"> This program is free software; you can redistribute it and/or modify</span>
00005 <span class="comment"> it under the terms of the GNU General Public License as published by</span>
00006 <span class="comment"> the Free Software Foundation; either version 2 of the License, or</span>
00007 <span class="comment"> (at your option) any later version.</span>
00008 <span class="comment"></span>
00009 <span class="comment"> This program is distributed in the hope that it will be useful,</span>
00010 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
00011 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
00012 <span class="comment"> GNU General Public License for more details.</span>
00013 <span class="comment"></span>
00014 <span class="comment"> You should have received a copy of the GNU General Public License</span>
00015 <span class="comment"> along with this program; if not, write to the Free Software</span>
00016 <span class="comment"> Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span>
00017 <span class="comment"></span>
00018 <span class="comment"> For questions, remarks, patches, etc. for this program, the author can be</span>
00019 <span class="comment"> reached at camstream@smcc.demon.nl.</span>
00020 <span class="comment">*/</span>
00021
00022 <span class="preprocessor">#ifndef AUDIOSAMPLE_HPP</span>
00023 <span class="preprocessor"></span><span class="preprocessor">#define AUDIOSAMPLE_HPP</span>
00024 <span class="preprocessor"></span>
00025 <span class="preprocessor">#include <qshared.h></span>
00026
00027 <span class="preprocessor">#include "<a class="code" href="_sound_attributes_8h.html">SoundAttributes.h</a>"</span>
00028
00029
<a name="l00030"></a><a class="code" href="_audio_sample_8h.html#a0">00030</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="_audio_sample_8h.html#a0">SamplePos</a>;
00031
<a name="l00032"></a><a class="code" href="class_c_audio_sample.html">00032</a> <span class="keyword">class </span><a class="code" href="class_c_audio_sample.html">CAudioSample</a>
00033 {
00034 <span class="keyword">private</span>:
00035 <span class="keywordtype">void</span> Init();
00036 <span class="keywordtype">void</span> ReInit();
00037 <span class="keywordtype">void</span> Reset();
00038 <span class="keywordtype">void</span> CalculateOffsets() <span class="keyword">const</span>;
00039
00040 <span class="keyword">protected</span>:
<a name="l00041"></a><a class="code" href="struct_c_audio_sample_1_1_sample_data.html">00041</a> <span class="keyword">struct </span><a class="code" href="struct_c_audio_sample_1_1_sample_data.html">SampleData</a>: <span class="keyword">public</span> QShared <span class="comment">// internal</span>
00042 {
<a name="l00043"></a><a class="code" href="struct_c_audio_sample_1_1_sample_data.html#o0">00043</a> <a class="code" href="struct_sound_attributes.html">SoundAttributes</a> <a class="code" href="struct_c_audio_sample_1_1_sample_data.html#o0">Attributes</a>;
<a name="l00044"></a><a class="code" href="struct_c_audio_sample_1_1_sample_data.html#o1">00044</a> <span class="keywordtype">int</span> <a class="code" href="struct_c_audio_sample_1_1_sample_data.html#o1">BytesPerSample</a>;
<a name="l00045"></a><a class="code" href="struct_c_audio_sample_1_1_sample_data.html#o2">00045</a> <span class="keywordtype">int</span> <a class="code" href="struct_c_audio_sample_1_1_sample_data.html#o2">PositionOffset</a>[SoundAttributes::MaxPosition];
00046
<a name="l00047"></a><a class="code" href="struct_c_audio_sample_1_1_sample_data.html#o3">00047</a> <span class="keywordtype">void</span> *<a class="code" href="struct_c_audio_sample_1_1_sample_data.html#o3">pMemBuffer</a>;
<a name="l00048"></a><a class="code" href="struct_c_audio_sample_1_1_sample_data.html#o4">00048</a> <a class="code" href="_audio_sample_8h.html#a0">SamplePos</a> <a class="code" href="struct_c_audio_sample_1_1_sample_data.html#o4">BufLength</a>;
00049
<a name="l00050"></a><a class="code" href="struct_c_audio_sample_1_1_sample_data.html#o5">00050</a> <a class="code" href="_audio_sample_8h.html#a0">SamplePos</a> <a class="code" href="struct_c_audio_sample_1_1_sample_data.html#o5">BufStartOffset</a>;
00051 } *<a class="code" href="class_c_audio_sample.html#p0">m_pData</a>;
00052
00053
00054 <a class="code" href="class_c_audio_sample.html#a0">CAudioSample</a>(<span class="keyword">const</span> <a class="code" href="struct_sound_attributes.html">SoundAttributes</a> &attrs, SamplePos buffer_length);
00055
00056 <span class="keywordtype">void</span> <a class="code" href="class_c_audio_sample.html#b1">SetSoundAttributes</a>(<span class="keyword">const</span> <a class="code" href="struct_sound_attributes.html">SoundAttributes</a> &) const;
00057 <span class="keywordtype">int</span> GetBytesPerSample() const;
00058
00059 <span class="keywordtype">bool</span> CreateBuffer(const <a class="code" href="struct_sound_attributes.html">SoundAttributes</a> &attrs, SamplePos buffer_length);
00060 <span class="comment">// ResizeBuffer(SamplePos buffer_length);</span>
00061 <span class="keywordtype">void</span> Detach();
00062
00063 public:
00064 <a class="code" href="class_c_audio_sample.html">CAudioSample</a>();
00065 CAudioSample(const CAudioSample &);
00066 virtual ~CAudioSample();
00067
00068 CAudioSample &operator =(const CAudioSample &audio_sample);
00069 <span class="comment">//CAudioSample Copy() const;</span>
00070
00071 <a class="code" href="struct_sound_attributes.html">SoundAttributes</a> GetSoundAttributes() const;
00072 <span class="keywordtype">bool</span> IsNull() const;
00073
00074 virtual SamplePos TotalLength() const;
00075 virtual <span class="keywordtype">bool</span> CanSeek() const;
00076 virtual <span class="keywordtype">bool</span> SeekTo(SamplePos offset);
00077
00078 virtual <span class="keywordtype">int</span> GetValue(SamplePos offset, <a class="code" href="struct_sound_attributes.html">SoundAttributes</a>::Position channel) const;
00079 virtual <span class="keywordtype">void</span> SetValue(SamplePos offset, <a class="code" href="struct_sound_attributes.html">SoundAttributes</a>::Position channel, <span class="keywordtype">int</span> value);
00080 };
00081
00082 #endif
</div></pre><hr size="1"><address style="align: right;"><small>Generated on Wed Dec 13 23:38:46 2006 for CamStream by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.7 </small></address>
</body>
</html>
|