Release 4.0.12 tarball
[rtaudio.git] / doc / html / RtAudio_8h.html
index d361bde945e1cdb7037ad1a819de55414d566cbf..9196f772ddaba631dff76cf4ac8984d235835974 100644 (file)
@@ -8,37 +8,58 @@
 <CENTER>
 <a class="qindex" href="index.html">Home</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
 <HR>
-<!-- Generated by Doxygen 1.6.2 -->
+<!-- Generated by Doxygen 1.8.2 -->
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#nested-classes">Classes</a> &#124;
+<a href="#typedef-members">Typedefs</a>  </div>
+  <div class="headertitle">
+<div class="title">RtAudio.h File Reference</div>  </div>
+</div><!--header-->
 <div class="contents">
-<h1>RtAudio.h File Reference</h1><code>#include &lt;string&gt;</code><br/>
+<div class="textblock"><code>#include &lt;string&gt;</code><br/>
 <code>#include &lt;vector&gt;</code><br/>
 <code>#include &quot;RtError.h&quot;</code><br/>
 <code>#include &lt;sstream&gt;</code><br/>
-
+</div>
 <p><a href="RtAudio_8h_source.html">Go to the source code of this file.</a></p>
-<table border="0" cellpadding="0" cellspacing="0">
-<tr><td colspan="2"><h2>Classes</h2></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html">RtAudio</a></td></tr>
-<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Realtime audio i/o C++ classes.  <a href="classRtAudio.html#_details">More...</a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1DeviceInfo.html">RtAudio::DeviceInfo</a></td></tr>
-<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The public device information structure for returning queried values.  <a href="structRtAudio_1_1DeviceInfo.html#_details">More...</a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1StreamParameters.html">RtAudio::StreamParameters</a></td></tr>
-<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The structure for specifying input or ouput stream parameters.  <a href="structRtAudio_1_1StreamParameters.html#_details">More...</a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1StreamOptions.html">RtAudio::StreamOptions</a></td></tr>
-<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The structure for specifying stream options.  <a href="structRtAudio_1_1StreamOptions.html#_details">More...</a><br/></td></tr>
-<tr><td colspan="2"><h2>Typedefs</h2></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">typedef unsigned long&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8">RtAudioFormat</a></td></tr>
-<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> data format type.  <a href="#aafca92882d25915560018873221e44b8"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">typedef unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41">RtAudioStreamFlags</a></td></tr>
-<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> stream option flags.  <a href="#a2c0f59b200dcec4d4e760f9166b29c41"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">typedef unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="RtAudio_8h.html#a80e306d363583da3b0a1b65d9b57c806">RtAudioStreamStatus</a></td></tr>
-<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> stream status (over- or underflow) flags.  <a href="#a80e306d363583da3b0a1b65d9b57c806"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">typedef int(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="RtAudio_8h.html#a112c7b7e25a974977f6fc094cef1a31f">RtAudioCallback</a> )(void *outputBuffer, void *inputBuffer, unsigned int nFrames, double streamTime, <a class="el" href="RtAudio_8h.html#a80e306d363583da3b0a1b65d9b57c806">RtAudioStreamStatus</a> status, void *userData)</td></tr>
-<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> callback function prototype.  <a href="#a112c7b7e25a974977f6fc094cef1a31f"></a><br/></td></tr>
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
+Classes</h2></td></tr>
+<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html">RtAudio</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Realtime audio i/o C++ classes.  <a href="classRtAudio.html#details">More...</a><br/></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1DeviceInfo.html">RtAudio::DeviceInfo</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">The public device information structure for returning queried values.  <a href="structRtAudio_1_1DeviceInfo.html#details">More...</a><br/></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1StreamParameters.html">RtAudio::StreamParameters</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">The structure for specifying input or ouput stream parameters.  <a href="structRtAudio_1_1StreamParameters.html#details">More...</a><br/></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1StreamOptions.html">RtAudio::StreamOptions</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">The structure for specifying stream options.  <a href="structRtAudio_1_1StreamOptions.html#details">More...</a><br/></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
+Typedefs</h2></td></tr>
+<tr class="memitem:aafca92882d25915560018873221e44b8"><td class="memItemLeft" align="right" valign="top">typedef unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8">RtAudioFormat</a></td></tr>
+<tr class="memdesc:aafca92882d25915560018873221e44b8"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> data format type.  <a href="#aafca92882d25915560018873221e44b8"></a><br/></td></tr>
+<tr class="separator:aafca92882d25915560018873221e44b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a2c0f59b200dcec4d4e760f9166b29c41"><td class="memItemLeft" align="right" valign="top">typedef unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41">RtAudioStreamFlags</a></td></tr>
+<tr class="memdesc:a2c0f59b200dcec4d4e760f9166b29c41"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> stream option flags.  <a href="#a2c0f59b200dcec4d4e760f9166b29c41"></a><br/></td></tr>
+<tr class="separator:a2c0f59b200dcec4d4e760f9166b29c41"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a80e306d363583da3b0a1b65d9b57c806"><td class="memItemLeft" align="right" valign="top">typedef unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="RtAudio_8h.html#a80e306d363583da3b0a1b65d9b57c806">RtAudioStreamStatus</a></td></tr>
+<tr class="memdesc:a80e306d363583da3b0a1b65d9b57c806"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> stream status (over- or underflow) flags.  <a href="#a80e306d363583da3b0a1b65d9b57c806"></a><br/></td></tr>
+<tr class="separator:a80e306d363583da3b0a1b65d9b57c806"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a112c7b7e25a974977f6fc094cef1a31f"><td class="memItemLeft" align="right" valign="top">typedef int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="RtAudio_8h.html#a112c7b7e25a974977f6fc094cef1a31f">RtAudioCallback</a> )(void *outputBuffer, void *inputBuffer, unsigned int nFrames, double streamTime, <a class="el" href="RtAudio_8h.html#a80e306d363583da3b0a1b65d9b57c806">RtAudioStreamStatus</a> status, void *userData)</td></tr>
+<tr class="memdesc:a112c7b7e25a974977f6fc094cef1a31f"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> callback function prototype.  <a href="#a112c7b7e25a974977f6fc094cef1a31f"></a><br/></td></tr>
+<tr class="separator:a112c7b7e25a974977f6fc094cef1a31f"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a2c8c34d284ae138dd29b53375ec9f062"><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="RtAudio_8h.html#a2c8c34d284ae138dd29b53375ec9f062">RtAudioErrorCallback</a> )(<a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac">RtError::Type</a> type, const std::string &amp;errorText)</td></tr>
+<tr class="memdesc:a2c8c34d284ae138dd29b53375ec9f062"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> error callback function prototype.  <a href="#a2c8c34d284ae138dd29b53375ec9f062"></a><br/></td></tr>
+<tr class="separator:a2c8c34d284ae138dd29b53375ec9f062"><td class="memSeparator" colspan="2">&#160;</td></tr>
 </table>
-<hr/><a name="_details"></a><h2>Detailed Description</h2>
-<hr/><h2>Typedef Documentation</h2>
-<a class="anchor" id="aafca92882d25915560018873221e44b8"></a><!-- doxytag: member="RtAudio.h::RtAudioFormat" ref="aafca92882d25915560018873221e44b8" args="" -->
+<h2 class="groupheader">Typedef Documentation</h2>
+<a class="anchor" id="aafca92882d25915560018873221e44b8"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
           <td class="memname">typedef unsigned long <a class="el" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8">RtAudioFormat</a></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> data format type. </p>
-<p>Support for signed integers and floats. Audio data fed to/from an <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> stream is assumed to ALWAYS be in host byte order. The internal routines will automatically take care of any necessary byte-swapping between the host format and the soundcard. Thus, endian-ness is not a concern in the following format definitions. Note that 24-bit data is expected to be encapsulated in a 32-bit format.</p>
+<p>Support for signed integers and floats. Audio data fed to/from an <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> stream is assumed to ALWAYS be in host byte order. The internal routines will automatically take care of any necessary byte-swapping between the host format and the soundcard. Thus, endian-ness is not a concern in the following format definitions.</p>
 <ul>
 <li><em>RTAUDIO_SINT8:</em> 8-bit signed integer.</li>
 <li><em>RTAUDIO_SINT16:</em> 16-bit signed integer.</li>
-<li><em>RTAUDIO_SINT24:</em> Lower 3 bytes of 32-bit signed integer.</li>
+<li><em>RTAUDIO_SINT24:</em> 24-bit signed integer.</li>
 <li><em>RTAUDIO_SINT32:</em> 32-bit signed integer.</li>
 <li><em>RTAUDIO_FLOAT32:</em> Normalized between plus/minus 1.0.</li>
 <li><em>RTAUDIO_FLOAT64:</em> Normalized between plus/minus 1.0. </li>
@@ -62,7 +82,7 @@
 
 </div>
 </div>
-<a class="anchor" id="a2c0f59b200dcec4d4e760f9166b29c41"></a><!-- doxytag: member="RtAudio.h::RtAudioStreamFlags" ref="a2c0f59b200dcec4d4e760f9166b29c41" args="" -->
+<a class="anchor" id="a2c0f59b200dcec4d4e760f9166b29c41"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -70,8 +90,7 @@
           <td class="memname">typedef unsigned long <a class="el" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41">RtAudioStreamFlags</a></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> stream option flags. </p>
 <p>The following flags can be OR'ed together to allow a client to make changes to the default stream behavior:</p>
 
 </div>
 </div>
-<a class="anchor" id="a80e306d363583da3b0a1b65d9b57c806"></a><!-- doxytag: member="RtAudio.h::RtAudioStreamStatus" ref="a80e306d363583da3b0a1b65d9b57c806" args="" -->
+<a class="anchor" id="a80e306d363583da3b0a1b65d9b57c806"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
           <td class="memname">typedef unsigned long <a class="el" href="RtAudio_8h.html#a80e306d363583da3b0a1b65d9b57c806">RtAudioStreamStatus</a></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> stream status (over- or underflow) flags. </p>
 <p>Notification of a stream over- or underflow is indicated by a non-zero stream <code>status</code> argument in the RtAudioCallback function. The stream status can be one of the following two options, depending on whether the stream is open for output and/or input:</p>
 
 </div>
 </div>
-<a class="anchor" id="a112c7b7e25a974977f6fc094cef1a31f"></a><!-- doxytag: member="RtAudio.h::RtAudioCallback" ref="a112c7b7e25a974977f6fc094cef1a31f" args=")(void *outputBuffer, void *inputBuffer, unsigned int nFrames, double streamTime, RtAudioStreamStatus status, void *userData)" -->
+<a class="anchor" id="a112c7b7e25a974977f6fc094cef1a31f"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">typedef int(* <a class="el" href="RtAudio_8h.html#a112c7b7e25a974977f6fc094cef1a31f">RtAudioCallback</a>)(void *outputBuffer, void *inputBuffer, unsigned int nFrames, double streamTime, <a class="el" href="RtAudio_8h.html#a80e306d363583da3b0a1b65d9b57c806">RtAudioStreamStatus</a> status, void *userData)</td>
+          <td class="memname">typedef int(* RtAudioCallback)(void *outputBuffer, void *inputBuffer, unsigned int nFrames, double streamTime, <a class="el" href="RtAudio_8h.html#a80e306d363583da3b0a1b65d9b57c806">RtAudioStreamStatus</a> status, void *userData)</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> callback function prototype. </p>
 <p>All <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> clients must create a function of type RtAudioCallback to read and/or write data from/to the audio stream. When the underlying audio system is ready for new input or output data, this function will be invoked.</p>
-<dl><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>outputBuffer</em>&nbsp;</td><td>For output (or duplex) streams, the client should write <code>nFrames</code> of audio sample frames into this buffer. This argument should be recast to the datatype specified when the stream was opened. For input-only streams, this argument will be NULL.</td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>inputBuffer</em>&nbsp;</td><td>For input (or duplex) streams, this buffer will hold <code>nFrames</code> of input audio sample frames. This argument should be recast to the datatype specified when the stream was opened. For output-only streams, this argument will be NULL.</td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>nFrames</em>&nbsp;</td><td>The number of sample frames of input or output data in the buffers. The actual buffer size in bytes is dependent on the data type and number of channels in use.</td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>streamTime</em>&nbsp;</td><td>The number of seconds that have elapsed since the stream was started.</td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>status</em>&nbsp;</td><td>If non-zero, this argument indicates a data overflow or underflow condition for the stream. The particular condition can be determined by comparison with the RtAudioStreamStatus flags.</td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>userData</em>&nbsp;</td><td>A pointer to optional data provided by the client when opening the stream (default = NULL).</td></tr>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">outputBuffer</td><td>For output (or duplex) streams, the client should write <code>nFrames</code> of audio sample frames into this buffer. This argument should be recast to the datatype specified when the stream was opened. For input-only streams, this argument will be NULL.</td></tr>
+    <tr><td class="paramname">inputBuffer</td><td>For input (or duplex) streams, this buffer will hold <code>nFrames</code> of input audio sample frames. This argument should be recast to the datatype specified when the stream was opened. For output-only streams, this argument will be NULL.</td></tr>
+    <tr><td class="paramname">nFrames</td><td>The number of sample frames of input or output data in the buffers. The actual buffer size in bytes is dependent on the data type and number of channels in use.</td></tr>
+    <tr><td class="paramname">streamTime</td><td>The number of seconds that have elapsed since the stream was started.</td></tr>
+    <tr><td class="paramname">status</td><td>If non-zero, this argument indicates a data overflow or underflow condition for the stream. The particular condition can be determined by comparison with the RtAudioStreamStatus flags.</td></tr>
+    <tr><td class="paramname">userData</td><td>A pointer to optional data provided by the client when opening the stream (default = NULL).</td></tr>
   </table>
   </dd>
 </dl>
 <p>To continue normal stream operation, the RtAudioCallback function should return a value of zero. To stop the stream and drain the output buffer, the function should return a value of one. To abort the stream immediately, the client should return a value of two. </p>
 
 </div>
+</div>
+<a class="anchor" id="a2c8c34d284ae138dd29b53375ec9f062"></a>
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef void(* RtAudioErrorCallback)(<a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac">RtError::Type</a> type, const std::string &amp;errorText)</td>
+        </tr>
+      </table>
+</div><div class="memdoc">
+
+<p><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> error callback function prototype. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">type</td><td>Type of error. </td></tr>
+    <tr><td class="paramname">errorText</td><td>Error description. </td></tr>
+  </table>
+  </dd>
+</dl>
+
 </div>
 </div>
+</div><!-- contents -->
 <HR>
-
 <table><tr><td><img src="../images/mcgill.gif" width=165></td>
-  <td>&copy;2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr>
+  <td>&copy;2001-2013 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr>
 </table>
-
 </BODY>
 </HTML>