Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

722 lines
144KB

  1. <HTML>
  2. <HEAD>
  3. <TITLE>The RtAudio Home Page</TITLE>
  4. <LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
  5. <LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico">
  6. </HEAD>
  7. <BODY BGCOLOR="#FFFFFF">
  8. <CENTER>
  9. <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>
  10. <HR>
  11. <!-- Generated by Doxygen 1.8.2 -->
  12. </div><!-- top -->
  13. <div class="header">
  14. <div class="headertitle">
  15. <div class="title">RtAudio.h</div> </div>
  16. </div><!--header-->
  17. <div class="contents">
  18. <a href="RtAudio_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/************************************************************************/</span></div>
  19. <div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="comment">/************************************************************************/</span></div>
  20. <div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;</div>
  21. <div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="preprocessor">#ifndef __RTAUDIO_H</span></div>
  22. <div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define __RTAUDIO_H</span></div>
  23. <div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;<span class="preprocessor"></span></div>
  24. <div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
  25. <div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
  26. <div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;<span class="preprocessor">#include &quot;RtError.h&quot;</span></div>
  27. <div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;</div>
  28. <div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;<span class="comment">// RtAudio version</span></div>
  29. <div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> std::string VERSION( <span class="stringliteral">&quot;4.0.12&quot;</span> );</div>
  30. <div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;</div>
  31. <div class="line"><a name="l00071"></a><span class="lineno"><a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8"> 71</a></span>&#160;<span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a>;</div>
  32. <div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> RTAUDIO_SINT8 = 0x1; <span class="comment">// 8-bit signed integer.</span></div>
  33. <div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> RTAUDIO_SINT16 = 0x2; <span class="comment">// 16-bit signed integer.</span></div>
  34. <div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> RTAUDIO_SINT24 = 0x4; <span class="comment">// 24-bit signed integer.</span></div>
  35. <div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> RTAUDIO_SINT32 = 0x8; <span class="comment">// 32-bit signed integer.</span></div>
  36. <div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> RTAUDIO_FLOAT32 = 0x10; <span class="comment">// Normalized between plus/minus 1.0.</span></div>
  37. <div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> RTAUDIO_FLOAT64 = 0x20; <span class="comment">// Normalized between plus/minus 1.0.</span></div>
  38. <div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;</div>
  39. <div class="line"><a name="l00121"></a><span class="lineno"><a class="code" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41"> 121</a></span>&#160;<span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41" title="RtAudio stream option flags.">RtAudioStreamFlags</a>;</div>
  40. <div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41" title="RtAudio stream option flags.">RtAudioStreamFlags</a> RTAUDIO_NONINTERLEAVED = 0x1; <span class="comment">// Use non-interleaved buffers (default = interleaved).</span></div>
  41. <div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41" title="RtAudio stream option flags.">RtAudioStreamFlags</a> RTAUDIO_MINIMIZE_LATENCY = 0x2; <span class="comment">// Attempt to set stream parameters for lowest possible latency.</span></div>
  42. <div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41" title="RtAudio stream option flags.">RtAudioStreamFlags</a> RTAUDIO_HOG_DEVICE = 0x4; <span class="comment">// Attempt grab device and prevent use by others.</span></div>
  43. <div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41" title="RtAudio stream option flags.">RtAudioStreamFlags</a> RTAUDIO_SCHEDULE_REALTIME = 0x8; <span class="comment">// Try to select realtime scheduling for callback thread.</span></div>
  44. <div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41" title="RtAudio stream option flags.">RtAudioStreamFlags</a> RTAUDIO_ALSA_USE_DEFAULT = 0x10; <span class="comment">// Use the &quot;default&quot; PCM device (ALSA only).</span></div>
  45. <div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;</div>
  46. <div class="line"><a name="l00139"></a><span class="lineno"><a class="code" href="RtAudio_8h.html#a80e306d363583da3b0a1b65d9b57c806"> 139</a></span>&#160;<span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="RtAudio_8h.html#a80e306d363583da3b0a1b65d9b57c806" title="RtAudio stream status (over- or underflow) flags.">RtAudioStreamStatus</a>;</div>
  47. <div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#a80e306d363583da3b0a1b65d9b57c806" title="RtAudio stream status (over- or underflow) flags.">RtAudioStreamStatus</a> RTAUDIO_INPUT_OVERFLOW = 0x1; <span class="comment">// Input data was discarded because of an overflow condition at the driver.</span></div>
  48. <div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#a80e306d363583da3b0a1b65d9b57c806" title="RtAudio stream status (over- or underflow) flags.">RtAudioStreamStatus</a> RTAUDIO_OUTPUT_UNDERFLOW = 0x2; <span class="comment">// The output buffer ran low, likely causing a gap in the output sound.</span></div>
  49. <div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;</div>
  50. <div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;</div>
  51. <div class="line"><a name="l00182"></a><span class="lineno"><a class="code" href="RtAudio_8h.html#a112c7b7e25a974977f6fc094cef1a31f"> 182</a></span>&#160;<span class="keyword">typedef</span> int (*<a class="code" href="RtAudio_8h.html#a112c7b7e25a974977f6fc094cef1a31f" title="RtAudio callback function prototype.">RtAudioCallback</a>)( <span class="keywordtype">void</span> *outputBuffer, <span class="keywordtype">void</span> *inputBuffer,</div>
  52. <div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nFrames,</div>
  53. <div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <span class="keywordtype">double</span> streamTime,</div>
  54. <div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <a class="code" href="RtAudio_8h.html#a80e306d363583da3b0a1b65d9b57c806" title="RtAudio stream status (over- or underflow) flags.">RtAudioStreamStatus</a> status,</div>
  55. <div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="keywordtype">void</span> *userData );</div>
  56. <div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160;</div>
  57. <div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160;</div>
  58. <div class="line"><a name="l00193"></a><span class="lineno"><a class="code" href="RtAudio_8h.html#a2c8c34d284ae138dd29b53375ec9f062"> 193</a></span>&#160;<span class="keyword">typedef</span> void (*<a class="code" href="RtAudio_8h.html#a2c8c34d284ae138dd29b53375ec9f062" title="RtAudio error callback function prototype.">RtAudioErrorCallback</a>)( <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac" title="Defined RtError types.">RtError::Type</a> type, <span class="keyword">const</span> std::string &amp;errorText );</div>
  59. <div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160;</div>
  60. <div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160;<span class="comment">// **************************************************************** //</span></div>
  61. <div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160;<span class="comment">//</span></div>
  62. <div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160;<span class="comment">// RtAudio class declaration.</span></div>
  63. <div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160;<span class="comment">//</span></div>
  64. <div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160;<span class="comment">// RtAudio is a &quot;controller&quot; used to select an available audio i/o</span></div>
  65. <div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160;<span class="comment">// interface. It presents a common API for the user to call but all</span></div>
  66. <div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160;<span class="comment">// functionality is implemented by the class RtApi and its</span></div>
  67. <div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160;<span class="comment">// subclasses. RtAudio creates an instance of an RtApi subclass</span></div>
  68. <div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160;<span class="comment">// based on the user&#39;s API choice. If no choice is made, RtAudio</span></div>
  69. <div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160;<span class="comment">// attempts to make a &quot;logical&quot; API selection.</span></div>
  70. <div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160;<span class="comment">//</span></div>
  71. <div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160;<span class="comment">// **************************************************************** //</span></div>
  72. <div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160;</div>
  73. <div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160;<span class="keyword">class </span>RtApi;</div>
  74. <div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160;</div>
  75. <div class="line"><a name="l00210"></a><span class="lineno"><a class="code" href="classRtAudio.html"> 210</a></span>&#160;<span class="keyword">class </span><a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a></div>
  76. <div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160;{</div>
  77. <div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; <span class="keyword">public</span>:</div>
  78. <div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160;</div>
  79. <div class="line"><a name="l00215"></a><span class="lineno"><a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849"> 215</a></span>&#160; <span class="keyword">enum</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">Api</a> {</div>
  80. <div class="line"><a name="l00216"></a><span class="lineno"><a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849aa49af3ac767106158bc6cad74fb214ae"> 216</a></span>&#160; <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849aa49af3ac767106158bc6cad74fb214ae">UNSPECIFIED</a>, </div>
  81. <div class="line"><a name="l00217"></a><span class="lineno"><a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849aa7a2ba095c2806caa893b6fb8fc3a1a8"> 217</a></span>&#160; <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849aa7a2ba095c2806caa893b6fb8fc3a1a8">LINUX_ALSA</a>, </div>
  82. <div class="line"><a name="l00218"></a><span class="lineno"><a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849adc17dff310e85d303fb326c837c08d77"> 218</a></span>&#160; <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849adc17dff310e85d303fb326c837c08d77">LINUX_PULSE</a>, </div>
  83. <div class="line"><a name="l00219"></a><span class="lineno"><a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a39c84615e61de75e6a4e865596d62c82"> 219</a></span>&#160; <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a39c84615e61de75e6a4e865596d62c82">LINUX_OSS</a>, </div>
  84. <div class="line"><a name="l00220"></a><span class="lineno"><a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a4767e17c6edfbd827f91763915df4105"> 220</a></span>&#160; <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a4767e17c6edfbd827f91763915df4105">UNIX_JACK</a>, </div>
  85. <div class="line"><a name="l00221"></a><span class="lineno"><a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a9fec92b8272244a87a6a11a717bd662d"> 221</a></span>&#160; <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a9fec92b8272244a87a6a11a717bd662d">MACOSX_CORE</a>, </div>
  86. <div class="line"><a name="l00222"></a><span class="lineno"><a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a219517d1df90f94d07758481155bd469"> 222</a></span>&#160; <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a219517d1df90f94d07758481155bd469">WINDOWS_ASIO</a>, </div>
  87. <div class="line"><a name="l00223"></a><span class="lineno"><a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a28478830f42c2fd61e6c7ad498901931"> 223</a></span>&#160; <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a28478830f42c2fd61e6c7ad498901931">WINDOWS_DS</a>, </div>
  88. <div class="line"><a name="l00224"></a><span class="lineno"><a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849ab06b8fd88bf18c9a2b8271f6961ae2d1"> 224</a></span>&#160; <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849ab06b8fd88bf18c9a2b8271f6961ae2d1">RTAUDIO_DUMMY</a> </div>
  89. <div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; };</div>
  90. <div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160;</div>
  91. <div class="line"><a name="l00228"></a><span class="lineno"><a class="code" href="structRtAudio_1_1DeviceInfo.html"> 228</a></span>&#160; <span class="keyword">struct </span><a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">DeviceInfo</a> {</div>
  92. <div class="line"><a name="l00229"></a><span class="lineno"><a class="code" href="structRtAudio_1_1DeviceInfo.html#a97573717ccb1e75a834a0a108cd6982d"> 229</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html#a97573717ccb1e75a834a0a108cd6982d">probed</a>; </div>
  93. <div class="line"><a name="l00230"></a><span class="lineno"><a class="code" href="structRtAudio_1_1DeviceInfo.html#a24df596ab8d54f2eb540c7cf16212b3b"> 230</a></span>&#160; std::string <a class="code" href="structRtAudio_1_1DeviceInfo.html#a24df596ab8d54f2eb540c7cf16212b3b">name</a>; </div>
  94. <div class="line"><a name="l00231"></a><span class="lineno"><a class="code" href="structRtAudio_1_1DeviceInfo.html#a81aaf488f8158ef55b1bb678f66feb7d"> 231</a></span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html#a81aaf488f8158ef55b1bb678f66feb7d">outputChannels</a>; </div>
  95. <div class="line"><a name="l00232"></a><span class="lineno"><a class="code" href="structRtAudio_1_1DeviceInfo.html#a56247b458a937ae84d98ca9c4b243275"> 232</a></span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html#a56247b458a937ae84d98ca9c4b243275">inputChannels</a>; </div>
  96. <div class="line"><a name="l00233"></a><span class="lineno"><a class="code" href="structRtAudio_1_1DeviceInfo.html#a3e8ad34c2d14e24293a0beafc26186e7"> 233</a></span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html#a3e8ad34c2d14e24293a0beafc26186e7">duplexChannels</a>; </div>
  97. <div class="line"><a name="l00234"></a><span class="lineno"><a class="code" href="structRtAudio_1_1DeviceInfo.html#a5365245e73ffe29a05734de4474acd58"> 234</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html#a5365245e73ffe29a05734de4474acd58">isDefaultOutput</a>; </div>
  98. <div class="line"><a name="l00235"></a><span class="lineno"><a class="code" href="structRtAudio_1_1DeviceInfo.html#a7c8aca084bd908799b6be5954b80def2"> 235</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html#a7c8aca084bd908799b6be5954b80def2">isDefaultInput</a>; </div>
  99. <div class="line"><a name="l00236"></a><span class="lineno"><a class="code" href="structRtAudio_1_1DeviceInfo.html#afa65f5f92f66ce7aacd3ff35e11b230f"> 236</a></span>&#160; std::vector&lt;unsigned int&gt; <a class="code" href="structRtAudio_1_1DeviceInfo.html#afa65f5f92f66ce7aacd3ff35e11b230f">sampleRates</a>; </div>
  100. <div class="line"><a name="l00237"></a><span class="lineno"><a class="code" href="structRtAudio_1_1DeviceInfo.html#a23251b549b89b2fe04a57fcd7cb76ea4"> 237</a></span>&#160; <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> <a class="code" href="structRtAudio_1_1DeviceInfo.html#a23251b549b89b2fe04a57fcd7cb76ea4">nativeFormats</a>; </div>
  101. <div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; <span class="comment">// Default constructor.</span></div>
  102. <div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">DeviceInfo</a>()</div>
  103. <div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; :<a class="code" href="structRtAudio_1_1DeviceInfo.html#a97573717ccb1e75a834a0a108cd6982d">probed</a>(false), <a class="code" href="structRtAudio_1_1DeviceInfo.html#a81aaf488f8158ef55b1bb678f66feb7d">outputChannels</a>(0), <a class="code" href="structRtAudio_1_1DeviceInfo.html#a56247b458a937ae84d98ca9c4b243275">inputChannels</a>(0), <a class="code" href="structRtAudio_1_1DeviceInfo.html#a3e8ad34c2d14e24293a0beafc26186e7">duplexChannels</a>(0),</div>
  104. <div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; <a class="code" href="structRtAudio_1_1DeviceInfo.html#a5365245e73ffe29a05734de4474acd58">isDefaultOutput</a>(false), <a class="code" href="structRtAudio_1_1DeviceInfo.html#a7c8aca084bd908799b6be5954b80def2">isDefaultInput</a>(false), <a class="code" href="structRtAudio_1_1DeviceInfo.html#a23251b549b89b2fe04a57fcd7cb76ea4">nativeFormats</a>(0) {}</div>
  105. <div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; };</div>
  106. <div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160;</div>
  107. <div class="line"><a name="l00246"></a><span class="lineno"><a class="code" href="structRtAudio_1_1StreamParameters.html"> 246</a></span>&#160; <span class="keyword">struct </span><a class="code" href="structRtAudio_1_1StreamParameters.html" title="The structure for specifying input or ouput stream parameters.">StreamParameters</a> {</div>
  108. <div class="line"><a name="l00247"></a><span class="lineno"><a class="code" href="structRtAudio_1_1StreamParameters.html#ab3c72bcf3ef12149ae9a4fb597cc5489"> 247</a></span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1StreamParameters.html#ab3c72bcf3ef12149ae9a4fb597cc5489">deviceId</a>; </div>
  109. <div class="line"><a name="l00248"></a><span class="lineno"><a class="code" href="structRtAudio_1_1StreamParameters.html#a88a10091b6e284e21235cc6f25332ebd"> 248</a></span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1StreamParameters.html#a88a10091b6e284e21235cc6f25332ebd">nChannels</a>; </div>
  110. <div class="line"><a name="l00249"></a><span class="lineno"><a class="code" href="structRtAudio_1_1StreamParameters.html#ad4b4503782653ec93c83328c46abe50c"> 249</a></span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1StreamParameters.html#ad4b4503782653ec93c83328c46abe50c">firstChannel</a>; </div>
  111. <div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; <span class="comment">// Default constructor.</span></div>
  112. <div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; <a class="code" href="structRtAudio_1_1StreamParameters.html" title="The structure for specifying input or ouput stream parameters.">StreamParameters</a>()</div>
  113. <div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; : <a class="code" href="structRtAudio_1_1StreamParameters.html#ab3c72bcf3ef12149ae9a4fb597cc5489">deviceId</a>(0), <a class="code" href="structRtAudio_1_1StreamParameters.html#a88a10091b6e284e21235cc6f25332ebd">nChannels</a>(0), <a class="code" href="structRtAudio_1_1StreamParameters.html#ad4b4503782653ec93c83328c46abe50c">firstChannel</a>(0) {}</div>
  114. <div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; };</div>
  115. <div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160;</div>
  116. <div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160;</div>
  117. <div class="line"><a name="l00313"></a><span class="lineno"><a class="code" href="structRtAudio_1_1StreamOptions.html"> 313</a></span>&#160; <span class="keyword">struct </span><a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">StreamOptions</a> {</div>
  118. <div class="line"><a name="l00314"></a><span class="lineno"><a class="code" href="structRtAudio_1_1StreamOptions.html#a0ecc98b031aa3af49d09b781643e298b"> 314</a></span>&#160; <a class="code" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41" title="RtAudio stream option flags.">RtAudioStreamFlags</a> <a class="code" href="structRtAudio_1_1StreamOptions.html#a0ecc98b031aa3af49d09b781643e298b">flags</a>; </div>
  119. <div class="line"><a name="l00315"></a><span class="lineno"><a class="code" href="structRtAudio_1_1StreamOptions.html#a75a14cfab903d0e1c091bc16aec80240"> 315</a></span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1StreamOptions.html#a75a14cfab903d0e1c091bc16aec80240">numberOfBuffers</a>; </div>
  120. <div class="line"><a name="l00316"></a><span class="lineno"><a class="code" href="structRtAudio_1_1StreamOptions.html#a2a4b0b8d690c624d20f4e8f4be6ca9ba"> 316</a></span>&#160; std::string <a class="code" href="structRtAudio_1_1StreamOptions.html#a2a4b0b8d690c624d20f4e8f4be6ca9ba">streamName</a>; </div>
  121. <div class="line"><a name="l00317"></a><span class="lineno"><a class="code" href="structRtAudio_1_1StreamOptions.html#adfd267059434edb21573c584e6367def"> 317</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1StreamOptions.html#adfd267059434edb21573c584e6367def">priority</a>; </div>
  122. <div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160; <span class="comment">// Default constructor.</span></div>
  123. <div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160; <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">StreamOptions</a>()</div>
  124. <div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160; : <a class="code" href="structRtAudio_1_1StreamOptions.html#a0ecc98b031aa3af49d09b781643e298b">flags</a>(0), <a class="code" href="structRtAudio_1_1StreamOptions.html#a75a14cfab903d0e1c091bc16aec80240">numberOfBuffers</a>(0), <a class="code" href="structRtAudio_1_1StreamOptions.html#adfd267059434edb21573c584e6367def">priority</a>(0) {}</div>
  125. <div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160; };</div>
  126. <div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160;</div>
  127. <div class="line"><a name="l00325"></a><span class="lineno"><a class="code" href="classRtAudio.html#afee36f6d32f4744ffa7471a0ce7a3856"> 325</a></span>&#160; <span class="keyword">static</span> std::string <a class="code" href="classRtAudio.html#afee36f6d32f4744ffa7471a0ce7a3856" title="A static function to determine the current RtAudio version.">getVersion</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> VERSION; } </div>
  128. <div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160;</div>
  129. <div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160;</div>
  130. <div class="line"><a name="l00333"></a><span class="lineno"> 333</span>&#160; <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#ae266ffad2ef428d0b2c6c262d391ce26" title="A static function to determine the available compiled audio APIs.">getCompiledApi</a>( std::vector&lt;RtAudio::Api&gt; &amp;apis ) <span class="keywordflow">throw</span>();</div>
  131. <div class="line"><a name="l00334"></a><span class="lineno"> 334</span>&#160;</div>
  132. <div class="line"><a name="l00336"></a><span class="lineno"> 336</span>&#160;</div>
  133. <div class="line"><a name="l00344"></a><span class="lineno"> 344</span>&#160; <a class="code" href="classRtAudio.html#afd0bfa26deae9804e18faff59d0273d9" title="The class constructor.">RtAudio</a>( <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> api=<a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849aa49af3ac767106158bc6cad74fb214ae">UNSPECIFIED</a> ) throw();</div>
  134. <div class="line"><a name="l00345"></a><span class="lineno"> 345</span>&#160;</div>
  135. <div class="line"><a name="l00347"></a><span class="lineno"> 347</span>&#160;</div>
  136. <div class="line"><a name="l00351"></a><span class="lineno"> 351</span>&#160; ~<a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>() throw();</div>
  137. <div class="line"><a name="l00352"></a><span class="lineno"> 352</span>&#160;</div>
  138. <div class="line"><a name="l00354"></a><span class="lineno"> 354</span>&#160; <a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>::<a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">Api</a> <a class="code" href="classRtAudio.html#a83687634795792b2c47e4ae1cf8a5246" title="Returns the audio API specifier for the current instance of RtAudio.">getCurrentApi</a>( <span class="keywordtype">void</span> ) throw();</div>
  139. <div class="line"><a name="l00355"></a><span class="lineno"> 355</span>&#160;</div>
  140. <div class="line"><a name="l00357"></a><span class="lineno"> 357</span>&#160;</div>
  141. <div class="line"><a name="l00362"></a><span class="lineno"> 362</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">getDeviceCount</a>( <span class="keywordtype">void</span> ) throw();</div>
  142. <div class="line"><a name="l00363"></a><span class="lineno"> 363</span>&#160;</div>
  143. <div class="line"><a name="l00365"></a><span class="lineno"> 365</span>&#160;</div>
  144. <div class="line"><a name="l00375"></a><span class="lineno"> 375</span>&#160; <a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>::DeviceInfo <a class="code" href="classRtAudio.html#a02d7ff44ad1d7eae22283a052f3dfda8" title="Return an RtAudio::DeviceInfo structure for a specified device number.">getDeviceInfo</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device );</div>
  145. <div class="line"><a name="l00376"></a><span class="lineno"> 376</span>&#160;</div>
  146. <div class="line"><a name="l00378"></a><span class="lineno"> 378</span>&#160;</div>
  147. <div class="line"><a name="l00385"></a><span class="lineno"> 385</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a3a3f3dbe13ea696b521e49cdaaa357bc" title="A function that returns the index of the default output device.">getDefaultOutputDevice</a>( <span class="keywordtype">void</span> ) throw();</div>
  148. <div class="line"><a name="l00386"></a><span class="lineno"> 386</span>&#160;</div>
  149. <div class="line"><a name="l00388"></a><span class="lineno"> 388</span>&#160;</div>
  150. <div class="line"><a name="l00395"></a><span class="lineno"> 395</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#aad8b94edd3cd379ee300b125750ac6ce" title="A function that returns the index of the default input device.">getDefaultInputDevice</a>( <span class="keywordtype">void</span> ) throw();</div>
  151. <div class="line"><a name="l00396"></a><span class="lineno"> 396</span>&#160;</div>
  152. <div class="line"><a name="l00398"></a><span class="lineno"> 398</span>&#160;</div>
  153. <div class="line"><a name="l00437"></a><span class="lineno"> 437</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a6907539d2527775df778ebce32ef1e3b" title="A public function for opening a stream with the specified parameters.">openStream</a>( <a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>::StreamParameters *outputParameters,</div>
  154. <div class="line"><a name="l00438"></a><span class="lineno"> 438</span>&#160; <a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>::StreamParameters *inputParameters,</div>
  155. <div class="line"><a name="l00439"></a><span class="lineno"> 439</span>&#160; <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate,</div>
  156. <div class="line"><a name="l00440"></a><span class="lineno"> 440</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferFrames, <a class="code" href="RtAudio_8h.html#a112c7b7e25a974977f6fc094cef1a31f" title="RtAudio callback function prototype.">RtAudioCallback</a> callback,</div>
  157. <div class="line"><a name="l00441"></a><span class="lineno"> 441</span>&#160; <span class="keywordtype">void</span> *userData = NULL, <a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>::StreamOptions *options = NULL, <a class="code" href="RtAudio_8h.html#a2c8c34d284ae138dd29b53375ec9f062" title="RtAudio error callback function prototype.">RtAudioErrorCallback</a> errorCallback = NULL );</div>
  158. <div class="line"><a name="l00442"></a><span class="lineno"> 442</span>&#160;</div>
  159. <div class="line"><a name="l00444"></a><span class="lineno"> 444</span>&#160;</div>
  160. <div class="line"><a name="l00448"></a><span class="lineno"> 448</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a90d599002ad32cf250a4cb866f2cc93a" title="A function that closes a stream and frees any associated stream memory.">closeStream</a>( <span class="keywordtype">void</span> ) throw();</div>
  161. <div class="line"><a name="l00449"></a><span class="lineno"> 449</span>&#160;</div>
  162. <div class="line"><a name="l00451"></a><span class="lineno"> 451</span>&#160;</div>
  163. <div class="line"><a name="l00457"></a><span class="lineno"> 457</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#aec017a89629ccef66a90b60be22a2f80" title="A function that starts a stream.">startStream</a>( <span class="keywordtype">void</span> );</div>
  164. <div class="line"><a name="l00458"></a><span class="lineno"> 458</span>&#160;</div>
  165. <div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160;</div>
  166. <div class="line"><a name="l00466"></a><span class="lineno"> 466</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#af4c241ff86936ecc8108f0d9dfe3efdd" title="Stop a stream, allowing any samples remaining in the output queue to be played.">stopStream</a>( <span class="keywordtype">void</span> );</div>
  167. <div class="line"><a name="l00467"></a><span class="lineno"> 467</span>&#160;</div>
  168. <div class="line"><a name="l00469"></a><span class="lineno"> 469</span>&#160;</div>
  169. <div class="line"><a name="l00475"></a><span class="lineno"> 475</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#ad0586b47cd6bb9591a80b4052815991f" title="Stop a stream, discarding any samples remaining in the input/output queue.">abortStream</a>( <span class="keywordtype">void</span> );</div>
  170. <div class="line"><a name="l00476"></a><span class="lineno"> 476</span>&#160;</div>
  171. <div class="line"><a name="l00478"></a><span class="lineno"> 478</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classRtAudio.html#a3863e45ff81dbe97176de0ee7545917f" title="Returns true if a stream is open and false if not.">isStreamOpen</a>( <span class="keywordtype">void</span> ) const throw();</div>
  172. <div class="line"><a name="l00479"></a><span class="lineno"> 479</span>&#160;</div>
  173. <div class="line"><a name="l00481"></a><span class="lineno"> 481</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classRtAudio.html#a84cc8d9b7ab9bc5f37bcf48430ec5aea" title="Returns true if the stream is running and false if it is stopped or not open.">isStreamRunning</a>( <span class="keywordtype">void</span> ) const throw();</div>
  174. <div class="line"><a name="l00482"></a><span class="lineno"> 482</span>&#160;</div>
  175. <div class="line"><a name="l00484"></a><span class="lineno"> 484</span>&#160;</div>
  176. <div class="line"><a name="l00487"></a><span class="lineno"> 487</span>&#160; <span class="keywordtype">double</span> <a class="code" href="classRtAudio.html#a344e59a62353c5791db4621b985cb2ca" title="Returns the number of elapsed seconds since the stream was started.">getStreamTime</a>( <span class="keywordtype">void</span> );</div>
  177. <div class="line"><a name="l00488"></a><span class="lineno"> 488</span>&#160;</div>
  178. <div class="line"><a name="l00490"></a><span class="lineno"> 490</span>&#160;</div>
  179. <div class="line"><a name="l00498"></a><span class="lineno"> 498</span>&#160; <span class="keywordtype">long</span> <a class="code" href="classRtAudio.html#a843c989d9f501c71bc2f2c5ca18df9f3" title="Returns the internal stream latency in sample frames.">getStreamLatency</a>( <span class="keywordtype">void</span> );</div>
  180. <div class="line"><a name="l00499"></a><span class="lineno"> 499</span>&#160;</div>
  181. <div class="line"><a name="l00501"></a><span class="lineno"> 501</span>&#160;</div>
  182. <div class="line"><a name="l00506"></a><span class="lineno"> 506</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a28214b8b05d60b45c24ee6fae7b2a0b5" title="Returns actual sample rate in use by the stream.">getStreamSampleRate</a>( <span class="keywordtype">void</span> );</div>
  183. <div class="line"><a name="l00507"></a><span class="lineno"> 507</span>&#160;</div>
  184. <div class="line"><a name="l00509"></a><span class="lineno"> 509</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#af0752ee51cce3dd90a3bd009f9fdbe77" title="Specify whether warning messages should be printed to stderr.">showWarnings</a>( <span class="keywordtype">bool</span> value = true ) throw();</div>
  185. <div class="line"><a name="l00510"></a><span class="lineno"> 510</span>&#160;</div>
  186. <div class="line"><a name="l00511"></a><span class="lineno"> 511</span>&#160; protected:</div>
  187. <div class="line"><a name="l00512"></a><span class="lineno"> 512</span>&#160;</div>
  188. <div class="line"><a name="l00513"></a><span class="lineno"> 513</span>&#160; <span class="keywordtype">void</span> openRtApi( <a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>::<a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">Api</a> api );</div>
  189. <div class="line"><a name="l00514"></a><span class="lineno"> 514</span>&#160; RtApi *rtapi_;</div>
  190. <div class="line"><a name="l00515"></a><span class="lineno"> 515</span>&#160;};</div>
  191. <div class="line"><a name="l00516"></a><span class="lineno"> 516</span>&#160;</div>
  192. <div class="line"><a name="l00517"></a><span class="lineno"> 517</span>&#160;<span class="comment">// Operating system dependent thread functionality.</span></div>
  193. <div class="line"><a name="l00518"></a><span class="lineno"> 518</span>&#160;<span class="preprocessor">#if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__)</span></div>
  194. <div class="line"><a name="l00519"></a><span class="lineno"> 519</span>&#160;<span class="preprocessor"></span><span class="preprocessor"> #include &lt;windows.h&gt;</span></div>
  195. <div class="line"><a name="l00520"></a><span class="lineno"> 520</span>&#160;<span class="preprocessor"> #include &lt;process.h&gt;</span></div>
  196. <div class="line"><a name="l00521"></a><span class="lineno"> 521</span>&#160;</div>
  197. <div class="line"><a name="l00522"></a><span class="lineno"> 522</span>&#160; <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ThreadHandle;</div>
  198. <div class="line"><a name="l00523"></a><span class="lineno"> 523</span>&#160; <span class="keyword">typedef</span> CRITICAL_SECTION StreamMutex;</div>
  199. <div class="line"><a name="l00524"></a><span class="lineno"> 524</span>&#160;</div>
  200. <div class="line"><a name="l00525"></a><span class="lineno"> 525</span>&#160;<span class="preprocessor">#elif defined(__LINUX_ALSA__) || defined(__LINUX_PULSE__) || defined(__UNIX_JACK__) || defined(__LINUX_OSS__) || defined(__MACOSX_CORE__)</span></div>
  201. <div class="line"><a name="l00526"></a><span class="lineno"> 526</span>&#160;<span class="preprocessor"></span> <span class="comment">// Using pthread library for various flavors of unix.</span></div>
  202. <div class="line"><a name="l00527"></a><span class="lineno"> 527</span>&#160;<span class="preprocessor"> #include &lt;pthread.h&gt;</span></div>
  203. <div class="line"><a name="l00528"></a><span class="lineno"> 528</span>&#160;</div>
  204. <div class="line"><a name="l00529"></a><span class="lineno"> 529</span>&#160; <span class="keyword">typedef</span> pthread_t ThreadHandle;</div>
  205. <div class="line"><a name="l00530"></a><span class="lineno"> 530</span>&#160; <span class="keyword">typedef</span> pthread_mutex_t StreamMutex;</div>
  206. <div class="line"><a name="l00531"></a><span class="lineno"> 531</span>&#160;</div>
  207. <div class="line"><a name="l00532"></a><span class="lineno"> 532</span>&#160;<span class="preprocessor">#else // Setup for &quot;dummy&quot; behavior</span></div>
  208. <div class="line"><a name="l00533"></a><span class="lineno"> 533</span>&#160;<span class="preprocessor"></span></div>
  209. <div class="line"><a name="l00534"></a><span class="lineno"> 534</span>&#160;<span class="preprocessor"> #define __RTAUDIO_DUMMY__</span></div>
  210. <div class="line"><a name="l00535"></a><span class="lineno"> 535</span>&#160;<span class="preprocessor"></span> <span class="keyword">typedef</span> <span class="keywordtype">int</span> ThreadHandle;</div>
  211. <div class="line"><a name="l00536"></a><span class="lineno"> 536</span>&#160; <span class="keyword">typedef</span> <span class="keywordtype">int</span> StreamMutex;</div>
  212. <div class="line"><a name="l00537"></a><span class="lineno"> 537</span>&#160;</div>
  213. <div class="line"><a name="l00538"></a><span class="lineno"> 538</span>&#160;<span class="preprocessor">#endif</span></div>
  214. <div class="line"><a name="l00539"></a><span class="lineno"> 539</span>&#160;<span class="preprocessor"></span></div>
  215. <div class="line"><a name="l00540"></a><span class="lineno"> 540</span>&#160;<span class="comment">// This global structure type is used to pass callback information</span></div>
  216. <div class="line"><a name="l00541"></a><span class="lineno"> 541</span>&#160;<span class="comment">// between the private RtAudio stream structure and global callback</span></div>
  217. <div class="line"><a name="l00542"></a><span class="lineno"> 542</span>&#160;<span class="comment">// handling functions.</span></div>
  218. <div class="line"><a name="l00543"></a><span class="lineno"> 543</span>&#160;<span class="keyword">struct </span>CallbackInfo {</div>
  219. <div class="line"><a name="l00544"></a><span class="lineno"> 544</span>&#160; <span class="keywordtype">void</span> *object; <span class="comment">// Used as a &quot;this&quot; pointer.</span></div>
  220. <div class="line"><a name="l00545"></a><span class="lineno"> 545</span>&#160; ThreadHandle thread;</div>
  221. <div class="line"><a name="l00546"></a><span class="lineno"> 546</span>&#160; <span class="keywordtype">void</span> *callback;</div>
  222. <div class="line"><a name="l00547"></a><span class="lineno"> 547</span>&#160; <span class="keywordtype">void</span> *userData;</div>
  223. <div class="line"><a name="l00548"></a><span class="lineno"> 548</span>&#160; <span class="keywordtype">void</span> *errorCallback;</div>
  224. <div class="line"><a name="l00549"></a><span class="lineno"> 549</span>&#160; <span class="keywordtype">void</span> *apiInfo; <span class="comment">// void pointer for API specific callback information</span></div>
  225. <div class="line"><a name="l00550"></a><span class="lineno"> 550</span>&#160; <span class="keywordtype">bool</span> isRunning;</div>
  226. <div class="line"><a name="l00551"></a><span class="lineno"> 551</span>&#160; <span class="keywordtype">bool</span> doRealtime;</div>
  227. <div class="line"><a name="l00552"></a><span class="lineno"> 552</span>&#160; <span class="keywordtype">int</span> priority;</div>
  228. <div class="line"><a name="l00553"></a><span class="lineno"> 553</span>&#160;</div>
  229. <div class="line"><a name="l00554"></a><span class="lineno"> 554</span>&#160; <span class="comment">// Default constructor.</span></div>
  230. <div class="line"><a name="l00555"></a><span class="lineno"> 555</span>&#160; CallbackInfo()</div>
  231. <div class="line"><a name="l00556"></a><span class="lineno"> 556</span>&#160; :object(0), callback(0), userData(0), errorCallback(0), apiInfo(0), isRunning(false), doRealtime(false) {}</div>
  232. <div class="line"><a name="l00557"></a><span class="lineno"> 557</span>&#160;};</div>
  233. <div class="line"><a name="l00558"></a><span class="lineno"> 558</span>&#160;</div>
  234. <div class="line"><a name="l00559"></a><span class="lineno"> 559</span>&#160;<span class="comment">// **************************************************************** //</span></div>
  235. <div class="line"><a name="l00560"></a><span class="lineno"> 560</span>&#160;<span class="comment">//</span></div>
  236. <div class="line"><a name="l00561"></a><span class="lineno"> 561</span>&#160;<span class="comment">// RtApi class declaration.</span></div>
  237. <div class="line"><a name="l00562"></a><span class="lineno"> 562</span>&#160;<span class="comment">//</span></div>
  238. <div class="line"><a name="l00563"></a><span class="lineno"> 563</span>&#160;<span class="comment">// Subclasses of RtApi contain all API- and OS-specific code necessary</span></div>
  239. <div class="line"><a name="l00564"></a><span class="lineno"> 564</span>&#160;<span class="comment">// to fully implement the RtAudio API.</span></div>
  240. <div class="line"><a name="l00565"></a><span class="lineno"> 565</span>&#160;<span class="comment">//</span></div>
  241. <div class="line"><a name="l00566"></a><span class="lineno"> 566</span>&#160;<span class="comment">// Note that RtApi is an abstract base class and cannot be</span></div>
  242. <div class="line"><a name="l00567"></a><span class="lineno"> 567</span>&#160;<span class="comment">// explicitly instantiated. The class RtAudio will create an</span></div>
  243. <div class="line"><a name="l00568"></a><span class="lineno"> 568</span>&#160;<span class="comment">// instance of an RtApi subclass (RtApiOss, RtApiAlsa,</span></div>
  244. <div class="line"><a name="l00569"></a><span class="lineno"> 569</span>&#160;<span class="comment">// RtApiJack, RtApiCore, RtApiDs, or RtApiAsio).</span></div>
  245. <div class="line"><a name="l00570"></a><span class="lineno"> 570</span>&#160;<span class="comment">//</span></div>
  246. <div class="line"><a name="l00571"></a><span class="lineno"> 571</span>&#160;<span class="comment">// **************************************************************** //</span></div>
  247. <div class="line"><a name="l00572"></a><span class="lineno"> 572</span>&#160;</div>
  248. <div class="line"><a name="l00573"></a><span class="lineno"> 573</span>&#160;<span class="preprocessor">#pragma pack(push, 1)</span></div>
  249. <div class="line"><a name="l00574"></a><span class="lineno"> 574</span>&#160;<span class="preprocessor"></span><span class="keyword">class </span>S24 {</div>
  250. <div class="line"><a name="l00575"></a><span class="lineno"> 575</span>&#160;</div>
  251. <div class="line"><a name="l00576"></a><span class="lineno"> 576</span>&#160; <span class="keyword">protected</span>:</div>
  252. <div class="line"><a name="l00577"></a><span class="lineno"> 577</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> c3[3];</div>
  253. <div class="line"><a name="l00578"></a><span class="lineno"> 578</span>&#160;</div>
  254. <div class="line"><a name="l00579"></a><span class="lineno"> 579</span>&#160; <span class="keyword">public</span>:</div>
  255. <div class="line"><a name="l00580"></a><span class="lineno"> 580</span>&#160; S24() {}</div>
  256. <div class="line"><a name="l00581"></a><span class="lineno"> 581</span>&#160;</div>
  257. <div class="line"><a name="l00582"></a><span class="lineno"> 582</span>&#160; S24&amp; operator = ( <span class="keyword">const</span> <span class="keywordtype">int</span>&amp; i ) {</div>
  258. <div class="line"><a name="l00583"></a><span class="lineno"> 583</span>&#160; c3[0] = (i &amp; 0x000000ff);</div>
  259. <div class="line"><a name="l00584"></a><span class="lineno"> 584</span>&#160; c3[1] = (i &amp; 0x0000ff00) &gt;&gt; 8;</div>
  260. <div class="line"><a name="l00585"></a><span class="lineno"> 585</span>&#160; c3[2] = (i &amp; 0x00ff0000) &gt;&gt; 16;</div>
  261. <div class="line"><a name="l00586"></a><span class="lineno"> 586</span>&#160; <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
  262. <div class="line"><a name="l00587"></a><span class="lineno"> 587</span>&#160; }</div>
  263. <div class="line"><a name="l00588"></a><span class="lineno"> 588</span>&#160;</div>
  264. <div class="line"><a name="l00589"></a><span class="lineno"> 589</span>&#160; S24( <span class="keyword">const</span> S24&amp; v ) { *<span class="keyword">this</span> = v; }</div>
  265. <div class="line"><a name="l00590"></a><span class="lineno"> 590</span>&#160; S24( <span class="keyword">const</span> <span class="keywordtype">double</span>&amp; d ) { *<span class="keyword">this</span> = (int) d; }</div>
  266. <div class="line"><a name="l00591"></a><span class="lineno"> 591</span>&#160; S24( <span class="keyword">const</span> <span class="keywordtype">float</span>&amp; f ) { *<span class="keyword">this</span> = (int) f; }</div>
  267. <div class="line"><a name="l00592"></a><span class="lineno"> 592</span>&#160; S24( <span class="keyword">const</span> <span class="keywordtype">signed</span> <span class="keywordtype">short</span>&amp; s ) { *<span class="keyword">this</span> = (int) s; }</div>
  268. <div class="line"><a name="l00593"></a><span class="lineno"> 593</span>&#160; S24( <span class="keyword">const</span> <span class="keywordtype">char</span>&amp; c ) { *<span class="keyword">this</span> = (int) c; }</div>
  269. <div class="line"><a name="l00594"></a><span class="lineno"> 594</span>&#160;</div>
  270. <div class="line"><a name="l00595"></a><span class="lineno"> 595</span>&#160; <span class="keywordtype">int</span> asInt() {</div>
  271. <div class="line"><a name="l00596"></a><span class="lineno"> 596</span>&#160; <span class="keywordtype">int</span> i = c3[0] | (c3[1] &lt;&lt; 8) | (c3[2] &lt;&lt; 16);</div>
  272. <div class="line"><a name="l00597"></a><span class="lineno"> 597</span>&#160; <span class="keywordflow">if</span> (i &amp; 0x800000) i |= ~0xffffff;</div>
  273. <div class="line"><a name="l00598"></a><span class="lineno"> 598</span>&#160; <span class="keywordflow">return</span> i;</div>
  274. <div class="line"><a name="l00599"></a><span class="lineno"> 599</span>&#160; }</div>
  275. <div class="line"><a name="l00600"></a><span class="lineno"> 600</span>&#160;};</div>
  276. <div class="line"><a name="l00601"></a><span class="lineno"> 601</span>&#160;<span class="preprocessor">#pragma pack(pop)</span></div>
  277. <div class="line"><a name="l00602"></a><span class="lineno"> 602</span>&#160;<span class="preprocessor"></span></div>
  278. <div class="line"><a name="l00603"></a><span class="lineno"> 603</span>&#160;<span class="preprocessor">#if defined( HAVE_GETTIMEOFDAY )</span></div>
  279. <div class="line"><a name="l00604"></a><span class="lineno"> 604</span>&#160;<span class="preprocessor"></span><span class="preprocessor"> #include &lt;sys/time.h&gt;</span></div>
  280. <div class="line"><a name="l00605"></a><span class="lineno"> 605</span>&#160;<span class="preprocessor">#endif</span></div>
  281. <div class="line"><a name="l00606"></a><span class="lineno"> 606</span>&#160;<span class="preprocessor"></span></div>
  282. <div class="line"><a name="l00607"></a><span class="lineno"> 607</span>&#160;<span class="preprocessor">#include &lt;sstream&gt;</span></div>
  283. <div class="line"><a name="l00608"></a><span class="lineno"> 608</span>&#160;</div>
  284. <div class="line"><a name="l00609"></a><span class="lineno"> 609</span>&#160;<span class="keyword">class </span>RtApi</div>
  285. <div class="line"><a name="l00610"></a><span class="lineno"> 610</span>&#160;{</div>
  286. <div class="line"><a name="l00611"></a><span class="lineno"> 611</span>&#160;<span class="keyword">public</span>:</div>
  287. <div class="line"><a name="l00612"></a><span class="lineno"> 612</span>&#160;</div>
  288. <div class="line"><a name="l00613"></a><span class="lineno"> 613</span>&#160; RtApi();</div>
  289. <div class="line"><a name="l00614"></a><span class="lineno"> 614</span>&#160; <span class="keyword">virtual</span> ~RtApi();</div>
  290. <div class="line"><a name="l00615"></a><span class="lineno"> 615</span>&#160; <span class="keyword">virtual</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> <a class="code" href="classRtAudio.html#a83687634795792b2c47e4ae1cf8a5246" title="Returns the audio API specifier for the current instance of RtAudio.">getCurrentApi</a>( <span class="keywordtype">void</span> ) = 0;</div>
  291. <div class="line"><a name="l00616"></a><span class="lineno"> 616</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">getDeviceCount</a>( <span class="keywordtype">void</span> ) = 0;</div>
  292. <div class="line"><a name="l00617"></a><span class="lineno"> 617</span>&#160; <span class="keyword">virtual</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> <a class="code" href="classRtAudio.html#a02d7ff44ad1d7eae22283a052f3dfda8" title="Return an RtAudio::DeviceInfo structure for a specified device number.">getDeviceInfo</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ) = 0;</div>
  293. <div class="line"><a name="l00618"></a><span class="lineno"> 618</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#aad8b94edd3cd379ee300b125750ac6ce" title="A function that returns the index of the default input device.">getDefaultInputDevice</a>( <span class="keywordtype">void</span> );</div>
  294. <div class="line"><a name="l00619"></a><span class="lineno"> 619</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a3a3f3dbe13ea696b521e49cdaaa357bc" title="A function that returns the index of the default output device.">getDefaultOutputDevice</a>( <span class="keywordtype">void</span> );</div>
  295. <div class="line"><a name="l00620"></a><span class="lineno"> 620</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a6907539d2527775df778ebce32ef1e3b" title="A public function for opening a stream with the specified parameters.">openStream</a>( <a class="code" href="structRtAudio_1_1StreamParameters.html" title="The structure for specifying input or ouput stream parameters.">RtAudio::StreamParameters</a> *outputParameters,</div>
  296. <div class="line"><a name="l00621"></a><span class="lineno"> 621</span>&#160; <a class="code" href="structRtAudio_1_1StreamParameters.html" title="The structure for specifying input or ouput stream parameters.">RtAudio::StreamParameters</a> *inputParameters,</div>
  297. <div class="line"><a name="l00622"></a><span class="lineno"> 622</span>&#160; <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate,</div>
  298. <div class="line"><a name="l00623"></a><span class="lineno"> 623</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferFrames, <a class="code" href="RtAudio_8h.html#a112c7b7e25a974977f6fc094cef1a31f" title="RtAudio callback function prototype.">RtAudioCallback</a> callback,</div>
  299. <div class="line"><a name="l00624"></a><span class="lineno"> 624</span>&#160; <span class="keywordtype">void</span> *userData, <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options,</div>
  300. <div class="line"><a name="l00625"></a><span class="lineno"> 625</span>&#160; <a class="code" href="RtAudio_8h.html#a2c8c34d284ae138dd29b53375ec9f062" title="RtAudio error callback function prototype.">RtAudioErrorCallback</a> errorCallback );</div>
  301. <div class="line"><a name="l00626"></a><span class="lineno"> 626</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a90d599002ad32cf250a4cb866f2cc93a" title="A function that closes a stream and frees any associated stream memory.">closeStream</a>( <span class="keywordtype">void</span> );</div>
  302. <div class="line"><a name="l00627"></a><span class="lineno"> 627</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#aec017a89629ccef66a90b60be22a2f80" title="A function that starts a stream.">startStream</a>( <span class="keywordtype">void</span> ) = 0;</div>
  303. <div class="line"><a name="l00628"></a><span class="lineno"> 628</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#af4c241ff86936ecc8108f0d9dfe3efdd" title="Stop a stream, allowing any samples remaining in the output queue to be played.">stopStream</a>( <span class="keywordtype">void</span> ) = 0;</div>
  304. <div class="line"><a name="l00629"></a><span class="lineno"> 629</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#ad0586b47cd6bb9591a80b4052815991f" title="Stop a stream, discarding any samples remaining in the input/output queue.">abortStream</a>( <span class="keywordtype">void</span> ) = 0;</div>
  305. <div class="line"><a name="l00630"></a><span class="lineno"> 630</span>&#160; <span class="keywordtype">long</span> <a class="code" href="classRtAudio.html#a843c989d9f501c71bc2f2c5ca18df9f3" title="Returns the internal stream latency in sample frames.">getStreamLatency</a>( <span class="keywordtype">void</span> );</div>
  306. <div class="line"><a name="l00631"></a><span class="lineno"> 631</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a28214b8b05d60b45c24ee6fae7b2a0b5" title="Returns actual sample rate in use by the stream.">getStreamSampleRate</a>( <span class="keywordtype">void</span> );</div>
  307. <div class="line"><a name="l00632"></a><span class="lineno"> 632</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classRtAudio.html#a344e59a62353c5791db4621b985cb2ca" title="Returns the number of elapsed seconds since the stream was started.">getStreamTime</a>( <span class="keywordtype">void</span> );</div>
  308. <div class="line"><a name="l00633"></a><span class="lineno"> 633</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classRtAudio.html#a3863e45ff81dbe97176de0ee7545917f" title="Returns true if a stream is open and false if not.">isStreamOpen</a>( <span class="keywordtype">void</span> )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> stream_.state != STREAM_CLOSED; }</div>
  309. <div class="line"><a name="l00634"></a><span class="lineno"> 634</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classRtAudio.html#a84cc8d9b7ab9bc5f37bcf48430ec5aea" title="Returns true if the stream is running and false if it is stopped or not open.">isStreamRunning</a>( <span class="keywordtype">void</span> )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> stream_.state == STREAM_RUNNING; }</div>
  310. <div class="line"><a name="l00635"></a><span class="lineno"> 635</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#af0752ee51cce3dd90a3bd009f9fdbe77" title="Specify whether warning messages should be printed to stderr.">showWarnings</a>( <span class="keywordtype">bool</span> value ) { showWarnings_ = value; }</div>
  311. <div class="line"><a name="l00636"></a><span class="lineno"> 636</span>&#160;</div>
  312. <div class="line"><a name="l00637"></a><span class="lineno"> 637</span>&#160;</div>
  313. <div class="line"><a name="l00638"></a><span class="lineno"> 638</span>&#160;<span class="keyword">protected</span>:</div>
  314. <div class="line"><a name="l00639"></a><span class="lineno"> 639</span>&#160;</div>
  315. <div class="line"><a name="l00640"></a><span class="lineno"> 640</span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> MAX_SAMPLE_RATES;</div>
  316. <div class="line"><a name="l00641"></a><span class="lineno"> 641</span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> SAMPLE_RATES[];</div>
  317. <div class="line"><a name="l00642"></a><span class="lineno"> 642</span>&#160;</div>
  318. <div class="line"><a name="l00643"></a><span class="lineno"> 643</span>&#160; <span class="keyword">enum</span> { FAILURE, SUCCESS };</div>
  319. <div class="line"><a name="l00644"></a><span class="lineno"> 644</span>&#160;</div>
  320. <div class="line"><a name="l00645"></a><span class="lineno"> 645</span>&#160; <span class="keyword">enum</span> StreamState {</div>
  321. <div class="line"><a name="l00646"></a><span class="lineno"> 646</span>&#160; STREAM_STOPPED,</div>
  322. <div class="line"><a name="l00647"></a><span class="lineno"> 647</span>&#160; STREAM_STOPPING,</div>
  323. <div class="line"><a name="l00648"></a><span class="lineno"> 648</span>&#160; STREAM_RUNNING,</div>
  324. <div class="line"><a name="l00649"></a><span class="lineno"> 649</span>&#160; STREAM_CLOSED = -50</div>
  325. <div class="line"><a name="l00650"></a><span class="lineno"> 650</span>&#160; };</div>
  326. <div class="line"><a name="l00651"></a><span class="lineno"> 651</span>&#160;</div>
  327. <div class="line"><a name="l00652"></a><span class="lineno"> 652</span>&#160; <span class="keyword">enum</span> StreamMode {</div>
  328. <div class="line"><a name="l00653"></a><span class="lineno"> 653</span>&#160; OUTPUT,</div>
  329. <div class="line"><a name="l00654"></a><span class="lineno"> 654</span>&#160; INPUT,</div>
  330. <div class="line"><a name="l00655"></a><span class="lineno"> 655</span>&#160; DUPLEX,</div>
  331. <div class="line"><a name="l00656"></a><span class="lineno"> 656</span>&#160; UNINITIALIZED = -75</div>
  332. <div class="line"><a name="l00657"></a><span class="lineno"> 657</span>&#160; };</div>
  333. <div class="line"><a name="l00658"></a><span class="lineno"> 658</span>&#160;</div>
  334. <div class="line"><a name="l00659"></a><span class="lineno"> 659</span>&#160; <span class="comment">// A protected structure used for buffer conversion.</span></div>
  335. <div class="line"><a name="l00660"></a><span class="lineno"> 660</span>&#160; <span class="keyword">struct </span>ConvertInfo {</div>
  336. <div class="line"><a name="l00661"></a><span class="lineno"> 661</span>&#160; <span class="keywordtype">int</span> channels;</div>
  337. <div class="line"><a name="l00662"></a><span class="lineno"> 662</span>&#160; <span class="keywordtype">int</span> inJump, outJump;</div>
  338. <div class="line"><a name="l00663"></a><span class="lineno"> 663</span>&#160; <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> inFormat, outFormat;</div>
  339. <div class="line"><a name="l00664"></a><span class="lineno"> 664</span>&#160; std::vector&lt;int&gt; inOffset;</div>
  340. <div class="line"><a name="l00665"></a><span class="lineno"> 665</span>&#160; std::vector&lt;int&gt; outOffset;</div>
  341. <div class="line"><a name="l00666"></a><span class="lineno"> 666</span>&#160; };</div>
  342. <div class="line"><a name="l00667"></a><span class="lineno"> 667</span>&#160;</div>
  343. <div class="line"><a name="l00668"></a><span class="lineno"> 668</span>&#160; <span class="comment">// A protected structure for audio streams.</span></div>
  344. <div class="line"><a name="l00669"></a><span class="lineno"> 669</span>&#160; <span class="keyword">struct </span>RtApiStream {</div>
  345. <div class="line"><a name="l00670"></a><span class="lineno"> 670</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device[2]; <span class="comment">// Playback and record, respectively.</span></div>
  346. <div class="line"><a name="l00671"></a><span class="lineno"> 671</span>&#160; <span class="keywordtype">void</span> *apiHandle; <span class="comment">// void pointer for API specific stream handle information</span></div>
  347. <div class="line"><a name="l00672"></a><span class="lineno"> 672</span>&#160; StreamMode mode; <span class="comment">// OUTPUT, INPUT, or DUPLEX.</span></div>
  348. <div class="line"><a name="l00673"></a><span class="lineno"> 673</span>&#160; StreamState state; <span class="comment">// STOPPED, RUNNING, or CLOSED</span></div>
  349. <div class="line"><a name="l00674"></a><span class="lineno"> 674</span>&#160; <span class="keywordtype">char</span> *userBuffer[2]; <span class="comment">// Playback and record, respectively.</span></div>
  350. <div class="line"><a name="l00675"></a><span class="lineno"> 675</span>&#160; <span class="keywordtype">char</span> *deviceBuffer;</div>
  351. <div class="line"><a name="l00676"></a><span class="lineno"> 676</span>&#160; <span class="keywordtype">bool</span> doConvertBuffer[2]; <span class="comment">// Playback and record, respectively.</span></div>
  352. <div class="line"><a name="l00677"></a><span class="lineno"> 677</span>&#160; <span class="keywordtype">bool</span> userInterleaved;</div>
  353. <div class="line"><a name="l00678"></a><span class="lineno"> 678</span>&#160; <span class="keywordtype">bool</span> deviceInterleaved[2]; <span class="comment">// Playback and record, respectively.</span></div>
  354. <div class="line"><a name="l00679"></a><span class="lineno"> 679</span>&#160; <span class="keywordtype">bool</span> doByteSwap[2]; <span class="comment">// Playback and record, respectively.</span></div>
  355. <div class="line"><a name="l00680"></a><span class="lineno"> 680</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate;</div>
  356. <div class="line"><a name="l00681"></a><span class="lineno"> 681</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> bufferSize;</div>
  357. <div class="line"><a name="l00682"></a><span class="lineno"> 682</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nBuffers;</div>
  358. <div class="line"><a name="l00683"></a><span class="lineno"> 683</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nUserChannels[2]; <span class="comment">// Playback and record, respectively.</span></div>
  359. <div class="line"><a name="l00684"></a><span class="lineno"> 684</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nDeviceChannels[2]; <span class="comment">// Playback and record channels, respectively.</span></div>
  360. <div class="line"><a name="l00685"></a><span class="lineno"> 685</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channelOffset[2]; <span class="comment">// Playback and record, respectively.</span></div>
  361. <div class="line"><a name="l00686"></a><span class="lineno"> 686</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> latency[2]; <span class="comment">// Playback and record, respectively.</span></div>
  362. <div class="line"><a name="l00687"></a><span class="lineno"> 687</span>&#160; <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> userFormat;</div>
  363. <div class="line"><a name="l00688"></a><span class="lineno"> 688</span>&#160; <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> deviceFormat[2]; <span class="comment">// Playback and record, respectively.</span></div>
  364. <div class="line"><a name="l00689"></a><span class="lineno"> 689</span>&#160; StreamMutex mutex;</div>
  365. <div class="line"><a name="l00690"></a><span class="lineno"> 690</span>&#160; CallbackInfo callbackInfo;</div>
  366. <div class="line"><a name="l00691"></a><span class="lineno"> 691</span>&#160; ConvertInfo convertInfo[2];</div>
  367. <div class="line"><a name="l00692"></a><span class="lineno"> 692</span>&#160; <span class="keywordtype">double</span> streamTime; <span class="comment">// Number of elapsed seconds since the stream started.</span></div>
  368. <div class="line"><a name="l00693"></a><span class="lineno"> 693</span>&#160;</div>
  369. <div class="line"><a name="l00694"></a><span class="lineno"> 694</span>&#160;<span class="preprocessor">#if defined(HAVE_GETTIMEOFDAY)</span></div>
  370. <div class="line"><a name="l00695"></a><span class="lineno"> 695</span>&#160;<span class="preprocessor"></span> <span class="keyword">struct </span>timeval lastTickTimestamp;</div>
  371. <div class="line"><a name="l00696"></a><span class="lineno"> 696</span>&#160;<span class="preprocessor">#endif</span></div>
  372. <div class="line"><a name="l00697"></a><span class="lineno"> 697</span>&#160;<span class="preprocessor"></span></div>
  373. <div class="line"><a name="l00698"></a><span class="lineno"> 698</span>&#160; RtApiStream()</div>
  374. <div class="line"><a name="l00699"></a><span class="lineno"> 699</span>&#160; :apiHandle(0), deviceBuffer(0) { device[0] = 11111; device[1] = 11111; }</div>
  375. <div class="line"><a name="l00700"></a><span class="lineno"> 700</span>&#160; };</div>
  376. <div class="line"><a name="l00701"></a><span class="lineno"> 701</span>&#160;</div>
  377. <div class="line"><a name="l00702"></a><span class="lineno"> 702</span>&#160; <span class="keyword">typedef</span> S24 Int24;</div>
  378. <div class="line"><a name="l00703"></a><span class="lineno"> 703</span>&#160; <span class="keyword">typedef</span> <span class="keywordtype">signed</span> <span class="keywordtype">short</span> Int16;</div>
  379. <div class="line"><a name="l00704"></a><span class="lineno"> 704</span>&#160; <span class="keyword">typedef</span> <span class="keywordtype">signed</span> <span class="keywordtype">int</span> Int32;</div>
  380. <div class="line"><a name="l00705"></a><span class="lineno"> 705</span>&#160; <span class="keyword">typedef</span> <span class="keywordtype">float</span> Float32;</div>
  381. <div class="line"><a name="l00706"></a><span class="lineno"> 706</span>&#160; <span class="keyword">typedef</span> <span class="keywordtype">double</span> Float64;</div>
  382. <div class="line"><a name="l00707"></a><span class="lineno"> 707</span>&#160;</div>
  383. <div class="line"><a name="l00708"></a><span class="lineno"> 708</span>&#160; std::ostringstream errorStream_;</div>
  384. <div class="line"><a name="l00709"></a><span class="lineno"> 709</span>&#160; std::string errorText_;</div>
  385. <div class="line"><a name="l00710"></a><span class="lineno"> 710</span>&#160; <span class="keywordtype">bool</span> showWarnings_;</div>
  386. <div class="line"><a name="l00711"></a><span class="lineno"> 711</span>&#160; RtApiStream stream_;</div>
  387. <div class="line"><a name="l00712"></a><span class="lineno"> 712</span>&#160;</div>
  388. <div class="line"><a name="l00720"></a><span class="lineno"> 720</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, </div>
  389. <div class="line"><a name="l00721"></a><span class="lineno"> 721</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate,</div>
  390. <div class="line"><a name="l00722"></a><span class="lineno"> 722</span>&#160; <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize,</div>
  391. <div class="line"><a name="l00723"></a><span class="lineno"> 723</span>&#160; <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options );</div>
  392. <div class="line"><a name="l00724"></a><span class="lineno"> 724</span>&#160;</div>
  393. <div class="line"><a name="l00726"></a><span class="lineno"> 726</span>&#160; <span class="keywordtype">void</span> tickStreamTime( <span class="keywordtype">void</span> );</div>
  394. <div class="line"><a name="l00727"></a><span class="lineno"> 727</span>&#160;</div>
  395. <div class="line"><a name="l00729"></a><span class="lineno"> 729</span>&#160; <span class="keywordtype">void</span> clearStreamInfo();</div>
  396. <div class="line"><a name="l00730"></a><span class="lineno"> 730</span>&#160;</div>
  397. <div class="line"><a name="l00735"></a><span class="lineno"> 735</span>&#160; <span class="keywordtype">void</span> verifyStream( <span class="keywordtype">void</span> );</div>
  398. <div class="line"><a name="l00736"></a><span class="lineno"> 736</span>&#160;</div>
  399. <div class="line"><a name="l00738"></a><span class="lineno"> 738</span>&#160; <span class="keywordtype">void</span> error( <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac" title="Defined RtError types.">RtError::Type</a> type );</div>
  400. <div class="line"><a name="l00739"></a><span class="lineno"> 739</span>&#160;</div>
  401. <div class="line"><a name="l00744"></a><span class="lineno"> 744</span>&#160; <span class="keywordtype">void</span> convertBuffer( <span class="keywordtype">char</span> *outBuffer, <span class="keywordtype">char</span> *inBuffer, ConvertInfo &amp;info );</div>
  402. <div class="line"><a name="l00745"></a><span class="lineno"> 745</span>&#160;</div>
  403. <div class="line"><a name="l00747"></a><span class="lineno"> 747</span>&#160; <span class="keywordtype">void</span> byteSwapBuffer( <span class="keywordtype">char</span> *buffer, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> samples, <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format );</div>
  404. <div class="line"><a name="l00748"></a><span class="lineno"> 748</span>&#160;</div>
  405. <div class="line"><a name="l00750"></a><span class="lineno"> 750</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> formatBytes( <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format );</div>
  406. <div class="line"><a name="l00751"></a><span class="lineno"> 751</span>&#160;</div>
  407. <div class="line"><a name="l00753"></a><span class="lineno"> 753</span>&#160; <span class="keywordtype">void</span> setConvertInfo( StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel );</div>
  408. <div class="line"><a name="l00754"></a><span class="lineno"> 754</span>&#160;};</div>
  409. <div class="line"><a name="l00755"></a><span class="lineno"> 755</span>&#160;</div>
  410. <div class="line"><a name="l00756"></a><span class="lineno"> 756</span>&#160;<span class="comment">// **************************************************************** //</span></div>
  411. <div class="line"><a name="l00757"></a><span class="lineno"> 757</span>&#160;<span class="comment">//</span></div>
  412. <div class="line"><a name="l00758"></a><span class="lineno"> 758</span>&#160;<span class="comment">// Inline RtAudio definitions.</span></div>
  413. <div class="line"><a name="l00759"></a><span class="lineno"> 759</span>&#160;<span class="comment">//</span></div>
  414. <div class="line"><a name="l00760"></a><span class="lineno"> 760</span>&#160;<span class="comment">// **************************************************************** //</span></div>
  415. <div class="line"><a name="l00761"></a><span class="lineno"> 761</span>&#160;</div>
  416. <div class="line"><a name="l00762"></a><span class="lineno"><a class="code" href="classRtAudio.html#a83687634795792b2c47e4ae1cf8a5246"> 762</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> <a class="code" href="classRtAudio.html#a83687634795792b2c47e4ae1cf8a5246" title="Returns the audio API specifier for the current instance of RtAudio.">RtAudio :: getCurrentApi</a>( <span class="keywordtype">void</span> ) throw() { <span class="keywordflow">return</span> rtapi_-&gt;getCurrentApi(); }</div>
  417. <div class="line"><a name="l00763"></a><span class="lineno"><a class="code" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a"> 763</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">RtAudio :: getDeviceCount</a>( <span class="keywordtype">void</span> ) throw() { <span class="keywordflow">return</span> rtapi_-&gt;getDeviceCount(); }</div>
  418. <div class="line"><a name="l00764"></a><span class="lineno"><a class="code" href="classRtAudio.html#a02d7ff44ad1d7eae22283a052f3dfda8"> 764</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> <a class="code" href="classRtAudio.html#a02d7ff44ad1d7eae22283a052f3dfda8" title="Return an RtAudio::DeviceInfo structure for a specified device number.">RtAudio :: getDeviceInfo</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ) { <span class="keywordflow">return</span> rtapi_-&gt;getDeviceInfo( device ); }</div>
  419. <div class="line"><a name="l00765"></a><span class="lineno"><a class="code" href="classRtAudio.html#aad8b94edd3cd379ee300b125750ac6ce"> 765</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#aad8b94edd3cd379ee300b125750ac6ce" title="A function that returns the index of the default input device.">RtAudio :: getDefaultInputDevice</a>( <span class="keywordtype">void</span> ) throw() { <span class="keywordflow">return</span> rtapi_-&gt;getDefaultInputDevice(); }</div>
  420. <div class="line"><a name="l00766"></a><span class="lineno"><a class="code" href="classRtAudio.html#a3a3f3dbe13ea696b521e49cdaaa357bc"> 766</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a3a3f3dbe13ea696b521e49cdaaa357bc" title="A function that returns the index of the default output device.">RtAudio :: getDefaultOutputDevice</a>( <span class="keywordtype">void</span> ) throw() { <span class="keywordflow">return</span> rtapi_-&gt;getDefaultOutputDevice(); }</div>
  421. <div class="line"><a name="l00767"></a><span class="lineno"><a class="code" href="classRtAudio.html#a90d599002ad32cf250a4cb866f2cc93a"> 767</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a90d599002ad32cf250a4cb866f2cc93a" title="A function that closes a stream and frees any associated stream memory.">RtAudio :: closeStream</a>( <span class="keywordtype">void</span> ) throw() { <span class="keywordflow">return</span> rtapi_-&gt;closeStream(); }</div>
  422. <div class="line"><a name="l00768"></a><span class="lineno"><a class="code" href="classRtAudio.html#aec017a89629ccef66a90b60be22a2f80"> 768</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#aec017a89629ccef66a90b60be22a2f80" title="A function that starts a stream.">RtAudio :: startStream</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> rtapi_-&gt;startStream(); }</div>
  423. <div class="line"><a name="l00769"></a><span class="lineno"><a class="code" href="classRtAudio.html#af4c241ff86936ecc8108f0d9dfe3efdd"> 769</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#af4c241ff86936ecc8108f0d9dfe3efdd" title="Stop a stream, allowing any samples remaining in the output queue to be played.">RtAudio :: stopStream</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> rtapi_-&gt;stopStream(); }</div>
  424. <div class="line"><a name="l00770"></a><span class="lineno"><a class="code" href="classRtAudio.html#ad0586b47cd6bb9591a80b4052815991f"> 770</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#ad0586b47cd6bb9591a80b4052815991f" title="Stop a stream, discarding any samples remaining in the input/output queue.">RtAudio :: abortStream</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> rtapi_-&gt;abortStream(); }</div>
  425. <div class="line"><a name="l00771"></a><span class="lineno"><a class="code" href="classRtAudio.html#a3863e45ff81dbe97176de0ee7545917f"> 771</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classRtAudio.html#a3863e45ff81dbe97176de0ee7545917f" title="Returns true if a stream is open and false if not.">RtAudio :: isStreamOpen</a>( <span class="keywordtype">void</span> ) <span class="keyword">const</span> throw() { <span class="keywordflow">return</span> rtapi_-&gt;isStreamOpen(); }</div>
  426. <div class="line"><a name="l00772"></a><span class="lineno"><a class="code" href="classRtAudio.html#a84cc8d9b7ab9bc5f37bcf48430ec5aea"> 772</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classRtAudio.html#a84cc8d9b7ab9bc5f37bcf48430ec5aea" title="Returns true if the stream is running and false if it is stopped or not open.">RtAudio :: isStreamRunning</a>( <span class="keywordtype">void</span> ) <span class="keyword">const</span> throw() { <span class="keywordflow">return</span> rtapi_-&gt;isStreamRunning(); }</div>
  427. <div class="line"><a name="l00773"></a><span class="lineno"><a class="code" href="classRtAudio.html#a843c989d9f501c71bc2f2c5ca18df9f3"> 773</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">long</span> <a class="code" href="classRtAudio.html#a843c989d9f501c71bc2f2c5ca18df9f3" title="Returns the internal stream latency in sample frames.">RtAudio :: getStreamLatency</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> rtapi_-&gt;getStreamLatency(); }</div>
  428. <div class="line"><a name="l00774"></a><span class="lineno"><a class="code" href="classRtAudio.html#a28214b8b05d60b45c24ee6fae7b2a0b5"> 774</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a28214b8b05d60b45c24ee6fae7b2a0b5" title="Returns actual sample rate in use by the stream.">RtAudio :: getStreamSampleRate</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> rtapi_-&gt;getStreamSampleRate(); }</div>
  429. <div class="line"><a name="l00775"></a><span class="lineno"><a class="code" href="classRtAudio.html#a344e59a62353c5791db4621b985cb2ca"> 775</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classRtAudio.html#a344e59a62353c5791db4621b985cb2ca" title="Returns the number of elapsed seconds since the stream was started.">RtAudio :: getStreamTime</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> rtapi_-&gt;getStreamTime(); }</div>
  430. <div class="line"><a name="l00776"></a><span class="lineno"><a class="code" href="classRtAudio.html#af0752ee51cce3dd90a3bd009f9fdbe77"> 776</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#af0752ee51cce3dd90a3bd009f9fdbe77" title="Specify whether warning messages should be printed to stderr.">RtAudio :: showWarnings</a>( <span class="keywordtype">bool</span> value ) <span class="keywordflow">throw</span>() { rtapi_-&gt;showWarnings( value ); }</div>
  431. <div class="line"><a name="l00777"></a><span class="lineno"> 777</span>&#160;</div>
  432. <div class="line"><a name="l00778"></a><span class="lineno"> 778</span>&#160;<span class="comment">// RtApi Subclass prototypes.</span></div>
  433. <div class="line"><a name="l00779"></a><span class="lineno"> 779</span>&#160;</div>
  434. <div class="line"><a name="l00780"></a><span class="lineno"> 780</span>&#160;<span class="preprocessor">#if defined(__MACOSX_CORE__)</span></div>
  435. <div class="line"><a name="l00781"></a><span class="lineno"> 781</span>&#160;<span class="preprocessor"></span></div>
  436. <div class="line"><a name="l00782"></a><span class="lineno"> 782</span>&#160;<span class="preprocessor">#include &lt;CoreAudio/AudioHardware.h&gt;</span></div>
  437. <div class="line"><a name="l00783"></a><span class="lineno"> 783</span>&#160;</div>
  438. <div class="line"><a name="l00784"></a><span class="lineno"> 784</span>&#160;<span class="keyword">class </span>RtApiCore: <span class="keyword">public</span> RtApi</div>
  439. <div class="line"><a name="l00785"></a><span class="lineno"> 785</span>&#160;{</div>
  440. <div class="line"><a name="l00786"></a><span class="lineno"> 786</span>&#160;<span class="keyword">public</span>:</div>
  441. <div class="line"><a name="l00787"></a><span class="lineno"> 787</span>&#160;</div>
  442. <div class="line"><a name="l00788"></a><span class="lineno"> 788</span>&#160; RtApiCore();</div>
  443. <div class="line"><a name="l00789"></a><span class="lineno"> 789</span>&#160; ~RtApiCore();</div>
  444. <div class="line"><a name="l00790"></a><span class="lineno"> 790</span>&#160; <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> <a class="code" href="classRtAudio.html#a83687634795792b2c47e4ae1cf8a5246" title="Returns the audio API specifier for the current instance of RtAudio.">getCurrentApi</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a9fec92b8272244a87a6a11a717bd662d">RtAudio::MACOSX_CORE</a>; }</div>
  445. <div class="line"><a name="l00791"></a><span class="lineno"> 791</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">getDeviceCount</a>( <span class="keywordtype">void</span> );</div>
  446. <div class="line"><a name="l00792"></a><span class="lineno"> 792</span>&#160; <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> <a class="code" href="classRtAudio.html#a02d7ff44ad1d7eae22283a052f3dfda8" title="Return an RtAudio::DeviceInfo structure for a specified device number.">getDeviceInfo</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device );</div>
  447. <div class="line"><a name="l00793"></a><span class="lineno"> 793</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a3a3f3dbe13ea696b521e49cdaaa357bc" title="A function that returns the index of the default output device.">getDefaultOutputDevice</a>( <span class="keywordtype">void</span> );</div>
  448. <div class="line"><a name="l00794"></a><span class="lineno"> 794</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#aad8b94edd3cd379ee300b125750ac6ce" title="A function that returns the index of the default input device.">getDefaultInputDevice</a>( <span class="keywordtype">void</span> );</div>
  449. <div class="line"><a name="l00795"></a><span class="lineno"> 795</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a90d599002ad32cf250a4cb866f2cc93a" title="A function that closes a stream and frees any associated stream memory.">closeStream</a>( <span class="keywordtype">void</span> );</div>
  450. <div class="line"><a name="l00796"></a><span class="lineno"> 796</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#aec017a89629ccef66a90b60be22a2f80" title="A function that starts a stream.">startStream</a>( <span class="keywordtype">void</span> );</div>
  451. <div class="line"><a name="l00797"></a><span class="lineno"> 797</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#af4c241ff86936ecc8108f0d9dfe3efdd" title="Stop a stream, allowing any samples remaining in the output queue to be played.">stopStream</a>( <span class="keywordtype">void</span> );</div>
  452. <div class="line"><a name="l00798"></a><span class="lineno"> 798</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#ad0586b47cd6bb9591a80b4052815991f" title="Stop a stream, discarding any samples remaining in the input/output queue.">abortStream</a>( <span class="keywordtype">void</span> );</div>
  453. <div class="line"><a name="l00799"></a><span class="lineno"> 799</span>&#160; <span class="keywordtype">long</span> <a class="code" href="classRtAudio.html#a843c989d9f501c71bc2f2c5ca18df9f3" title="Returns the internal stream latency in sample frames.">getStreamLatency</a>( <span class="keywordtype">void</span> );</div>
  454. <div class="line"><a name="l00800"></a><span class="lineno"> 800</span>&#160;</div>
  455. <div class="line"><a name="l00801"></a><span class="lineno"> 801</span>&#160; <span class="comment">// This function is intended for internal use only. It must be</span></div>
  456. <div class="line"><a name="l00802"></a><span class="lineno"> 802</span>&#160; <span class="comment">// public because it is called by the internal callback handler,</span></div>
  457. <div class="line"><a name="l00803"></a><span class="lineno"> 803</span>&#160; <span class="comment">// which is not a member of RtAudio. External use of this function</span></div>
  458. <div class="line"><a name="l00804"></a><span class="lineno"> 804</span>&#160; <span class="comment">// will most likely produce highly undesireable results!</span></div>
  459. <div class="line"><a name="l00805"></a><span class="lineno"> 805</span>&#160; <span class="keywordtype">bool</span> callbackEvent( AudioDeviceID deviceId,</div>
  460. <div class="line"><a name="l00806"></a><span class="lineno"> 806</span>&#160; <span class="keyword">const</span> AudioBufferList *inBufferList,</div>
  461. <div class="line"><a name="l00807"></a><span class="lineno"> 807</span>&#160; <span class="keyword">const</span> AudioBufferList *outBufferList );</div>
  462. <div class="line"><a name="l00808"></a><span class="lineno"> 808</span>&#160;</div>
  463. <div class="line"><a name="l00809"></a><span class="lineno"> 809</span>&#160; <span class="keyword">private</span>:</div>
  464. <div class="line"><a name="l00810"></a><span class="lineno"> 810</span>&#160;</div>
  465. <div class="line"><a name="l00811"></a><span class="lineno"> 811</span>&#160; <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, </div>
  466. <div class="line"><a name="l00812"></a><span class="lineno"> 812</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate,</div>
  467. <div class="line"><a name="l00813"></a><span class="lineno"> 813</span>&#160; <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize,</div>
  468. <div class="line"><a name="l00814"></a><span class="lineno"> 814</span>&#160; <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options );</div>
  469. <div class="line"><a name="l00815"></a><span class="lineno"> 815</span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* getErrorCode( OSStatus code );</div>
  470. <div class="line"><a name="l00816"></a><span class="lineno"> 816</span>&#160;};</div>
  471. <div class="line"><a name="l00817"></a><span class="lineno"> 817</span>&#160;</div>
  472. <div class="line"><a name="l00818"></a><span class="lineno"> 818</span>&#160;<span class="preprocessor">#endif</span></div>
  473. <div class="line"><a name="l00819"></a><span class="lineno"> 819</span>&#160;<span class="preprocessor"></span></div>
  474. <div class="line"><a name="l00820"></a><span class="lineno"> 820</span>&#160;<span class="preprocessor">#if defined(__UNIX_JACK__)</span></div>
  475. <div class="line"><a name="l00821"></a><span class="lineno"> 821</span>&#160;<span class="preprocessor"></span></div>
  476. <div class="line"><a name="l00822"></a><span class="lineno"> 822</span>&#160;<span class="keyword">class </span>RtApiJack: <span class="keyword">public</span> RtApi</div>
  477. <div class="line"><a name="l00823"></a><span class="lineno"> 823</span>&#160;{</div>
  478. <div class="line"><a name="l00824"></a><span class="lineno"> 824</span>&#160;<span class="keyword">public</span>:</div>
  479. <div class="line"><a name="l00825"></a><span class="lineno"> 825</span>&#160;</div>
  480. <div class="line"><a name="l00826"></a><span class="lineno"> 826</span>&#160; RtApiJack();</div>
  481. <div class="line"><a name="l00827"></a><span class="lineno"> 827</span>&#160; ~RtApiJack();</div>
  482. <div class="line"><a name="l00828"></a><span class="lineno"> 828</span>&#160; <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> <a class="code" href="classRtAudio.html#a83687634795792b2c47e4ae1cf8a5246" title="Returns the audio API specifier for the current instance of RtAudio.">getCurrentApi</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a4767e17c6edfbd827f91763915df4105">RtAudio::UNIX_JACK</a>; }</div>
  483. <div class="line"><a name="l00829"></a><span class="lineno"> 829</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">getDeviceCount</a>( <span class="keywordtype">void</span> );</div>
  484. <div class="line"><a name="l00830"></a><span class="lineno"> 830</span>&#160; <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> <a class="code" href="classRtAudio.html#a02d7ff44ad1d7eae22283a052f3dfda8" title="Return an RtAudio::DeviceInfo structure for a specified device number.">getDeviceInfo</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device );</div>
  485. <div class="line"><a name="l00831"></a><span class="lineno"> 831</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a90d599002ad32cf250a4cb866f2cc93a" title="A function that closes a stream and frees any associated stream memory.">closeStream</a>( <span class="keywordtype">void</span> );</div>
  486. <div class="line"><a name="l00832"></a><span class="lineno"> 832</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#aec017a89629ccef66a90b60be22a2f80" title="A function that starts a stream.">startStream</a>( <span class="keywordtype">void</span> );</div>
  487. <div class="line"><a name="l00833"></a><span class="lineno"> 833</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#af4c241ff86936ecc8108f0d9dfe3efdd" title="Stop a stream, allowing any samples remaining in the output queue to be played.">stopStream</a>( <span class="keywordtype">void</span> );</div>
  488. <div class="line"><a name="l00834"></a><span class="lineno"> 834</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#ad0586b47cd6bb9591a80b4052815991f" title="Stop a stream, discarding any samples remaining in the input/output queue.">abortStream</a>( <span class="keywordtype">void</span> );</div>
  489. <div class="line"><a name="l00835"></a><span class="lineno"> 835</span>&#160; <span class="keywordtype">long</span> <a class="code" href="classRtAudio.html#a843c989d9f501c71bc2f2c5ca18df9f3" title="Returns the internal stream latency in sample frames.">getStreamLatency</a>( <span class="keywordtype">void</span> );</div>
  490. <div class="line"><a name="l00836"></a><span class="lineno"> 836</span>&#160;</div>
  491. <div class="line"><a name="l00837"></a><span class="lineno"> 837</span>&#160; <span class="comment">// This function is intended for internal use only. It must be</span></div>
  492. <div class="line"><a name="l00838"></a><span class="lineno"> 838</span>&#160; <span class="comment">// public because it is called by the internal callback handler,</span></div>
  493. <div class="line"><a name="l00839"></a><span class="lineno"> 839</span>&#160; <span class="comment">// which is not a member of RtAudio. External use of this function</span></div>
  494. <div class="line"><a name="l00840"></a><span class="lineno"> 840</span>&#160; <span class="comment">// will most likely produce highly undesireable results!</span></div>
  495. <div class="line"><a name="l00841"></a><span class="lineno"> 841</span>&#160; <span class="keywordtype">bool</span> callbackEvent( <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> nframes );</div>
  496. <div class="line"><a name="l00842"></a><span class="lineno"> 842</span>&#160;</div>
  497. <div class="line"><a name="l00843"></a><span class="lineno"> 843</span>&#160; <span class="keyword">private</span>:</div>
  498. <div class="line"><a name="l00844"></a><span class="lineno"> 844</span>&#160;</div>
  499. <div class="line"><a name="l00845"></a><span class="lineno"> 845</span>&#160; <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, </div>
  500. <div class="line"><a name="l00846"></a><span class="lineno"> 846</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate,</div>
  501. <div class="line"><a name="l00847"></a><span class="lineno"> 847</span>&#160; <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize,</div>
  502. <div class="line"><a name="l00848"></a><span class="lineno"> 848</span>&#160; <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options );</div>
  503. <div class="line"><a name="l00849"></a><span class="lineno"> 849</span>&#160;};</div>
  504. <div class="line"><a name="l00850"></a><span class="lineno"> 850</span>&#160;</div>
  505. <div class="line"><a name="l00851"></a><span class="lineno"> 851</span>&#160;<span class="preprocessor">#endif</span></div>
  506. <div class="line"><a name="l00852"></a><span class="lineno"> 852</span>&#160;<span class="preprocessor"></span></div>
  507. <div class="line"><a name="l00853"></a><span class="lineno"> 853</span>&#160;<span class="preprocessor">#if defined(__WINDOWS_ASIO__)</span></div>
  508. <div class="line"><a name="l00854"></a><span class="lineno"> 854</span>&#160;<span class="preprocessor"></span></div>
  509. <div class="line"><a name="l00855"></a><span class="lineno"> 855</span>&#160;<span class="keyword">class </span>RtApiAsio: <span class="keyword">public</span> RtApi</div>
  510. <div class="line"><a name="l00856"></a><span class="lineno"> 856</span>&#160;{</div>
  511. <div class="line"><a name="l00857"></a><span class="lineno"> 857</span>&#160;<span class="keyword">public</span>:</div>
  512. <div class="line"><a name="l00858"></a><span class="lineno"> 858</span>&#160;</div>
  513. <div class="line"><a name="l00859"></a><span class="lineno"> 859</span>&#160; RtApiAsio();</div>
  514. <div class="line"><a name="l00860"></a><span class="lineno"> 860</span>&#160; ~RtApiAsio();</div>
  515. <div class="line"><a name="l00861"></a><span class="lineno"> 861</span>&#160; <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> <a class="code" href="classRtAudio.html#a83687634795792b2c47e4ae1cf8a5246" title="Returns the audio API specifier for the current instance of RtAudio.">getCurrentApi</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a219517d1df90f94d07758481155bd469">RtAudio::WINDOWS_ASIO</a>; }</div>
  516. <div class="line"><a name="l00862"></a><span class="lineno"> 862</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">getDeviceCount</a>( <span class="keywordtype">void</span> );</div>
  517. <div class="line"><a name="l00863"></a><span class="lineno"> 863</span>&#160; <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> <a class="code" href="classRtAudio.html#a02d7ff44ad1d7eae22283a052f3dfda8" title="Return an RtAudio::DeviceInfo structure for a specified device number.">getDeviceInfo</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device );</div>
  518. <div class="line"><a name="l00864"></a><span class="lineno"> 864</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a90d599002ad32cf250a4cb866f2cc93a" title="A function that closes a stream and frees any associated stream memory.">closeStream</a>( <span class="keywordtype">void</span> );</div>
  519. <div class="line"><a name="l00865"></a><span class="lineno"> 865</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#aec017a89629ccef66a90b60be22a2f80" title="A function that starts a stream.">startStream</a>( <span class="keywordtype">void</span> );</div>
  520. <div class="line"><a name="l00866"></a><span class="lineno"> 866</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#af4c241ff86936ecc8108f0d9dfe3efdd" title="Stop a stream, allowing any samples remaining in the output queue to be played.">stopStream</a>( <span class="keywordtype">void</span> );</div>
  521. <div class="line"><a name="l00867"></a><span class="lineno"> 867</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#ad0586b47cd6bb9591a80b4052815991f" title="Stop a stream, discarding any samples remaining in the input/output queue.">abortStream</a>( <span class="keywordtype">void</span> );</div>
  522. <div class="line"><a name="l00868"></a><span class="lineno"> 868</span>&#160; <span class="keywordtype">long</span> <a class="code" href="classRtAudio.html#a843c989d9f501c71bc2f2c5ca18df9f3" title="Returns the internal stream latency in sample frames.">getStreamLatency</a>( <span class="keywordtype">void</span> );</div>
  523. <div class="line"><a name="l00869"></a><span class="lineno"> 869</span>&#160;</div>
  524. <div class="line"><a name="l00870"></a><span class="lineno"> 870</span>&#160; <span class="comment">// This function is intended for internal use only. It must be</span></div>
  525. <div class="line"><a name="l00871"></a><span class="lineno"> 871</span>&#160; <span class="comment">// public because it is called by the internal callback handler,</span></div>
  526. <div class="line"><a name="l00872"></a><span class="lineno"> 872</span>&#160; <span class="comment">// which is not a member of RtAudio. External use of this function</span></div>
  527. <div class="line"><a name="l00873"></a><span class="lineno"> 873</span>&#160; <span class="comment">// will most likely produce highly undesireable results!</span></div>
  528. <div class="line"><a name="l00874"></a><span class="lineno"> 874</span>&#160; <span class="keywordtype">bool</span> callbackEvent( <span class="keywordtype">long</span> bufferIndex );</div>
  529. <div class="line"><a name="l00875"></a><span class="lineno"> 875</span>&#160;</div>
  530. <div class="line"><a name="l00876"></a><span class="lineno"> 876</span>&#160; <span class="keyword">private</span>:</div>
  531. <div class="line"><a name="l00877"></a><span class="lineno"> 877</span>&#160;</div>
  532. <div class="line"><a name="l00878"></a><span class="lineno"> 878</span>&#160; std::vector&lt;RtAudio::DeviceInfo&gt; devices_;</div>
  533. <div class="line"><a name="l00879"></a><span class="lineno"> 879</span>&#160; <span class="keywordtype">void</span> saveDeviceInfo( <span class="keywordtype">void</span> );</div>
  534. <div class="line"><a name="l00880"></a><span class="lineno"> 880</span>&#160; <span class="keywordtype">bool</span> coInitialized_;</div>
  535. <div class="line"><a name="l00881"></a><span class="lineno"> 881</span>&#160; <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, </div>
  536. <div class="line"><a name="l00882"></a><span class="lineno"> 882</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate,</div>
  537. <div class="line"><a name="l00883"></a><span class="lineno"> 883</span>&#160; <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize,</div>
  538. <div class="line"><a name="l00884"></a><span class="lineno"> 884</span>&#160; <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options );</div>
  539. <div class="line"><a name="l00885"></a><span class="lineno"> 885</span>&#160;};</div>
  540. <div class="line"><a name="l00886"></a><span class="lineno"> 886</span>&#160;</div>
  541. <div class="line"><a name="l00887"></a><span class="lineno"> 887</span>&#160;<span class="preprocessor">#endif</span></div>
  542. <div class="line"><a name="l00888"></a><span class="lineno"> 888</span>&#160;<span class="preprocessor"></span></div>
  543. <div class="line"><a name="l00889"></a><span class="lineno"> 889</span>&#160;<span class="preprocessor">#if defined(__WINDOWS_DS__)</span></div>
  544. <div class="line"><a name="l00890"></a><span class="lineno"> 890</span>&#160;<span class="preprocessor"></span></div>
  545. <div class="line"><a name="l00891"></a><span class="lineno"> 891</span>&#160;<span class="keyword">class </span>RtApiDs: <span class="keyword">public</span> RtApi</div>
  546. <div class="line"><a name="l00892"></a><span class="lineno"> 892</span>&#160;{</div>
  547. <div class="line"><a name="l00893"></a><span class="lineno"> 893</span>&#160;<span class="keyword">public</span>:</div>
  548. <div class="line"><a name="l00894"></a><span class="lineno"> 894</span>&#160;</div>
  549. <div class="line"><a name="l00895"></a><span class="lineno"> 895</span>&#160; RtApiDs();</div>
  550. <div class="line"><a name="l00896"></a><span class="lineno"> 896</span>&#160; ~RtApiDs();</div>
  551. <div class="line"><a name="l00897"></a><span class="lineno"> 897</span>&#160; <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> <a class="code" href="classRtAudio.html#a83687634795792b2c47e4ae1cf8a5246" title="Returns the audio API specifier for the current instance of RtAudio.">getCurrentApi</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a28478830f42c2fd61e6c7ad498901931">RtAudio::WINDOWS_DS</a>; }</div>
  552. <div class="line"><a name="l00898"></a><span class="lineno"> 898</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">getDeviceCount</a>( <span class="keywordtype">void</span> );</div>
  553. <div class="line"><a name="l00899"></a><span class="lineno"> 899</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a3a3f3dbe13ea696b521e49cdaaa357bc" title="A function that returns the index of the default output device.">getDefaultOutputDevice</a>( <span class="keywordtype">void</span> );</div>
  554. <div class="line"><a name="l00900"></a><span class="lineno"> 900</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#aad8b94edd3cd379ee300b125750ac6ce" title="A function that returns the index of the default input device.">getDefaultInputDevice</a>( <span class="keywordtype">void</span> );</div>
  555. <div class="line"><a name="l00901"></a><span class="lineno"> 901</span>&#160; <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> <a class="code" href="classRtAudio.html#a02d7ff44ad1d7eae22283a052f3dfda8" title="Return an RtAudio::DeviceInfo structure for a specified device number.">getDeviceInfo</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device );</div>
  556. <div class="line"><a name="l00902"></a><span class="lineno"> 902</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a90d599002ad32cf250a4cb866f2cc93a" title="A function that closes a stream and frees any associated stream memory.">closeStream</a>( <span class="keywordtype">void</span> );</div>
  557. <div class="line"><a name="l00903"></a><span class="lineno"> 903</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#aec017a89629ccef66a90b60be22a2f80" title="A function that starts a stream.">startStream</a>( <span class="keywordtype">void</span> );</div>
  558. <div class="line"><a name="l00904"></a><span class="lineno"> 904</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#af4c241ff86936ecc8108f0d9dfe3efdd" title="Stop a stream, allowing any samples remaining in the output queue to be played.">stopStream</a>( <span class="keywordtype">void</span> );</div>
  559. <div class="line"><a name="l00905"></a><span class="lineno"> 905</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#ad0586b47cd6bb9591a80b4052815991f" title="Stop a stream, discarding any samples remaining in the input/output queue.">abortStream</a>( <span class="keywordtype">void</span> );</div>
  560. <div class="line"><a name="l00906"></a><span class="lineno"> 906</span>&#160; <span class="keywordtype">long</span> <a class="code" href="classRtAudio.html#a843c989d9f501c71bc2f2c5ca18df9f3" title="Returns the internal stream latency in sample frames.">getStreamLatency</a>( <span class="keywordtype">void</span> );</div>
  561. <div class="line"><a name="l00907"></a><span class="lineno"> 907</span>&#160;</div>
  562. <div class="line"><a name="l00908"></a><span class="lineno"> 908</span>&#160; <span class="comment">// This function is intended for internal use only. It must be</span></div>
  563. <div class="line"><a name="l00909"></a><span class="lineno"> 909</span>&#160; <span class="comment">// public because it is called by the internal callback handler,</span></div>
  564. <div class="line"><a name="l00910"></a><span class="lineno"> 910</span>&#160; <span class="comment">// which is not a member of RtAudio. External use of this function</span></div>
  565. <div class="line"><a name="l00911"></a><span class="lineno"> 911</span>&#160; <span class="comment">// will most likely produce highly undesireable results!</span></div>
  566. <div class="line"><a name="l00912"></a><span class="lineno"> 912</span>&#160; <span class="keywordtype">void</span> callbackEvent( <span class="keywordtype">void</span> );</div>
  567. <div class="line"><a name="l00913"></a><span class="lineno"> 913</span>&#160;</div>
  568. <div class="line"><a name="l00914"></a><span class="lineno"> 914</span>&#160; <span class="keyword">private</span>:</div>
  569. <div class="line"><a name="l00915"></a><span class="lineno"> 915</span>&#160;</div>
  570. <div class="line"><a name="l00916"></a><span class="lineno"> 916</span>&#160; <span class="keywordtype">bool</span> coInitialized_;</div>
  571. <div class="line"><a name="l00917"></a><span class="lineno"> 917</span>&#160; <span class="keywordtype">bool</span> buffersRolling;</div>
  572. <div class="line"><a name="l00918"></a><span class="lineno"> 918</span>&#160; <span class="keywordtype">long</span> duplexPrerollBytes;</div>
  573. <div class="line"><a name="l00919"></a><span class="lineno"> 919</span>&#160; std::vector&lt;struct DsDevice&gt; dsDevices;</div>
  574. <div class="line"><a name="l00920"></a><span class="lineno"> 920</span>&#160; <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, </div>
  575. <div class="line"><a name="l00921"></a><span class="lineno"> 921</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate,</div>
  576. <div class="line"><a name="l00922"></a><span class="lineno"> 922</span>&#160; <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize,</div>
  577. <div class="line"><a name="l00923"></a><span class="lineno"> 923</span>&#160; <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options );</div>
  578. <div class="line"><a name="l00924"></a><span class="lineno"> 924</span>&#160;};</div>
  579. <div class="line"><a name="l00925"></a><span class="lineno"> 925</span>&#160;</div>
  580. <div class="line"><a name="l00926"></a><span class="lineno"> 926</span>&#160;<span class="preprocessor">#endif</span></div>
  581. <div class="line"><a name="l00927"></a><span class="lineno"> 927</span>&#160;<span class="preprocessor"></span></div>
  582. <div class="line"><a name="l00928"></a><span class="lineno"> 928</span>&#160;<span class="preprocessor">#if defined(__LINUX_ALSA__)</span></div>
  583. <div class="line"><a name="l00929"></a><span class="lineno"> 929</span>&#160;<span class="preprocessor"></span></div>
  584. <div class="line"><a name="l00930"></a><span class="lineno"> 930</span>&#160;<span class="keyword">class </span>RtApiAlsa: <span class="keyword">public</span> RtApi</div>
  585. <div class="line"><a name="l00931"></a><span class="lineno"> 931</span>&#160;{</div>
  586. <div class="line"><a name="l00932"></a><span class="lineno"> 932</span>&#160;<span class="keyword">public</span>:</div>
  587. <div class="line"><a name="l00933"></a><span class="lineno"> 933</span>&#160;</div>
  588. <div class="line"><a name="l00934"></a><span class="lineno"> 934</span>&#160; RtApiAlsa();</div>
  589. <div class="line"><a name="l00935"></a><span class="lineno"> 935</span>&#160; ~RtApiAlsa();</div>
  590. <div class="line"><a name="l00936"></a><span class="lineno"> 936</span>&#160; <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> <a class="code" href="classRtAudio.html#a83687634795792b2c47e4ae1cf8a5246" title="Returns the audio API specifier for the current instance of RtAudio.">getCurrentApi</a>() { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849aa7a2ba095c2806caa893b6fb8fc3a1a8">RtAudio::LINUX_ALSA</a>; }</div>
  591. <div class="line"><a name="l00937"></a><span class="lineno"> 937</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">getDeviceCount</a>( <span class="keywordtype">void</span> );</div>
  592. <div class="line"><a name="l00938"></a><span class="lineno"> 938</span>&#160; <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> <a class="code" href="classRtAudio.html#a02d7ff44ad1d7eae22283a052f3dfda8" title="Return an RtAudio::DeviceInfo structure for a specified device number.">getDeviceInfo</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device );</div>
  593. <div class="line"><a name="l00939"></a><span class="lineno"> 939</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a90d599002ad32cf250a4cb866f2cc93a" title="A function that closes a stream and frees any associated stream memory.">closeStream</a>( <span class="keywordtype">void</span> );</div>
  594. <div class="line"><a name="l00940"></a><span class="lineno"> 940</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#aec017a89629ccef66a90b60be22a2f80" title="A function that starts a stream.">startStream</a>( <span class="keywordtype">void</span> );</div>
  595. <div class="line"><a name="l00941"></a><span class="lineno"> 941</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#af4c241ff86936ecc8108f0d9dfe3efdd" title="Stop a stream, allowing any samples remaining in the output queue to be played.">stopStream</a>( <span class="keywordtype">void</span> );</div>
  596. <div class="line"><a name="l00942"></a><span class="lineno"> 942</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#ad0586b47cd6bb9591a80b4052815991f" title="Stop a stream, discarding any samples remaining in the input/output queue.">abortStream</a>( <span class="keywordtype">void</span> );</div>
  597. <div class="line"><a name="l00943"></a><span class="lineno"> 943</span>&#160;</div>
  598. <div class="line"><a name="l00944"></a><span class="lineno"> 944</span>&#160; <span class="comment">// This function is intended for internal use only. It must be</span></div>
  599. <div class="line"><a name="l00945"></a><span class="lineno"> 945</span>&#160; <span class="comment">// public because it is called by the internal callback handler,</span></div>
  600. <div class="line"><a name="l00946"></a><span class="lineno"> 946</span>&#160; <span class="comment">// which is not a member of RtAudio. External use of this function</span></div>
  601. <div class="line"><a name="l00947"></a><span class="lineno"> 947</span>&#160; <span class="comment">// will most likely produce highly undesireable results!</span></div>
  602. <div class="line"><a name="l00948"></a><span class="lineno"> 948</span>&#160; <span class="keywordtype">void</span> callbackEvent( <span class="keywordtype">void</span> );</div>
  603. <div class="line"><a name="l00949"></a><span class="lineno"> 949</span>&#160;</div>
  604. <div class="line"><a name="l00950"></a><span class="lineno"> 950</span>&#160; <span class="keyword">private</span>:</div>
  605. <div class="line"><a name="l00951"></a><span class="lineno"> 951</span>&#160;</div>
  606. <div class="line"><a name="l00952"></a><span class="lineno"> 952</span>&#160; std::vector&lt;RtAudio::DeviceInfo&gt; devices_;</div>
  607. <div class="line"><a name="l00953"></a><span class="lineno"> 953</span>&#160; <span class="keywordtype">void</span> saveDeviceInfo( <span class="keywordtype">void</span> );</div>
  608. <div class="line"><a name="l00954"></a><span class="lineno"> 954</span>&#160; <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, </div>
  609. <div class="line"><a name="l00955"></a><span class="lineno"> 955</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate,</div>
  610. <div class="line"><a name="l00956"></a><span class="lineno"> 956</span>&#160; <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize,</div>
  611. <div class="line"><a name="l00957"></a><span class="lineno"> 957</span>&#160; <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options );</div>
  612. <div class="line"><a name="l00958"></a><span class="lineno"> 958</span>&#160;};</div>
  613. <div class="line"><a name="l00959"></a><span class="lineno"> 959</span>&#160;</div>
  614. <div class="line"><a name="l00960"></a><span class="lineno"> 960</span>&#160;<span class="preprocessor">#endif</span></div>
  615. <div class="line"><a name="l00961"></a><span class="lineno"> 961</span>&#160;<span class="preprocessor"></span></div>
  616. <div class="line"><a name="l00962"></a><span class="lineno"> 962</span>&#160;<span class="preprocessor">#if defined(__LINUX_PULSE__)</span></div>
  617. <div class="line"><a name="l00963"></a><span class="lineno"> 963</span>&#160;<span class="preprocessor"></span></div>
  618. <div class="line"><a name="l00964"></a><span class="lineno"> 964</span>&#160;<span class="keyword">class </span>RtApiPulse: <span class="keyword">public</span> RtApi</div>
  619. <div class="line"><a name="l00965"></a><span class="lineno"> 965</span>&#160;{</div>
  620. <div class="line"><a name="l00966"></a><span class="lineno"> 966</span>&#160;<span class="keyword">public</span>:</div>
  621. <div class="line"><a name="l00967"></a><span class="lineno"> 967</span>&#160; ~RtApiPulse();</div>
  622. <div class="line"><a name="l00968"></a><span class="lineno"> 968</span>&#160; <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> <a class="code" href="classRtAudio.html#a83687634795792b2c47e4ae1cf8a5246" title="Returns the audio API specifier for the current instance of RtAudio.">getCurrentApi</a>() { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849adc17dff310e85d303fb326c837c08d77">RtAudio::LINUX_PULSE</a>; }</div>
  623. <div class="line"><a name="l00969"></a><span class="lineno"> 969</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">getDeviceCount</a>( <span class="keywordtype">void</span> );</div>
  624. <div class="line"><a name="l00970"></a><span class="lineno"> 970</span>&#160; <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> <a class="code" href="classRtAudio.html#a02d7ff44ad1d7eae22283a052f3dfda8" title="Return an RtAudio::DeviceInfo structure for a specified device number.">getDeviceInfo</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device );</div>
  625. <div class="line"><a name="l00971"></a><span class="lineno"> 971</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a90d599002ad32cf250a4cb866f2cc93a" title="A function that closes a stream and frees any associated stream memory.">closeStream</a>( <span class="keywordtype">void</span> );</div>
  626. <div class="line"><a name="l00972"></a><span class="lineno"> 972</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#aec017a89629ccef66a90b60be22a2f80" title="A function that starts a stream.">startStream</a>( <span class="keywordtype">void</span> );</div>
  627. <div class="line"><a name="l00973"></a><span class="lineno"> 973</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#af4c241ff86936ecc8108f0d9dfe3efdd" title="Stop a stream, allowing any samples remaining in the output queue to be played.">stopStream</a>( <span class="keywordtype">void</span> );</div>
  628. <div class="line"><a name="l00974"></a><span class="lineno"> 974</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#ad0586b47cd6bb9591a80b4052815991f" title="Stop a stream, discarding any samples remaining in the input/output queue.">abortStream</a>( <span class="keywordtype">void</span> );</div>
  629. <div class="line"><a name="l00975"></a><span class="lineno"> 975</span>&#160;</div>
  630. <div class="line"><a name="l00976"></a><span class="lineno"> 976</span>&#160; <span class="comment">// This function is intended for internal use only. It must be</span></div>
  631. <div class="line"><a name="l00977"></a><span class="lineno"> 977</span>&#160; <span class="comment">// public because it is called by the internal callback handler,</span></div>
  632. <div class="line"><a name="l00978"></a><span class="lineno"> 978</span>&#160; <span class="comment">// which is not a member of RtAudio. External use of this function</span></div>
  633. <div class="line"><a name="l00979"></a><span class="lineno"> 979</span>&#160; <span class="comment">// will most likely produce highly undesireable results!</span></div>
  634. <div class="line"><a name="l00980"></a><span class="lineno"> 980</span>&#160; <span class="keywordtype">void</span> callbackEvent( <span class="keywordtype">void</span> );</div>
  635. <div class="line"><a name="l00981"></a><span class="lineno"> 981</span>&#160;</div>
  636. <div class="line"><a name="l00982"></a><span class="lineno"> 982</span>&#160; <span class="keyword">private</span>:</div>
  637. <div class="line"><a name="l00983"></a><span class="lineno"> 983</span>&#160;</div>
  638. <div class="line"><a name="l00984"></a><span class="lineno"> 984</span>&#160; std::vector&lt;RtAudio::DeviceInfo&gt; devices_;</div>
  639. <div class="line"><a name="l00985"></a><span class="lineno"> 985</span>&#160; <span class="keywordtype">void</span> saveDeviceInfo( <span class="keywordtype">void</span> );</div>
  640. <div class="line"><a name="l00986"></a><span class="lineno"> 986</span>&#160; <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels,</div>
  641. <div class="line"><a name="l00987"></a><span class="lineno"> 987</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate,</div>
  642. <div class="line"><a name="l00988"></a><span class="lineno"> 988</span>&#160; <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize,</div>
  643. <div class="line"><a name="l00989"></a><span class="lineno"> 989</span>&#160; <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options );</div>
  644. <div class="line"><a name="l00990"></a><span class="lineno"> 990</span>&#160;};</div>
  645. <div class="line"><a name="l00991"></a><span class="lineno"> 991</span>&#160;</div>
  646. <div class="line"><a name="l00992"></a><span class="lineno"> 992</span>&#160;<span class="preprocessor">#endif</span></div>
  647. <div class="line"><a name="l00993"></a><span class="lineno"> 993</span>&#160;<span class="preprocessor"></span></div>
  648. <div class="line"><a name="l00994"></a><span class="lineno"> 994</span>&#160;<span class="preprocessor">#if defined(__LINUX_OSS__)</span></div>
  649. <div class="line"><a name="l00995"></a><span class="lineno"> 995</span>&#160;<span class="preprocessor"></span></div>
  650. <div class="line"><a name="l00996"></a><span class="lineno"> 996</span>&#160;<span class="keyword">class </span>RtApiOss: <span class="keyword">public</span> RtApi</div>
  651. <div class="line"><a name="l00997"></a><span class="lineno"> 997</span>&#160;{</div>
  652. <div class="line"><a name="l00998"></a><span class="lineno"> 998</span>&#160;<span class="keyword">public</span>:</div>
  653. <div class="line"><a name="l00999"></a><span class="lineno"> 999</span>&#160;</div>
  654. <div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>&#160; RtApiOss();</div>
  655. <div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>&#160; ~RtApiOss();</div>
  656. <div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>&#160; <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> <a class="code" href="classRtAudio.html#a83687634795792b2c47e4ae1cf8a5246" title="Returns the audio API specifier for the current instance of RtAudio.">getCurrentApi</a>() { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a39c84615e61de75e6a4e865596d62c82">RtAudio::LINUX_OSS</a>; }</div>
  657. <div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">getDeviceCount</a>( <span class="keywordtype">void</span> );</div>
  658. <div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>&#160; <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> <a class="code" href="classRtAudio.html#a02d7ff44ad1d7eae22283a052f3dfda8" title="Return an RtAudio::DeviceInfo structure for a specified device number.">getDeviceInfo</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device );</div>
  659. <div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a90d599002ad32cf250a4cb866f2cc93a" title="A function that closes a stream and frees any associated stream memory.">closeStream</a>( <span class="keywordtype">void</span> );</div>
  660. <div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#aec017a89629ccef66a90b60be22a2f80" title="A function that starts a stream.">startStream</a>( <span class="keywordtype">void</span> );</div>
  661. <div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#af4c241ff86936ecc8108f0d9dfe3efdd" title="Stop a stream, allowing any samples remaining in the output queue to be played.">stopStream</a>( <span class="keywordtype">void</span> );</div>
  662. <div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#ad0586b47cd6bb9591a80b4052815991f" title="Stop a stream, discarding any samples remaining in the input/output queue.">abortStream</a>( <span class="keywordtype">void</span> );</div>
  663. <div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>&#160;</div>
  664. <div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>&#160; <span class="comment">// This function is intended for internal use only. It must be</span></div>
  665. <div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>&#160; <span class="comment">// public because it is called by the internal callback handler,</span></div>
  666. <div class="line"><a name="l01012"></a><span class="lineno"> 1012</span>&#160; <span class="comment">// which is not a member of RtAudio. External use of this function</span></div>
  667. <div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>&#160; <span class="comment">// will most likely produce highly undesireable results!</span></div>
  668. <div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>&#160; <span class="keywordtype">void</span> callbackEvent( <span class="keywordtype">void</span> );</div>
  669. <div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>&#160;</div>
  670. <div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>&#160; <span class="keyword">private</span>:</div>
  671. <div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>&#160;</div>
  672. <div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>&#160; <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, </div>
  673. <div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate,</div>
  674. <div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>&#160; <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize,</div>
  675. <div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>&#160; <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options );</div>
  676. <div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>&#160;};</div>
  677. <div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>&#160;</div>
  678. <div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>&#160;<span class="preprocessor">#endif</span></div>
  679. <div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>&#160;<span class="preprocessor"></span></div>
  680. <div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>&#160;<span class="preprocessor">#if defined(__RTAUDIO_DUMMY__)</span></div>
  681. <div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>&#160;<span class="preprocessor"></span></div>
  682. <div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>&#160;<span class="keyword">class </span>RtApiDummy: <span class="keyword">public</span> RtApi</div>
  683. <div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>&#160;{</div>
  684. <div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>&#160;<span class="keyword">public</span>:</div>
  685. <div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>&#160;</div>
  686. <div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>&#160; RtApiDummy() { errorText_ = <span class="stringliteral">&quot;RtApiDummy: This class provides no functionality.&quot;</span>; error( <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca3a1603c24a56cbdaf5f8ae4ddcb86398">RtError::WARNING</a> ); }</div>
  687. <div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>&#160; <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> <a class="code" href="classRtAudio.html#a83687634795792b2c47e4ae1cf8a5246" title="Returns the audio API specifier for the current instance of RtAudio.">getCurrentApi</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849ab06b8fd88bf18c9a2b8271f6961ae2d1">RtAudio::RTAUDIO_DUMMY</a>; }</div>
  688. <div class="line"><a name="l01034"></a><span class="lineno"> 1034</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">getDeviceCount</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> 0; }</div>
  689. <div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>&#160; <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> <a class="code" href="classRtAudio.html#a02d7ff44ad1d7eae22283a052f3dfda8" title="Return an RtAudio::DeviceInfo structure for a specified device number.">getDeviceInfo</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <span class="comment">/*device*/</span> ) { <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> info; <span class="keywordflow">return</span> info; }</div>
  690. <div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a90d599002ad32cf250a4cb866f2cc93a" title="A function that closes a stream and frees any associated stream memory.">closeStream</a>( <span class="keywordtype">void</span> ) {}</div>
  691. <div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#aec017a89629ccef66a90b60be22a2f80" title="A function that starts a stream.">startStream</a>( <span class="keywordtype">void</span> ) {}</div>
  692. <div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#af4c241ff86936ecc8108f0d9dfe3efdd" title="Stop a stream, allowing any samples remaining in the output queue to be played.">stopStream</a>( <span class="keywordtype">void</span> ) {}</div>
  693. <div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#ad0586b47cd6bb9591a80b4052815991f" title="Stop a stream, discarding any samples remaining in the input/output queue.">abortStream</a>( <span class="keywordtype">void</span> ) {}</div>
  694. <div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>&#160;</div>
  695. <div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>&#160; <span class="keyword">private</span>:</div>
  696. <div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>&#160;</div>
  697. <div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>&#160; <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <span class="comment">/*device*/</span>, StreamMode <span class="comment">/*mode*/</span>, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <span class="comment">/*channels*/</span>, </div>
  698. <div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <span class="comment">/*firstChannel*/</span>, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <span class="comment">/*sampleRate*/</span>,</div>
  699. <div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>&#160; <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> <span class="comment">/*format*/</span>, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> * <span class="comment">/*bufferSize*/</span>,</div>
  700. <div class="line"><a name="l01046"></a><span class="lineno"> 1046</span>&#160; <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> * <span class="comment">/*options*/</span> ) { <span class="keywordflow">return</span> <span class="keyword">false</span>; }</div>
  701. <div class="line"><a name="l01047"></a><span class="lineno"> 1047</span>&#160;};</div>
  702. <div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>&#160;</div>
  703. <div class="line"><a name="l01049"></a><span class="lineno"> 1049</span>&#160;<span class="preprocessor">#endif</span></div>
  704. <div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>&#160;<span class="preprocessor"></span></div>
  705. <div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>&#160;<span class="preprocessor">#endif</span></div>
  706. <div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>&#160;<span class="preprocessor"></span></div>
  707. <div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>&#160;<span class="comment">// Indentation settings for Vim and Emacs</span></div>
  708. <div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>&#160;<span class="comment">//</span></div>
  709. <div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>&#160;<span class="comment">// Local Variables:</span></div>
  710. <div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>&#160;<span class="comment">// c-basic-offset: 2</span></div>
  711. <div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>&#160;<span class="comment">// indent-tabs-mode: nil</span></div>
  712. <div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>&#160;<span class="comment">// End:</span></div>
  713. <div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>&#160;<span class="comment">//</span></div>
  714. <div class="line"><a name="l01060"></a><span class="lineno"> 1060</span>&#160;<span class="comment">// vim: et sts=2 sw=2</span></div>
  715. </div><!-- fragment --></div><!-- contents -->
  716. <HR>
  717. <table><tr><td><img src="../images/mcgill.gif" width=165></td>
  718. <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>
  719. </table>
  720. </BODY>
  721. </HTML>