/usr/share/doc/libucommon-dev/a00001.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 | <!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: audio.cpp</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><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>audio.cpp</h1><p>Some testing code for audio classes.</p>
<div class="fragment"><pre class="fragment"><span class="comment">// Copyright (C) 2010 David Sugar, Tycho Softworks.</span>
<span class="comment">//</span>
<span class="comment">// This file is part of GNU uCommon C++.</span>
<span class="comment">//</span>
<span class="comment">// GNU uCommon C++ is free software; you can redistribute it and/or modify</span>
<span class="comment">// it under the terms of the GNU General Public License as published by</span>
<span class="comment">// the Free Software Foundation; either version 3 of the License, or</span>
<span class="comment">// (at your option) any later version.</span>
<span class="comment">//</span>
<span class="comment">// GNU uCommon C++ is distributed in the hope that it will be useful,</span>
<span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the</span>
<span class="comment">// GNU General Public License for more details.</span>
<span class="comment">//</span>
<span class="comment">// You should have received a copy of the GNU General Public License</span>
<span class="comment">// along with GNU uCommon C++. If not, see <http://www.gnu.org/licenses/>.</span>
<span class="preprocessor">#include <config.h></span>
<span class="preprocessor">#include <<a class="code" href="a00187.html" title="This is the GNU telephonic audio library for the GNU uCommon C++ framework.">ucommon/audio.h</a>></span>
<span class="keyword">using namespace </span>UCOMMON_NAMESPACE;
<span class="keyword">static</span> <span class="keyword">const</span> audiocodec *ac = NULL;
<span class="keyword">static</span> <span class="keywordtype">unsigned</span> relcount = 0;
<span class="keyword">static</span> uint8_t buftest;
<span class="keyword">class </span>debugbuffer : <span class="keyword">public</span> audiobuffer
{
<span class="keyword">private</span>:
debugbuffer() {
buffer = &buftest;
state = ACTIVE;
<span class="comment">// we assume overlay data remains correct at construction...</span>
assert(channel == ac);
assert(backpos == 0);
assert(backstore != 0);
}
<span class="keywordtype">void</span> <a name="a0"></a><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>) {
<span class="comment">// we assume overlay data remains intact for life of object...</span>
assert(channel->basetype() == ac->basetype());
assert(backpos == 0);
assert(backstore != 0);
++relcount;
<a class="code" href="a00214.html#ab7bef2898e731474a9c3dfa805a6f56d" title="Convenience function to unlock shared object through it&#39;s protocol.">audiobuffer::release</a>();
}
<span class="keywordtype">unsigned</span> offset(<span class="keywordtype">void</span>) {
<span class="keywordflow">return</span> <span class="keyword">sizeof</span>(debugbuffer);
}
<span class="keyword">public</span>:
<span class="keyword">static</span> <span class="keywordtype">void</span> attach(audiobuffer *buffer) {
caddr_t cp = (caddr_t)buffer;
<span class="keyword">new</span>(cp) debugbuffer();
}
<span class="keyword">static</span> encoded_t bufof(audiobuffer *buffer) {
<span class="keywordflow">return</span> ((debugbuffer *)buffer)->getBuffer();
}
};
<span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv)
{
ac = audiocodec::get(<span class="stringliteral">"pcmu"</span>);
assert(ac != NULL);
audiobuffer *buffer = audiobuffer::create(ac, 0);
assert(buffer != NULL);
debugbuffer::attach(buffer);
assert(debugbuffer::bufof(buffer) == &buftest);
buffer->release();
assert(relcount == 1);
assert(debugbuffer::bufof(buffer) == NULL);
<a class="code" href="a00214.html#ab7bef2898e731474a9c3dfa805a6f56d" title="Convenience function to unlock shared object through it&#39;s protocol.">audio::release</a>(buffer);
assert(relcount == 2);
}
</pre></div> </div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Jul 6 08:22:00 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>
|