Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > os > by-pkgid > 9c481c872fb0ae0cbadccdc2f4a18ab6 > files > 205

libasync-devel-0.17.0-5.fc14.x86_64.rpm

<!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>Async: Async::AudioValve Class Reference</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.2-20100208 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="namespaceAsync.html">Async</a>::<a class="el" href="classAsync_1_1AudioValve.html">AudioValve</a>
  </div>
</div>
<div class="contents">
<h1>Async::AudioValve Class Reference</h1><!-- doxytag: class="Async::AudioValve" --><!-- doxytag: inherits="Async::AudioSink,Async::AudioSource" -->
<p>Implements a "valve" for audio.  
<a href="#_details">More...</a></p>

<p><code>#include &lt;<a class="el" href="AsyncAudioValve_8h_source.html">AsyncAudioValve.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for Async::AudioValve:</div>
<div class="dynsection">
 <div class="center">
  <img src="classAsync_1_1AudioValve.png" usemap="#Async::AudioValve_map" alt=""/>
  <map id="Async::AudioValve_map" name="Async::AudioValve_map">
<area href="classAsync_1_1AudioSink.html" alt="Async::AudioSink" shape="rect" coords="0,0,128,24"/>
<area href="classAsync_1_1AudioSource.html" alt="Async::AudioSource" shape="rect" coords="138,0,266,24"/>
</map>
 </div>
</div>

<p><a href="classAsync_1_1AudioValve-members.html">List of all members.</a></p>
<h2>Public Member Functions</h2>
<ul>
<li><a class="el" href="classAsync_1_1AudioValve.html#aa67dd3ca1a28bbd33b6c6d6a035f1d24">AudioValve</a> (void)
<dl class="el"><dd class="mdescRight">Default constuctor.  <a href="#aa67dd3ca1a28bbd33b6c6d6a035f1d24"></a><br/></dl><li><a class="el" href="classAsync_1_1AudioValve.html#abed070587739097e21acd8faa685957f">~AudioValve</a> (void)
<dl class="el"><dd class="mdescRight">Destructor.  <a href="#abed070587739097e21acd8faa685957f"></a><br/></dl><li>void <a class="el" href="classAsync_1_1AudioValve.html#a6c9cc481493f4a8fa68aebba1f545bce">setOpen</a> (bool do_open)
<dl class="el"><dd class="mdescRight">Open or close the valve.  <a href="#a6c9cc481493f4a8fa68aebba1f545bce"></a><br/></dl><li>void <a class="el" href="classAsync_1_1AudioValve.html#abe5276018ad9a0d5db336e1c03b55554">setBlockWhenClosed</a> (bool block_when_closed)
<dl class="el"><dd class="mdescRight">Setup audio stream blocking when valve is closed.  <a href="#abe5276018ad9a0d5db336e1c03b55554"></a><br/></dl><li>bool <a class="el" href="classAsync_1_1AudioValve.html#a68949805d8e385dfa521f8ba1245a12d">isOpen</a> (void) const 
<dl class="el"><dd class="mdescRight">Check if the valve is open.  <a href="#a68949805d8e385dfa521f8ba1245a12d"></a><br/></dl><li>bool <a class="el" href="classAsync_1_1AudioValve.html#a5d5989016129eab94c82df44570ab6d9">isIdle</a> (void) const 
<dl class="el"><dd class="mdescRight">Check if the valve is idle.  <a href="#a5d5989016129eab94c82df44570ab6d9"></a><br/></dl><li>int <a class="el" href="classAsync_1_1AudioValve.html#ad0d94a0a09f1d0a04935651b9962228a">writeSamples</a> (const float *samples, int count)
<dl class="el"><dd class="mdescRight">Write samples into the valve.  <a href="#ad0d94a0a09f1d0a04935651b9962228a"></a><br/></dl><li>void <a class="el" href="classAsync_1_1AudioValve.html#ad82dfbcf4f44765b4fa54ea62bc2cac6">flushSamples</a> (void)
<dl class="el"><dd class="mdescRight">Tell the valve to flush the previously written samples.  <a href="#ad82dfbcf4f44765b4fa54ea62bc2cac6"></a><br/></dl><li>void <a class="el" href="classAsync_1_1AudioValve.html#a3557e4f4c65077ebc7471e6c72027166">resumeOutput</a> (void)
<dl class="el"><dd class="mdescRight">Resume audio output to the sink.  <a href="#a3557e4f4c65077ebc7471e6c72027166"></a><br/></dl><li>virtual void <a class="el" href="classAsync_1_1AudioValve.html#a3066a711624eec1c9838fb0e2b5bb365">allSamplesFlushed</a> (void)
<dl class="el"><dd class="mdescRight">The registered sink has flushed all samples.  <a href="#a3066a711624eec1c9838fb0e2b5bb365"></a><br/></dl></ul>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Implements a "valve" for audio. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>Tobias Blomberg / SM0SVX </dd></dl>
<dl class="date"><dt><b>Date:</b></dt><dd>2006-07-08</dd></dl>
<p>This class implements a "valve" for audio. That is, the audio stream can be turned on or off. It's named "valve" since the whole <a class="el" href="namespaceAsync.html" title="Namespace for the asynchronous programming classes.">Async</a> audio concept is called audio pipe. </p>

<p>Definition at line <a class="el" href="AsyncAudioValve_8h_source.html#l00116">116</a> of file <a class="el" href="AsyncAudioValve_8h_source.html">AsyncAudioValve.h</a>.</p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aa67dd3ca1a28bbd33b6c6d6a035f1d24"></a><!-- doxytag: member="Async::AudioValve::AudioValve" ref="aa67dd3ca1a28bbd33b6c6d6a035f1d24" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Async::AudioValve::AudioValve </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, explicit]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Default constuctor. </p>

<p>Definition at line <a class="el" href="AsyncAudioValve_8h_source.html#l00122">122</a> of file <a class="el" href="AsyncAudioValve_8h_source.html">AsyncAudioValve.h</a>.</p>

</div>
</div>
<a class="anchor" id="abed070587739097e21acd8faa685957f"></a><!-- doxytag: member="Async::AudioValve::~AudioValve" ref="abed070587739097e21acd8faa685957f" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Async::AudioValve::~AudioValve </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Destructor. </p>

<p>Definition at line <a class="el" href="AsyncAudioValve_8h_source.html#l00131">131</a> of file <a class="el" href="AsyncAudioValve_8h_source.html">AsyncAudioValve.h</a>.</p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a3066a711624eec1c9838fb0e2b5bb365"></a><!-- doxytag: member="Async::AudioValve::allSamplesFlushed" ref="a3066a711624eec1c9838fb0e2b5bb365" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void Async::AudioValve::allSamplesFlushed </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The registered sink has flushed all samples. </p>
<p>This function must be implemented by the inheriting class. This function will be called when all samples have been flushed in the registered sink. </p>

<p>Reimplemented from <a class="el" href="classAsync_1_1AudioSource.html#a563adf6411eddbd056abf206a12354b6">Async::AudioSource</a>.</p>

<p>Definition at line <a class="el" href="AsyncAudioValve_8h_source.html#l00305">305</a> of file <a class="el" href="AsyncAudioValve_8h_source.html">AsyncAudioValve.h</a>.</p>

<p>References <a class="el" href="classAsync_1_1AudioSink.html#a2548622eb5c52ef80f3bd297f290be3c">Async::AudioSink::sourceAllSamplesFlushed()</a>.</p>

</div>
</div>
<a class="anchor" id="ad82dfbcf4f44765b4fa54ea62bc2cac6"></a><!-- doxytag: member="Async::AudioValve::flushSamples" ref="ad82dfbcf4f44765b4fa54ea62bc2cac6" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Async::AudioValve::flushSamples </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Tell the valve to flush the previously written samples. </p>
<p>This function is used to tell the valve to flush previously written samples. When done flushing, the valve will call the allSamplesFlushed function in the connected source object. This function is normally only called from a connected source object. </p>

<p>Reimplemented from <a class="el" href="classAsync_1_1AudioSink.html#adde14468248671c6c5c85eb47234e0fa">Async::AudioSink</a>.</p>

<p>Definition at line <a class="el" href="AsyncAudioValve_8h_source.html#l00263">263</a> of file <a class="el" href="AsyncAudioValve_8h_source.html">AsyncAudioValve.h</a>.</p>

<p>References <a class="el" href="classAsync_1_1AudioSource.html#a5837ec95fef7d668d1c5241cee54646c">Async::AudioSource::sinkFlushSamples()</a>, and <a class="el" href="classAsync_1_1AudioSink.html#a2548622eb5c52ef80f3bd297f290be3c">Async::AudioSink::sourceAllSamplesFlushed()</a>.</p>

</div>
</div>
<a class="anchor" id="a5d5989016129eab94c82df44570ab6d9"></a><!-- doxytag: member="Async::AudioValve::isIdle" ref="a5d5989016129eab94c82df44570ab6d9" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Async::AudioValve::isIdle </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Check if the valve is idle. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Return <em>true</em> if the valve is idle or else <em>false</em> </dd></dl>

<p>Definition at line <a class="el" href="AsyncAudioValve_8h_source.html#l00217">217</a> of file <a class="el" href="AsyncAudioValve_8h_source.html">AsyncAudioValve.h</a>.</p>

</div>
</div>
<a class="anchor" id="a68949805d8e385dfa521f8ba1245a12d"></a><!-- doxytag: member="Async::AudioValve::isOpen" ref="a68949805d8e385dfa521f8ba1245a12d" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Async::AudioValve::isOpen </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Check if the valve is open. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Return <em>true</em> if the valve is open or else <em>false</em> </dd></dl>

<p>Definition at line <a class="el" href="AsyncAudioValve_8h_source.html#l00208">208</a> of file <a class="el" href="AsyncAudioValve_8h_source.html">AsyncAudioValve.h</a>.</p>

</div>
</div>
<a class="anchor" id="a3557e4f4c65077ebc7471e6c72027166"></a><!-- doxytag: member="Async::AudioValve::resumeOutput" ref="a3557e4f4c65077ebc7471e6c72027166" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Async::AudioValve::resumeOutput </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Resume audio output to the sink. </p>
<p>This function must be reimplemented by the inheriting class. It will be called when the registered audio sink is ready to accept more samples. This function is normally only called from a connected sink object. </p>

<p>Reimplemented from <a class="el" href="classAsync_1_1AudioSource.html#ac187f89a6094ec066dab5b4fd3108754">Async::AudioSource</a>.</p>

<p>Definition at line <a class="el" href="AsyncAudioValve_8h_source.html#l00286">286</a> of file <a class="el" href="AsyncAudioValve_8h_source.html">AsyncAudioValve.h</a>.</p>

<p>References <a class="el" href="classAsync_1_1AudioSink.html#a4c16d7b78aade12abc0b57ec1db95f62">Async::AudioSink::sourceResumeOutput()</a>.</p>

</div>
</div>
<a class="anchor" id="abe5276018ad9a0d5db336e1c03b55554"></a><!-- doxytag: member="Async::AudioValve::setBlockWhenClosed" ref="abe5276018ad9a0d5db336e1c03b55554" args="(bool block_when_closed)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Async::AudioValve::setBlockWhenClosed </td>
          <td>(</td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>block_when_closed</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Setup audio stream blocking when valve is closed. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>block_when_closed</em>&nbsp;</td><td>When <em>true</em>, block the incoming audio stream when the valve is closed. When <em>false</em>, incoming audio is thrown away when the valve is closed.</td></tr>
  </table>
  </dd>
</dl>
<p>Use this method to set if the valve should block or drop the incoming audio stream when the valve is closed. </p>

<p>Definition at line <a class="el" href="AsyncAudioValve_8h_source.html#l00188">188</a> of file <a class="el" href="AsyncAudioValve_8h_source.html">AsyncAudioValve.h</a>.</p>

<p>References <a class="el" href="classAsync_1_1AudioSink.html#a4c16d7b78aade12abc0b57ec1db95f62">Async::AudioSink::sourceResumeOutput()</a>.</p>

</div>
</div>
<a class="anchor" id="a6c9cc481493f4a8fa68aebba1f545bce"></a><!-- doxytag: member="Async::AudioValve::setOpen" ref="a6c9cc481493f4a8fa68aebba1f545bce" args="(bool do_open)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Async::AudioValve::setOpen </td>
          <td>(</td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>do_open</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Open or close the valve. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>do_open</em>&nbsp;</td><td>If <em>true</em> the valve is open or else it's closed</td></tr>
  </table>
  </dd>
</dl>
<p>This function is used to open or close the audio valve. When the valve is closed, the connected sink is flushed. What is done with the incoming audio when the valve is closed depends on the block_when_closed parameter to the constructor. </p>

<p>Definition at line <a class="el" href="AsyncAudioValve_8h_source.html#l00142">142</a> of file <a class="el" href="AsyncAudioValve_8h_source.html">AsyncAudioValve.h</a>.</p>

<p>References <a class="el" href="classAsync_1_1AudioSource.html#a5837ec95fef7d668d1c5241cee54646c">Async::AudioSource::sinkFlushSamples()</a>, <a class="el" href="classAsync_1_1AudioSink.html#a2548622eb5c52ef80f3bd297f290be3c">Async::AudioSink::sourceAllSamplesFlushed()</a>, and <a class="el" href="classAsync_1_1AudioSink.html#a4c16d7b78aade12abc0b57ec1db95f62">Async::AudioSink::sourceResumeOutput()</a>.</p>

</div>
</div>
<a class="anchor" id="ad0d94a0a09f1d0a04935651b9962228a"></a><!-- doxytag: member="Async::AudioValve::writeSamples" ref="ad0d94a0a09f1d0a04935651b9962228a" args="(const float *samples, int count)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Async::AudioValve::writeSamples </td>
          <td>(</td>
          <td class="paramtype">const float *&nbsp;</td>
          <td class="paramname"> <em>samples</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>count</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Write samples into the valve. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>samples</em>&nbsp;</td><td>The buffer containing the samples </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>count</em>&nbsp;</td><td>The number of samples in the buffer </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the number of samples that has been taken care of</dd></dl>
<p>This function is used to write audio into the valve. If it returns 0, no more samples should be written until the resumeOutput function in the source have been called. This function is normally only called from a connected source object. </p>

<p>Reimplemented from <a class="el" href="classAsync_1_1AudioSink.html#a490aa6380d6b0069fc501f0d9f62e236">Async::AudioSink</a>.</p>

<p>Definition at line <a class="el" href="AsyncAudioValve_8h_source.html#l00233">233</a> of file <a class="el" href="AsyncAudioValve_8h_source.html">AsyncAudioValve.h</a>.</p>

<p>References <a class="el" href="classAsync_1_1AudioSource.html#ad23a249abf0f8fd39d364301364740a6">Async::AudioSource::sinkWriteSamples()</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="AsyncAudioValve_8h_source.html">AsyncAudioValve.h</a></li>
</ul>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2-20100208 </small></address>
</body>
</html>