/usr/share/doc/libucommon-dev/a00187_source.html is in libucommon-doc 3.2.0-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>UCommon: ucommon/audio.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
<h1>ucommon/audio.h</h1><a href="a00187.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (C) 1995-1999 David Sugar, Tycho Softworks.</span>
<a name="l00002"></a>00002 <span class="comment">// Copyright (C) 1999-2005 Open Source Telecom Corp.</span>
<a name="l00003"></a>00003 <span class="comment">// Copyright (C) 2005-2010 David Sugar, Tycho Softworks.</span>
<a name="l00004"></a>00004 <span class="comment">//</span>
<a name="l00005"></a>00005 <span class="comment">// This file is part of GNU uCommon C++.</span>
<a name="l00006"></a>00006 <span class="comment">//</span>
<a name="l00007"></a>00007 <span class="comment">// GNU uCommon C++ is free software; you can redistribute it and/or modify</span>
<a name="l00008"></a>00008 <span class="comment">// it under the terms of the GNU General Public License as published by</span>
<a name="l00009"></a>00009 <span class="comment">// the Free Software Foundation; either version 3 of the License, or</span>
<a name="l00010"></a>00010 <span class="comment">// (at your option) any later version.</span>
<a name="l00011"></a>00011 <span class="comment">//</span>
<a name="l00012"></a>00012 <span class="comment">// GNU uCommon C++ is distributed in the hope that it will be useful,</span>
<a name="l00013"></a>00013 <span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00014"></a>00014 <span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the</span>
<a name="l00015"></a>00015 <span class="comment">// GNU General Public License for more details.</span>
<a name="l00016"></a>00016 <span class="comment">//</span>
<a name="l00017"></a>00017 <span class="comment">// You should have received a copy of the GNU General Public License</span>
<a name="l00018"></a>00018 <span class="comment">// along with GNU uCommon C++. If not, see <http://www.gnu.org/licenses/>.</span>
<a name="l00019"></a>00019
<a name="l00033"></a>00033 <span class="preprocessor">#ifndef _UCOMMON_AUDIO_H_</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span><span class="preprocessor">#define _UCOMMON_AUDIO_H_</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span>
<a name="l00036"></a>00036 <span class="preprocessor">#ifndef _UCOMMON_UCOMMON_H_</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#include <<a class="code" href="a00210.html" title="Top level include file for the GNU uCommon C++ core library.">ucommon/ucommon.h</a>></span>
<a name="l00038"></a>00038 <span class="preprocessor">#endif</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span>
<a name="l00040"></a>00040 NAMESPACE_UCOMMON
<a name="l00041"></a>00041
<a name="l00049"></a>00049 <span class="keyword">class </span>__EXPORT audio
<a name="l00050"></a>00050 {
<a name="l00051"></a>00051 <span class="keyword">public</span>:
<a name="l00052"></a>00052 <span class="keyword">typedef</span> uint8_t *encoded_t;
<a name="l00053"></a>00053 <span class="keyword">typedef</span> int16_t *linear_t;
<a name="l00054"></a><a class="code" href="a00024.html">00054</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {ULAW, ALAW, LINEAR, STREAM, PACKET, FRAMED, NATIVE} type_t;
<a name="l00055"></a>00055 <span class="keyword">typedef</span> <span class="keyword">enum</span> {IDLE = 0, ACTIVE, END, FAILED, INVALID, INVFILE, INVIO = FAILED} state_t;
<a name="l00056"></a>00056
<a name="l00057"></a>00057 <span class="keyword">static</span> <span class="keyword">volatile</span> <a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> global;
<a name="l00058"></a>00058
<a name="l00066"></a>00066 <span class="keyword">class </span>__EXPORT framer
<a name="l00067"></a>00067 {
<a name="l00068"></a>00068 <span class="keyword">protected</span>:
<a name="l00069"></a>00069 state_t state;
<a name="l00070"></a>00070
<a name="l00071"></a>00071 <span class="keyword">public</span>:
<a name="l00072"></a>00072
<a name="l00073"></a>00073 <span class="keyword">virtual</span> <a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> frametime(<span class="keywordtype">void</span>) = 0;
<a name="l00074"></a>00074 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> framesize(<span class="keywordtype">void</span>) = 0;
<a name="l00075"></a>00075 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> framesize(encoded_t data) = 0;
<a name="l00076"></a>00076 <span class="keyword">virtual</span> encoded_t <span class="keyword">get</span>(void); <span class="comment">// gives audiobuf mem...</span>
<a name="l00077"></a>00077 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keyword">get</span>(encoded_t data);
<a name="l00078"></a>00078 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> put(encoded_t data);
<a name="l00079"></a>00079 <span class="keyword">virtual</span> encoded_t buf(<span class="keywordtype">void</span>);
<a name="l00080"></a>00080 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> put(<span class="keywordtype">void</span>);
<a name="l00081"></a>00081 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <a class="code" href="a00214.html#ad3c146b0a18955ca36ae65ef8edacaa0" title="Push a linked object onto a stack of linked objects.">push</a>(encoded_t data, <span class="keywordtype">unsigned</span> size);
<a name="l00082"></a>00082 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <a class="code" href="a00214.html#ac33cb2f400b01365f1ebff8d7fa62c9a" title="Pop a linked object from a stack of linked objects.">pull</a>(encoded_t data, <span class="keywordtype">unsigned</span> size);
<a name="l00083"></a>00083 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> fill(<span class="keywordtype">void</span>);
<a name="l00084"></a>00084 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> flush(<span class="keywordtype">void</span>);
<a name="l00085"></a>00085 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> rewind(<span class="keywordtype">void</span>);
<a name="l00086"></a>00086 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> append(<span class="keywordtype">void</span>);
<a name="l00087"></a>00087 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> seek(<a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> position);
<a name="l00088"></a>00088 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> trim(<a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> backup = 0);
<a name="l00089"></a>00089 <span class="keyword">virtual</span> <a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> skip(<a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> offset);
<a name="l00090"></a>00090 <span class="keyword">virtual</span> <a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> locate(<span class="keywordtype">void</span>);
<a name="l00091"></a>00091 <span class="keyword">virtual</span> <a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> length(<span class="keywordtype">void</span>);
<a name="l00092"></a>00092 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00214.html#ab7bef2898e731474a9c3dfa805a6f56d" title="Convenience function to unlock shared object through it&#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l00093"></a>00093 <span class="keyword">virtual</span> operator bool();
<a name="l00094"></a>00094
<a name="l00095"></a>00095 <span class="keyword">inline</span> state_t status(<span class="keywordtype">void</span>)
<a name="l00096"></a>00096 {<span class="keywordflow">return</span> state;};
<a name="l00097"></a>00097 };
<a name="l00098"></a>00098
<a name="l00099"></a>00099 <span class="keyword">typedef</span> audio::framer *framer_t;
<a name="l00100"></a>00100
<a name="l00101"></a>00101 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00214.html#ab7bef2898e731474a9c3dfa805a6f56d" title="Convenience function to unlock shared object through it&#39;s protocol.">release</a>(framer_t buffer);
<a name="l00102"></a>00102 <span class="keyword">static</span> <span class="keywordtype">void</span> u2a(encoded_t data, <span class="keywordtype">unsigned</span> samples);
<a name="l00103"></a>00103 <span class="keyword">static</span> <span class="keywordtype">void</span> a2u(encoded_t data, <span class="keywordtype">unsigned</span> samples);
<a name="l00104"></a>00104 <span class="keyword">static</span> linear_t expand(encoded_t ulaw, <span class="keywordtype">unsigned</span> samples, linear_t target = NULL);
<a name="l00105"></a>00105 <span class="keyword">static</span> encoded_t repack(encoded_t ulaw, <span class="keywordtype">unsigned</span> samples, linear_t source = NULL);
<a name="l00106"></a>00106 <span class="keyword">static</span> int16_t dbm(<span class="keywordtype">float</span> dbm);
<a name="l00107"></a>00107 <span class="keyword">static</span> <span class="keywordtype">float</span> dbm(int16_t linear);
<a name="l00108"></a>00108 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00201.html#a5fc126f9a4406cb2d0d054488cf00809" title="Template function to initialize memory by invoking default constructor.">init</a>(<span class="keywordtype">void</span>);
<a name="l00109"></a>00109 };
<a name="l00110"></a>00110
<a name="l00117"></a>00117 <span class="keyword">class </span>__EXPORT audiocodec : <span class="keyword">public</span> LinkedObject, <span class="keyword">public</span> audio
<a name="l00118"></a>00118 {
<a name="l00119"></a>00119 <span class="keyword">protected</span>:
<a name="l00120"></a>00120 <span class="keyword">friend</span> <span class="keyword">class </span>audiobuffer;
<a name="l00121"></a>00121
<a name="l00122"></a>00122 audiocodec();
<a name="l00123"></a>00123 audiocodec(<span class="keyword">const</span> audiocodec *original);
<a name="l00124"></a>00124
<a name="l00125"></a>00125 <a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> framing; <span class="comment">// framing for this codec...</span>
<a name="l00126"></a>00126 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> rate; <span class="comment">// rate for this codec...</span>
<a name="l00127"></a>00127
<a name="l00128"></a>00128 <span class="keyword">public</span>:
<a name="l00129"></a>00129 type_t type;
<a name="l00130"></a>00130
<a name="l00139"></a>00139 <span class="keyword">virtual</span> audiocodec *create(caddr_t destination = NULL, <a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> framing = 0) <span class="keyword">const</span> = 0;
<a name="l00140"></a>00140
<a name="l00146"></a>00146 <span class="keyword">virtual</span> <span class="keyword">const</span> audiocodec *basetype(<span class="keywordtype">void</span>) <span class="keyword">const</span> = 0;
<a name="l00147"></a>00147
<a name="l00153"></a>00153 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> getMinimum(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
<a name="l00154"></a>00154
<a name="l00160"></a>00160 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> getActual(audio::encoded_t encoded) <span class="keyword">const</span> = 0;
<a name="l00161"></a>00161
<a name="l00166"></a>00166 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> getMaximum(<span class="keywordtype">void</span>) <span class="keyword">const</span> = 0;
<a name="l00167"></a>00167
<a name="l00172"></a>00172 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> getBuffered(<span class="keywordtype">void</span>) <span class="keyword">const</span> = 0;
<a name="l00173"></a>00173
<a name="l00178"></a>00178 <span class="keyword">virtual</span> <a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> getFraming(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
<a name="l00179"></a>00179
<a name="l00184"></a>00184 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> getClock(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
<a name="l00185"></a>00185
<a name="l00190"></a>00190 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> getChannels(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
<a name="l00191"></a>00191
<a name="l00196"></a>00196 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> autype(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
<a name="l00197"></a>00197
<a name="l00202"></a>00202 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> getAlignment(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
<a name="l00203"></a>00203
<a name="l00208"></a>00208 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> getBuffering(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
<a name="l00209"></a>00209
<a name="l00214"></a>00214 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *getName(<span class="keywordtype">void</span>) <span class="keyword">const</span> = 0;
<a name="l00215"></a>00215
<a name="l00221"></a>00221 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> test(<span class="keyword">const</span> <span class="keywordtype">char</span> *name) <span class="keyword">const</span> = 0;
<a name="l00222"></a>00222
<a name="l00228"></a>00228 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> getSize(<span class="keywordtype">void</span>) <span class="keyword">const</span> = 0;
<a name="l00229"></a>00229
<a name="l00236"></a>00236 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> encode(linear_t linear, encoded_t encoded);
<a name="l00237"></a>00237
<a name="l00244"></a>00244 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> decode(encoded_t encoded, linear_t linear);
<a name="l00245"></a>00245
<a name="l00250"></a>00250 <span class="keyword">virtual</span> <span class="keywordtype">void</span> reset(<span class="keywordtype">void</span>);
<a name="l00251"></a>00251
<a name="l00258"></a>00258 <span class="keyword">static</span> <span class="keyword">const</span> audiocodec *find(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> audiocodec *channel = NULL);
<a name="l00259"></a>00259
<a name="l00266"></a>00266 <span class="keyword">static</span> audiocodec *<span class="keyword">get</span>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> audiocodec *channel = NULL);
<a name="l00267"></a>00267
<a name="l00273"></a>00273 <span class="keyword">static</span> audiocodec *first(<span class="keywordtype">void</span>);
<a name="l00274"></a>00274 };
<a name="l00275"></a>00275
<a name="l00284"></a>00284 <span class="keyword">class </span>__EXPORT audiobuffer : <span class="keyword">public</span> audio::framer, <span class="keyword">public</span> audio
<a name="l00285"></a>00285 {
<a name="l00286"></a>00286 <span class="keyword">private</span>:
<a name="l00287"></a>00287 <span class="keyword">static</span> audiobuffer *alloc(<span class="keyword">const</span> audiocodec *channel, <a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> framing = 0);
<a name="l00288"></a>00288
<a name="l00289"></a>00289 <span class="keywordtype">size_t</span> offset;
<a name="l00290"></a>00290
<a name="l00291"></a>00291 <span class="keyword">protected</span>:
<a name="l00292"></a>00292 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> iocount;
<a name="l00293"></a>00293 <a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> limit;
<a name="l00294"></a>00294 encoded_t buffer;
<a name="l00295"></a>00295 <span class="keywordtype">unsigned</span> backstore, allocsize, backpos, backio, convert, buffering;
<a name="l00296"></a>00296 <span class="keyword">union </span>{
<a name="l00297"></a>00297 audiocodec *channel;
<a name="l00298"></a>00298 <span class="keyword">const</span> audiocodec *channelbase;
<a name="l00299"></a>00299 };
<a name="l00300"></a>00300 audiocodec *encoding;
<a name="l00301"></a>00301
<a name="l00302"></a>00302 <span class="keywordtype">bool</span> assign(<span class="keywordtype">size_t</span> size, <span class="keyword">const</span> audiocodec *format = NULL, <a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> framing = 0);
<a name="l00303"></a>00303
<a name="l00304"></a>00304 <span class="keyword">inline</span> encoded_t getBuffer(<span class="keywordtype">void</span>)
<a name="l00305"></a>00305 {<span class="keywordflow">return</span> buffer;};
<a name="l00306"></a>00306
<a name="l00307"></a>00307 <span class="keyword">inline</span> linear_t getConvert(<span class="keywordtype">void</span>)
<a name="l00308"></a>00308 {<span class="keywordflow">return</span> (linear_t)(((caddr_t)(<span class="keyword">this</span>)) + convert);};
<a name="l00309"></a>00309
<a name="l00310"></a>00310 encoded_t transcode(encoded_t source, encoded_t target, audiocodec *from, audiocodec *to);
<a name="l00311"></a>00311 <span class="keywordtype">bool</span> transbuffer(audiocodec *from, audiocodec *to);
<a name="l00312"></a>00312
<a name="l00313"></a>00313 <span class="keyword">public</span>:
<a name="l00314"></a>00314 <a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> frametime(<span class="keywordtype">void</span>);
<a name="l00315"></a>00315 <span class="keywordtype">unsigned</span> framesize(<span class="keywordtype">void</span>);
<a name="l00316"></a>00316 <span class="keywordtype">unsigned</span> framesize(encoded_t data);
<a name="l00317"></a>00317
<a name="l00322"></a>00322 <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> getContexts(<span class="keywordtype">void</span>)
<a name="l00323"></a>00323 {<span class="keywordflow">return</span> iocount;};
<a name="l00324"></a>00324
<a name="l00325"></a>00325 <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> getConversion(<span class="keywordtype">void</span>)
<a name="l00326"></a>00326 {<span class="keywordflow">return</span> backstore - convert;};
<a name="l00327"></a>00327
<a name="l00328"></a>00328 <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> getAvailable(<span class="keywordtype">void</span>)
<a name="l00329"></a>00329 {<span class="keywordflow">return</span> allocsize - (unsigned)(buffer - ((encoded_t)(<span class="keyword">this</span>)));};
<a name="l00330"></a>00330
<a name="l00331"></a>00331 <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> getBuffering(<span class="keywordtype">void</span>)
<a name="l00332"></a>00332 {<span class="keywordflow">return</span> buffering;};
<a name="l00333"></a>00333
<a name="l00334"></a>00334 <span class="keyword">inline</span> <span class="keyword">const</span> audiocodec *getChannel(<span class="keywordtype">void</span>)
<a name="l00335"></a>00335 {<span class="keywordflow">return</span> channel;};
<a name="l00336"></a>00336
<a name="l00337"></a>00337 <span class="keyword">inline</span> <span class="keyword">const</span> audiocodec *getEncoding(<span class="keywordtype">void</span>)
<a name="l00338"></a>00338 {<span class="keywordflow">return</span> encoding;};
<a name="l00339"></a>00339
<a name="l00340"></a>00340 <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> getBackstore(<span class="keywordtype">void</span>)
<a name="l00341"></a>00341 {<span class="keywordflow">return</span> allocsize - backstore;};
<a name="l00342"></a>00342
<a name="l00343"></a>00343 <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> getAllocated(<span class="keywordtype">void</span>)
<a name="l00344"></a>00344 {<span class="keywordflow">return</span> allocsize;};
<a name="l00345"></a>00345
<a name="l00352"></a>00352 linear_t expand(encoded_t data);
<a name="l00353"></a>00353
<a name="l00354"></a>00354 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00214.html#ab7bef2898e731474a9c3dfa805a6f56d" title="Convenience function to unlock shared object through it&#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l00355"></a>00355 <span class="keyword">virtual</span> fd_t handle(<span class="keywordtype">void</span>);
<a name="l00356"></a>00356
<a name="l00357"></a>00357 <span class="keywordtype">unsigned</span> text(<span class="keywordtype">char</span> *str, <span class="keywordtype">size_t</span> size);
<a name="l00358"></a>00358 <span class="keywordtype">unsigned</span> <a class="code" href="a00214.html#ac33cb2f400b01365f1ebff8d7fa62c9a" title="Pop a linked object from a stack of linked objects.">pull</a>(encoded_t data, <span class="keywordtype">unsigned</span> len);
<a name="l00359"></a>00359 <span class="keywordtype">unsigned</span> <a class="code" href="a00214.html#ad3c146b0a18955ca36ae65ef8edacaa0" title="Push a linked object onto a stack of linked objects.">push</a>(encoded_t data, <span class="keywordtype">unsigned</span> len);
<a name="l00360"></a>00360
<a name="l00361"></a>00361 <span class="keyword">static</span> audiobuffer *create(<a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> limit);
<a name="l00362"></a>00362 <span class="keyword">static</span> audiobuffer *create(<span class="keyword">const</span> audiocodec *channel, <a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> framing);
<a name="l00363"></a>00363 };
<a name="l00364"></a>00364
<a name="l00371"></a>00371 <span class="keyword">class </span>__EXPORT audiofile : <span class="keyword">public</span> audiobuffer
<a name="l00372"></a>00372 {
<a name="l00373"></a>00373 <span class="keyword">protected</span>:
<a name="l00374"></a>00374 fsys::offset_t hiwater, current, headersize;
<a name="l00375"></a>00375 <span class="keywordtype">size_t</span> maxio, minio, bufio;
<a name="l00376"></a>00376 <span class="keywordtype">unsigned</span> bufpos, bufend;
<a name="l00377"></a>00377
<a name="l00378"></a>00378 uint8_t header[40]; <span class="comment">// header buffer</span>
<a name="l00379"></a>00379 <span class="keyword">enum</span> {RAW, AU, RIFF, WAV} filetype;
<a name="l00380"></a>00380 fsys fs;
<a name="l00381"></a>00381
<a name="l00382"></a>00382 <span class="keywordtype">void</span> open(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, fsys::access_t <a class="code" href="a00214.html#ad6378c2aa4e17197d8e936674e5b2687" title="Convenience function to access (lock) shared object through it&#39;s protocol.">access</a>, <span class="keywordtype">size_t</span> objsize, <a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> framing);
<a name="l00383"></a>00383 <span class="keywordtype">bool</span> rewind(<span class="keywordtype">void</span>);
<a name="l00384"></a>00384 <span class="keywordtype">bool</span> append(<span class="keywordtype">void</span>);
<a name="l00385"></a>00385 <span class="keywordtype">bool</span> flush(<span class="keywordtype">void</span>);
<a name="l00386"></a>00386 <a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> length(<span class="keywordtype">void</span>);
<a name="l00387"></a>00387 <a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> locate(<span class="keywordtype">void</span>);
<a name="l00388"></a>00388 <span class="keywordtype">bool</span> seek(<a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> position);
<a name="l00389"></a>00389 <span class="keywordtype">bool</span> trim(<a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> backup);
<a name="l00390"></a>00390 <a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> skip(<a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> offset);
<a name="l00391"></a>00391 fd_t handle(<span class="keywordtype">void</span>);
<a name="l00392"></a>00392 operator bool();
<a name="l00393"></a>00393
<a name="l00394"></a>00394 <span class="keyword">public</span>:
<a name="l00395"></a>00395 <span class="keyword">static</span> <span class="keywordtype">bool</span> info(audiobuffer *buffer, <span class="keyword">const</span> <span class="keywordtype">char</span> *path, <a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> framing = 0);
<a name="l00396"></a>00396
<a name="l00404"></a>00404 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="a00214.html#ad6378c2aa4e17197d8e936674e5b2687" title="Convenience function to access (lock) shared object through it&#39;s protocol.">access</a>(audiobuffer *buffer, <span class="keyword">const</span> <span class="keywordtype">char</span> *path, <a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> preferred = 0);
<a name="l00405"></a>00405
<a name="l00416"></a>00416 <span class="keyword">static</span> <span class="keywordtype">bool</span> create(audiobuffer *buffer, <span class="keyword">const</span> <span class="keywordtype">char</span> *path, <a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> preferred = 0, <span class="keyword">const</span> <span class="keywordtype">char</span> *note = NULL, <span class="keyword">const</span> audiocodec *encoding = NULL, <span class="keywordtype">unsigned</span> mode = 0640);
<a name="l00417"></a>00417
<a name="l00425"></a>00425 <span class="keyword">static</span> <span class="keywordtype">bool</span> append(audiobuffer *buffer, <span class="keyword">const</span> <span class="keywordtype">char</span> *path, <a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> preferred = 0);
<a name="l00426"></a>00426 };
<a name="l00427"></a>00427
<a name="l00432"></a>00432 <span class="keyword">class </span>__EXPORT tonegen : <span class="keyword">private</span> audiobuffer
<a name="l00433"></a>00433 {
<a name="l00434"></a>00434 };
<a name="l00435"></a>00435
<a name="l00436"></a>00436 END_NAMESPACE
<a name="l00437"></a>00437
<a name="l00438"></a>00438 <span class="preprocessor">#endif</span>
<a name="l00439"></a>00439 <span class="preprocessor"></span>
<a name="l00440"></a>00440
</pre></div></div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Jul 6 08:22:01 2010 for UCommon by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>
|