classaflibaudio.html

来自「一个共享源码的音频库5(doc 文档)」· HTML 代码 · 共 994 行 · 第 1/3 页

HTML
994
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>aflibAudio class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.15 --><center><a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center><hr><h1>aflibAudio  Class Reference</h1>Main base class for all audio objects to be placed in a chain. <a href="#_details">More...</a><p><code>#include &lt;<a class="el" href="aflibAudio_8h-source.html">aflibAudio.h</a>&gt;</code><p><p>Inheritance diagram for aflibAudio:<p><center><img src="classaflibAudio.png" usemap="#aflibAudio_map" border="0"></center><map name="aflibAudio_map"><area href="classaflibChain.html" alt="aflibChain" shape="rect" coords="0,0,154,24"><area href="classaflibMemCache.html" alt="aflibMemCache" shape="rect" coords="164,0,318,24"><area href="classaflibAudioBWFilter.html" alt="aflibAudioBWFilter" shape="rect" coords="246,112,400,136"><area href="classaflibAudioConstantSrc.html" alt="aflibAudioConstantSrc" shape="rect" coords="246,168,400,192"><area href="classaflibAudioEdit.html" alt="aflibAudioEdit" shape="rect" coords="246,224,400,248"><area href="classaflibAudioFile.html" alt="aflibAudioFile" shape="rect" coords="246,280,400,304"><area href="classaflibAudioMemoryInput.html" alt="aflibAudioMemoryInput" shape="rect" coords="246,336,400,360"><area href="classaflibAudioMixer.html" alt="aflibAudioMixer" shape="rect" coords="246,392,400,416"><area href="classaflibAudioRecorder.html" alt="aflibAudioRecorder" shape="rect" coords="246,448,400,472"><area href="classaflibAudioSampleRateCvt.html" alt="aflibAudioSampleRateCvt" shape="rect" coords="246,504,400,528"><area href="classaflibAudioSpectrum.html" alt="aflibAudioSpectrum" shape="rect" coords="246,560,400,584"></map><a href="classaflibAudio-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td colspan=2><br><h2>Public Methods</h2></td></tr><tr><td nowrap align=right valign=top>virtual&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#a0">~aflibAudio</a> ()</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Destructor.</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#a1">enable</a> (bool enable)</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Enables or disables an object in a chain.</em> <a href="#a1">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#a2">getEnable</a> () const</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Gets current state of object.</em> <a href="#a2">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#a3">enableDataSizeConversion</a> (bool enable)</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Enables or disables data size conversion.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#a4">enableEndianConversion</a> (bool enable)</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Enables or disables endian conversion.</em> <a href="#a4">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#a5">enableSampleRateConversion</a> (bool enable)</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Enables or disables sample rate conversion.</em> <a href="#a5">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#a6">enableChannelsConversion</a> (bool enable)</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Enables or disables number of channels conversion.</em> <a href="#a6">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#a7">setInputConfig</a> (const <a class="el" href="classaflibConfig.html">aflibConfig</a> &amp;cfg)</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Sets the input audio data configuration of an object.</em> <a href="#a7">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>virtual const <a class="el" href="classaflibConfig.html">aflibConfig</a> &amp;&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#a8">getInputConfig</a> () const</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Returns the input audio data configuration of an object.</em> <a href="#a8">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#a9">setOutputConfig</a> (const <a class="el" href="classaflibConfig.html">aflibConfig</a> &amp;cfg)</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Sets the output audio data configuration of an object.</em> <a href="#a9">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>virtual const <a class="el" href="classaflibConfig.html">aflibConfig</a> &amp;&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#a10">getOutputConfig</a> () const</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Returns the output audio data configuration of an object.</em> <a href="#a10">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>virtual const char *&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#a11">getName</a> () const</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Returns the name of the derived class, must be implemented by derived class.</em> <a href="#a11">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>virtual <a class="el" href="aflib_8h.html#a33">aflibStatus</a>&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#a12">compute_segment</a> (list&lt; <a class="el" href="classaflibData.html">aflibData</a> * &gt; &amp;, long long)</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Work function, must be implemented by derived class.</em> <a href="#a12">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>virtual <a class="el" href="classaflibData.html">aflibData</a> *&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#a13">process</a> (<a class="el" href="aflib_8h.html#a33">aflibStatus</a> &amp;ret_status, long long position, int &amp;num_samples, bool free_memory=TRUE)</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Main processing function for pulling data thru an audio chain.</em> <a href="#a13">More...</a><em></em></font><br><br></td></tr><tr><td colspan=2><br><h2>Protected Methods</h2></td></tr><tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#b0">aflibAudio</a> ()</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Constructor.</em> <a href="#b0">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#b1">aflibAudio</a> (aflibAudio &amp;audio)</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Constructor.</em> <a href="#b1">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>aflibAudio *&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#b2">convertSampleRate</a> (aflibAudio &amp;parent)</td></tr><tr><td nowrap align=right valign=top>aflibAudio *&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#b3">convertChannels</a> (aflibAudio &amp;parent)</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#b4">convertData</a> (<a class="el" href="classaflibData.html">aflibData</a> &amp;data)</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#b5">examineChain</a> ()</td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#b6">checkChain</a> (const aflibAudio *audio) const</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#b7">preprocessChain</a> (aflibAudio *audio, aflibAudio *child)</td></tr><tr><td nowrap align=right valign=top>virtual bool&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#b8">isDataSizeSupported</a> (<a class="el" href="aflib_8h.html#a30">aflib_data_size</a> size)</td></tr><tr><td nowrap align=right valign=top>virtual bool&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#b9">isEndianSupported</a> (<a class="el" href="aflib_8h.html#a31">aflib_data_endian</a> end)</td></tr><tr><td nowrap align=right valign=top>virtual bool&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#b10">isSampleRateSupported</a> (int &amp;rate)</td></tr><tr><td nowrap align=right valign=top>virtual bool&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#b11">isChannelsSupported</a> (int &amp;channels)</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#b12">incrementLevel</a> ()</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classaflibAudio.html#b13">decrementLevel</a> ()</td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Main base class for all audio objects to be placed in a chain.<p>This is the Base class that all objects will use that want to be used as audio objects with this library. It inherts functionality from the <a class="el" href="classaflibChain.html">aflibChain</a> class so that these objects can be used in a chain. It is also derived from <a class="el" href="classaflibMemCache.html">aflibMemCache</a> class. This provides memory caching for an object.<p>Two constructors are provided. A constructor with no parameters is provided that derived classes should call that can be used as the start of a chain. A mixing class for instance makes no sense to have a default contructor since it can't be used as the start of a chain. Most often the start of a chain will be a file or device object. The second constructor takes an aflibAudio object. This should be called by a derived class that could have a parent audio object feeding it. This will more than likely be almost all objects.<p>Function compute_segment is pure virtual so that all derived classes will have to implement it. There is no implementation in this base class. This is the function that derived classes implement that will do the work. This function will be passed a list of <a class="el" href="classaflibData.html">aflibData</a> objects. One for each parent of the object. The order in the list is the same as the order from the getParents function. It will also be passed the position of the data. When done the function should return AFLIB_SUCCESS if success.<p>Function process is defined in this base class and should not be overriden except in certain circumstances. Such as an audio class with more than 1 input that needs special requirements. It provides the functionality to push data throught the chain. The user application can call process from any element in the chain. It will work its way back through the chain and when it gets to the start will start an <a class="el" href="classaflibData.html">aflibData</a> object through the chain until arriving at and processing this object. This function might be the ideal place in the future to enable threading. <p><hr><h2>Constructor &amp; Destructor Documentation</h2><a name="a0" doxytag="aflibAudio::~aflibAudio"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> aflibAudio::~aflibAudio </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Destructor.<p>    </td>  </tr></table><a name="b0" doxytag="aflibAudio::aflibAudio"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> aflibAudio::aflibAudio </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Constructor.<p>This constructor is for derived classes that have no parent audio object.     </td>  </tr></table><a name="b1" doxytag="aflibAudio::aflibAudio"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> aflibAudio::aflibAudio </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">aflibAudio &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>audio</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Constructor.<p>This constructor is for derived classes that have a parent audio object.     </td>  </tr></table><hr><h2>Member Function Documentation</h2><a name="b6" doxytag="aflibAudio::checkChain"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> bool aflibAudio::checkChain </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const aflibAudio *&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>audio</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap> const<code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>    </td>  </tr></table><a name="a12" doxytag="aflibAudio::compute_segment"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> virtual <a class="el" href="aflib_8h.html#a33">aflibStatus</a> aflibAudio::compute_segment </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">list&lt; <a class="el" href="classaflibData.html">aflibData</a> * &gt; &amp;&nbsp;</td>          <td class="mdname" nowrap>&nbsp;, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>long&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>long</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"><code> [inline, virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Work function, must be implemented by derived class.<p><p>Reimplemented in <a class="el" href="classaflibAudioBWFilter.html#a4">aflibAudioBWFilter</a>, <a class="el" href="classaflibAudioConstantSrc.html#a4">aflibAudioConstantSrc</a>, <a class="el" href="classaflibAudioEdit.html#a13">aflibAudioEdit</a>, <a class="el" href="classaflibAudioFile.html#a5">aflibAudioFile</a>, <a class="el" href="classaflibAudioMemoryInput.html#a3">aflibAudioMemoryInput</a>, <a class="el" href="classaflibAudioMixer.html#a9">aflibAudioMixer</a>, <a class="el" href="classaflibAudioRecorder.html#a7">aflibAudioRecorder</a>, <a class="el" href="classaflibAudioSampleRateCvt.html#a5">aflibAudioSampleRateCvt</a>, and <a class="el" href="classaflibAudioSpectrum.html#a6">aflibAudioSpectrum</a>.    </td>  </tr></table><a name="b3" doxytag="aflibAudio::convertChannels"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> aflibAudio * aflibAudio::convertChannels </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">aflibAudio &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>parent</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>    </td>  </tr></table><a name="b4" doxytag="aflibAudio::convertData"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> void aflibAudio::convertData </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="classaflibData.html">aflibData</a> &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>data</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>    </td>  </tr></table><a name="b2" doxytag="aflibAudio::convertSampleRate"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> aflibAudio * aflibAudio::convertSampleRate </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">aflibAudio &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>parent</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?