1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
|
<HTML>
<HEAD>
<TITLE>The Synthesis ToolKit in C++ (STK)</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<img src="princeton.gif"> <img src="ccrma.gif"> <img src="mcgill.gif"><P>
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="information.html">Information</a> <a class="qindex" href="classes.html">Classes</a> <a class="qindex" href="download.html">Download</a> <a class="qindex" href="usage.html">Usage</a> <a class="qindex" href="maillist.html">Mail List</a> <a class="qindex" href="system.html">Requirements</a> <a class="qindex" href="links.html">Links</a> <a class="qindex" href="faq.html">FAQ</a> <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
<HR>
<!-- Generated by Doxygen 1.6.2 -->
<div class="navpath"><a class="el" href="dir_221deb9bdff892d63ed1e409450a60d2.html">include</a>
</div>
<div class="contents">
<h1>RtWvOut.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef STK_RTWVOUT_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define STK_RTWVOUT_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include "WvOut.h"</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include "<a class="code" href="RtAudio_8h.html">RtAudio.h</a>"</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include "Mutex.h"</span>
<a name="l00007"></a>00007
<a name="l00008"></a>00008 <span class="keyword">namespace </span>stk {
<a name="l00009"></a>00009
<a name="l00010"></a>00010 <span class="comment">/***************************************************/</span>
<a name="l00028"></a>00028 <span class="comment">/***************************************************/</span>
<a name="l00029"></a>00029
<a name="l00030"></a><a class="code" href="classstk_1_1RtWvOut.html">00030</a> <span class="keyword">class </span><a class="code" href="classstk_1_1RtWvOut.html" title="STK realtime audio (blocking) output class.">RtWvOut</a> : <span class="keyword">public</span> <a class="code" href="classstk_1_1WvOut.html" title="STK audio output abstract base class.">WvOut</a>
<a name="l00031"></a>00031 {
<a name="l00032"></a>00032 <span class="keyword">public</span>:
<a name="l00033"></a>00033
<a name="l00035"></a>00035
<a name="l00042"></a>00042 <a class="code" href="classstk_1_1RtWvOut.html#af2ee408eb10a0dbf9e14407b34f2181e" title="Default constructor.">RtWvOut</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nChannels = 1, StkFloat <a class="code" href="classstk_1_1Stk.html#a5fbe37000a611ce56075ee7d8936472d" title="Static method that returns the current STK sample rate.">sampleRate</a> = <a class="code" href="classstk_1_1Stk.html#a5fbe37000a611ce56075ee7d8936472d" title="Static method that returns the current STK sample rate.">Stk::sampleRate</a>(),
<a name="l00043"></a>00043 <span class="keywordtype">int</span> device = 0, <span class="keywordtype">int</span> bufferFrames = RT_BUFFER_SIZE, <span class="keywordtype">int</span> nBuffers = 20 );
<a name="l00044"></a>00044
<a name="l00046"></a>00046 <a class="code" href="classstk_1_1RtWvOut.html#a85b2e30c6a153c959a33ec4aae528ca2" title="Class destructor.">~RtWvOut</a>();
<a name="l00047"></a>00047
<a name="l00049"></a>00049
<a name="l00053"></a>00053 <span class="keywordtype">void</span> <a class="code" href="classstk_1_1RtWvOut.html#a2e34c9ff845155230e0336ea3729dc45" title="Start the audio output stream.">start</a>( <span class="keywordtype">void</span> );
<a name="l00054"></a>00054
<a name="l00056"></a>00056
<a name="l00060"></a>00060 <span class="keywordtype">void</span> <a class="code" href="classstk_1_1RtWvOut.html#a7368c42b81670c0335b25f14faa08918" title="Stop the audio output stream.">stop</a>( <span class="keywordtype">void</span> );
<a name="l00061"></a>00061
<a name="l00063"></a>00063
<a name="l00066"></a>00066 <span class="keywordtype">void</span> <a class="code" href="classstk_1_1RtWvOut.html#a02adabdc987f3b9ac4dc4e02ea20962d" title="Output a single sample to all channels in a sample frame.">tick</a>( <span class="keyword">const</span> StkFloat sample );
<a name="l00067"></a>00067
<a name="l00069"></a>00069
<a name="l00076"></a>00076 <span class="keywordtype">void</span> <a class="code" href="classstk_1_1RtWvOut.html#a02adabdc987f3b9ac4dc4e02ea20962d" title="Output a single sample to all channels in a sample frame.">tick</a>( <span class="keyword">const</span> <a class="code" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a>& frames );
<a name="l00077"></a>00077
<a name="l00078"></a>00078 <span class="comment">// This function is not intended for general use but must be</span>
<a name="l00079"></a>00079 <span class="comment">// public for access from the audio callback function.</span>
<a name="l00080"></a>00080 <span class="keywordtype">int</span> readBuffer( <span class="keywordtype">void</span> *buffer, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> frameCount );
<a name="l00081"></a>00081
<a name="l00082"></a>00082 <span class="keyword">protected</span>:
<a name="l00083"></a>00083
<a name="l00084"></a>00084 <a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> dac_;
<a name="l00085"></a>00085 <a class="code" href="classstk_1_1Mutex.html" title="STK mutex class.">Mutex</a> mutex_;
<a name="l00086"></a>00086 <span class="keywordtype">bool</span> stopped_;
<a name="l00087"></a>00087 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> readIndex_;
<a name="l00088"></a>00088 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> writeIndex_;
<a name="l00089"></a>00089 <span class="keywordtype">long</span> framesFilled_;
<a name="l00090"></a>00090 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> status_; <span class="comment">// running = 0, emptying buffer = 1, finished = 2</span>
<a name="l00091"></a>00091
<a name="l00092"></a>00092 };
<a name="l00093"></a>00093
<a name="l00094"></a>00094 } <span class="comment">// stk namespace</span>
<a name="l00095"></a>00095
<a name="l00096"></a>00096 <span class="preprocessor">#endif</span>
</pre></div></div>
<HR>
<table>
<tr><td><A HREF="http://ccrma.stanford.edu/software/stk/"><I>The Synthesis ToolKit in C++ (STK)</I></A></td></tr>
<tr><td>©1995-2012 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
</table>
</BODY>
</HTML>
|