mirror of
https://github.com/thestk/stk
synced 2026-01-18 23:21:53 +00:00
Release 4.4.3 tarball
This commit is contained in:
committed by
Stephen Sinclair
parent
cfdfe7736a
commit
f13d5bb3cd
@@ -9,7 +9,7 @@
|
||||
<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_ca1e4533604ab7cb0cdaaff730a9c38f.html">include</a>
|
||||
<div class="navpath"><a class="el" href="dir_f14fd23bc74c76f288031ad23b3f3505.html">include</a>
|
||||
</div>
|
||||
<div class="contents">
|
||||
<h1>FileWvIn.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef STK_FILEWVIN_H</span>
|
||||
@@ -52,65 +52,67 @@
|
||||
<a name="l00095"></a>00095
|
||||
<a name="l00100"></a><a class="code" href="classstk_1_1FileWvIn.html#a867b7b7fdb60e5194e25d7a85a26ec0b">00100</a> <span class="keyword">virtual</span> StkFloat <a class="code" href="classstk_1_1FileWvIn.html#a867b7b7fdb60e5194e25d7a85a26ec0b" title="Return the input file sample rate in Hz (not the data read rate).">getFileRate</a>( <span class="keywordtype">void</span> )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> data_.<a class="code" href="classstk_1_1StkFrames.html#a4dbbcbdc8db39a803e0861976f7f3522" title="Return the sample rate associated with the StkFrames data.">dataRate</a>(); };
|
||||
<a name="l00101"></a>00101
|
||||
<a name="l00103"></a><a class="code" href="classstk_1_1FileWvIn.html#aca9ad0c12af3323e7bbf877513b0d10b">00103</a> <span class="keywordtype">bool</span> <a class="code" href="classstk_1_1FileWvIn.html#aca9ad0c12af3323e7bbf877513b0d10b" title="Query whether reading is complete.">isFinished</a>( <span class="keywordtype">void</span> )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> finished_; };
|
||||
<a name="l00103"></a><a class="code" href="classstk_1_1FileWvIn.html#aa45344366bca49f71c7153ac5b296e91">00103</a> <span class="keywordtype">bool</span> <a class="code" href="classstk_1_1FileWvIn.html#aa45344366bca49f71c7153ac5b296e91" title="Query whether a file is open.">isOpen</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> file_.<a class="code" href="classstk_1_1FileRead.html#a3f30ed2a9f45493f0369aa2edbf38f70" title="Returns true if a file is currently open.">isOpen</a>(); };
|
||||
<a name="l00104"></a>00104
|
||||
<a name="l00106"></a>00106
|
||||
<a name="l00109"></a>00109 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classstk_1_1FileWvIn.html#aacd97ad5f30f9cdc8201b4244aa69901" title="Set the data read rate in samples. The rate can be negative.">setRate</a>( StkFloat rate );
|
||||
<a name="l00110"></a>00110
|
||||
<a name="l00112"></a>00112
|
||||
<a name="l00115"></a>00115 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classstk_1_1FileWvIn.html#ab2ccf7cc65c36a1ecfbb3b7d5707ea48" title="Increment the read pointer by time samples.">addTime</a>( StkFloat time );
|
||||
<a name="l00116"></a>00116
|
||||
<a name="l00118"></a>00118
|
||||
<a name="l00124"></a><a class="code" href="classstk_1_1FileWvIn.html#a129c1e0b51497e6b09ad6aa37ad4d969">00124</a> <span class="keywordtype">void</span> <a class="code" href="classstk_1_1FileWvIn.html#a129c1e0b51497e6b09ad6aa37ad4d969" title="Turn linear interpolation on/off.">setInterpolate</a>( <span class="keywordtype">bool</span> doInterpolate ) { interpolate_ = doInterpolate; };
|
||||
<a name="l00125"></a>00125
|
||||
<a name="l00127"></a>00127
|
||||
<a name="l00136"></a>00136 StkFloat <a class="code" href="classstk_1_1FileWvIn.html#ad17c12e8d51f90f59f0d0c9f6d626608" title="Return the specified channel value of the last computed frame.">lastOut</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channel = 0 );
|
||||
<a name="l00137"></a>00137
|
||||
<a name="l00139"></a>00139
|
||||
<a name="l00148"></a>00148 <span class="keyword">virtual</span> StkFloat <a class="code" href="classstk_1_1FileWvIn.html#ada668a0bc0bf89e155ef341de00babc2" title="Compute a sample frame and return the specified channel value.">tick</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channel = 0 );
|
||||
<a name="l00149"></a>00149
|
||||
<a name="l00151"></a>00151
|
||||
<a name="l00159"></a>00159 <span class="keyword">virtual</span> <a class="code" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a>& <a class="code" href="classstk_1_1FileWvIn.html#ada668a0bc0bf89e155ef341de00babc2" title="Compute a sample frame and return the specified channel value.">tick</a>( <a class="code" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a>& frames );
|
||||
<a name="l00160"></a>00160
|
||||
<a name="l00161"></a>00161 <span class="keyword">protected</span>:
|
||||
<a name="l00162"></a>00162
|
||||
<a name="l00163"></a>00163 <span class="keywordtype">void</span> sampleRateChanged( StkFloat newRate, StkFloat oldRate );
|
||||
<a name="l00164"></a>00164
|
||||
<a name="l00165"></a>00165 <a class="code" href="classstk_1_1FileRead.html" title="STK audio file input class.">FileRead</a> file_;
|
||||
<a name="l00166"></a>00166 <span class="keywordtype">bool</span> finished_;
|
||||
<a name="l00167"></a>00167 <span class="keywordtype">bool</span> interpolate_;
|
||||
<a name="l00168"></a>00168 <span class="keywordtype">bool</span> normalizing_;
|
||||
<a name="l00169"></a>00169 <span class="keywordtype">bool</span> chunking_;
|
||||
<a name="l00170"></a>00170 StkFloat time_;
|
||||
<a name="l00171"></a>00171 StkFloat rate_;
|
||||
<a name="l00172"></a>00172 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> chunkThreshold_;
|
||||
<a name="l00173"></a>00173 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> chunkSize_;
|
||||
<a name="l00174"></a>00174 <span class="keywordtype">long</span> chunkPointer_;
|
||||
<a name="l00175"></a>00175
|
||||
<a name="l00176"></a>00176 };
|
||||
<a name="l00177"></a>00177
|
||||
<a name="l00178"></a><a class="code" href="classstk_1_1FileWvIn.html#ad17c12e8d51f90f59f0d0c9f6d626608">00178</a> <span class="keyword">inline</span> StkFloat <a class="code" href="classstk_1_1FileWvIn.html#ad17c12e8d51f90f59f0d0c9f6d626608" title="Return the specified channel value of the last computed frame.">FileWvIn :: lastOut</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channel )
|
||||
<a name="l00179"></a>00179 {
|
||||
<a name="l00180"></a>00180 <span class="preprocessor">#if defined(_STK_DEBUG_)</span>
|
||||
<a name="l00181"></a>00181 <span class="preprocessor"></span> <span class="keywordflow">if</span> ( channel >= data_.<a class="code" href="classstk_1_1StkFrames.html#aec7ef9c46675a24111aa6e2fda3ba870" title="Return the number of channels represented by the data.">channels</a>() ) {
|
||||
<a name="l00182"></a>00182 errorString_ << <span class="stringliteral">"FileWvIn::lastOut(): channel argument and soundfile data are incompatible!"</span>;
|
||||
<a name="l00183"></a>00183 <a class="code" href="classstk_1_1Stk.html#a48ac73a0d8ca28445ba1a054e1f061ff" title="Static function for error reporting and handling using c-strings.">handleError</a>( StkError::FUNCTION_ARGUMENT );
|
||||
<a name="l00184"></a>00184 }
|
||||
<a name="l00185"></a>00185 <span class="preprocessor">#endif</span>
|
||||
<a name="l00186"></a>00186 <span class="preprocessor"></span>
|
||||
<a name="l00187"></a>00187 <span class="keywordflow">if</span> ( finished_ ) <span class="keywordflow">return</span> 0.0;
|
||||
<a name="l00188"></a>00188 <span class="keywordflow">return</span> lastFrame_[channel];
|
||||
<a name="l00189"></a>00189 }
|
||||
<a name="l00190"></a>00190
|
||||
<a name="l00191"></a>00191 } <span class="comment">// stk namespace</span>
|
||||
<a name="l00192"></a>00192
|
||||
<a name="l00193"></a>00193 <span class="preprocessor">#endif</span>
|
||||
<a name="l00106"></a><a class="code" href="classstk_1_1FileWvIn.html#aca9ad0c12af3323e7bbf877513b0d10b">00106</a> <span class="keywordtype">bool</span> <a class="code" href="classstk_1_1FileWvIn.html#aca9ad0c12af3323e7bbf877513b0d10b" title="Query whether reading is complete.">isFinished</a>( <span class="keywordtype">void</span> )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> finished_; };
|
||||
<a name="l00107"></a>00107
|
||||
<a name="l00109"></a>00109
|
||||
<a name="l00112"></a>00112 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classstk_1_1FileWvIn.html#aacd97ad5f30f9cdc8201b4244aa69901" title="Set the data read rate in samples. The rate can be negative.">setRate</a>( StkFloat rate );
|
||||
<a name="l00113"></a>00113
|
||||
<a name="l00115"></a>00115
|
||||
<a name="l00118"></a>00118 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classstk_1_1FileWvIn.html#ab2ccf7cc65c36a1ecfbb3b7d5707ea48" title="Increment the read pointer by time samples.">addTime</a>( StkFloat time );
|
||||
<a name="l00119"></a>00119
|
||||
<a name="l00121"></a>00121
|
||||
<a name="l00127"></a><a class="code" href="classstk_1_1FileWvIn.html#a129c1e0b51497e6b09ad6aa37ad4d969">00127</a> <span class="keywordtype">void</span> <a class="code" href="classstk_1_1FileWvIn.html#a129c1e0b51497e6b09ad6aa37ad4d969" title="Turn linear interpolation on/off.">setInterpolate</a>( <span class="keywordtype">bool</span> doInterpolate ) { interpolate_ = doInterpolate; };
|
||||
<a name="l00128"></a>00128
|
||||
<a name="l00130"></a>00130
|
||||
<a name="l00139"></a>00139 StkFloat <a class="code" href="classstk_1_1FileWvIn.html#ad17c12e8d51f90f59f0d0c9f6d626608" title="Return the specified channel value of the last computed frame.">lastOut</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channel = 0 );
|
||||
<a name="l00140"></a>00140
|
||||
<a name="l00142"></a>00142
|
||||
<a name="l00151"></a>00151 <span class="keyword">virtual</span> StkFloat <a class="code" href="classstk_1_1FileWvIn.html#ada668a0bc0bf89e155ef341de00babc2" title="Compute a sample frame and return the specified channel value.">tick</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channel = 0 );
|
||||
<a name="l00152"></a>00152
|
||||
<a name="l00154"></a>00154
|
||||
<a name="l00162"></a>00162 <span class="keyword">virtual</span> <a class="code" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a>& <a class="code" href="classstk_1_1FileWvIn.html#ada668a0bc0bf89e155ef341de00babc2" title="Compute a sample frame and return the specified channel value.">tick</a>( <a class="code" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a>& frames );
|
||||
<a name="l00163"></a>00163
|
||||
<a name="l00164"></a>00164 <span class="keyword">protected</span>:
|
||||
<a name="l00165"></a>00165
|
||||
<a name="l00166"></a>00166 <span class="keywordtype">void</span> sampleRateChanged( StkFloat newRate, StkFloat oldRate );
|
||||
<a name="l00167"></a>00167
|
||||
<a name="l00168"></a>00168 <a class="code" href="classstk_1_1FileRead.html" title="STK audio file input class.">FileRead</a> file_;
|
||||
<a name="l00169"></a>00169 <span class="keywordtype">bool</span> finished_;
|
||||
<a name="l00170"></a>00170 <span class="keywordtype">bool</span> interpolate_;
|
||||
<a name="l00171"></a>00171 <span class="keywordtype">bool</span> normalizing_;
|
||||
<a name="l00172"></a>00172 <span class="keywordtype">bool</span> chunking_;
|
||||
<a name="l00173"></a>00173 StkFloat time_;
|
||||
<a name="l00174"></a>00174 StkFloat rate_;
|
||||
<a name="l00175"></a>00175 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> chunkThreshold_;
|
||||
<a name="l00176"></a>00176 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> chunkSize_;
|
||||
<a name="l00177"></a>00177 <span class="keywordtype">long</span> chunkPointer_;
|
||||
<a name="l00178"></a>00178
|
||||
<a name="l00179"></a>00179 };
|
||||
<a name="l00180"></a>00180
|
||||
<a name="l00181"></a><a class="code" href="classstk_1_1FileWvIn.html#ad17c12e8d51f90f59f0d0c9f6d626608">00181</a> <span class="keyword">inline</span> StkFloat <a class="code" href="classstk_1_1FileWvIn.html#ad17c12e8d51f90f59f0d0c9f6d626608" title="Return the specified channel value of the last computed frame.">FileWvIn :: lastOut</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channel )
|
||||
<a name="l00182"></a>00182 {
|
||||
<a name="l00183"></a>00183 <span class="preprocessor">#if defined(_STK_DEBUG_)</span>
|
||||
<a name="l00184"></a>00184 <span class="preprocessor"></span> <span class="keywordflow">if</span> ( channel >= data_.<a class="code" href="classstk_1_1StkFrames.html#aec7ef9c46675a24111aa6e2fda3ba870" title="Return the number of channels represented by the data.">channels</a>() ) {
|
||||
<a name="l00185"></a>00185 oStream_ << <span class="stringliteral">"FileWvIn::lastOut(): channel argument and soundfile data are incompatible!"</span>;
|
||||
<a name="l00186"></a>00186 <a class="code" href="classstk_1_1Stk.html#a48ac73a0d8ca28445ba1a054e1f061ff" title="Static function for error reporting and handling using c-strings.">handleError</a>( StkError::FUNCTION_ARGUMENT );
|
||||
<a name="l00187"></a>00187 }
|
||||
<a name="l00188"></a>00188 <span class="preprocessor">#endif</span>
|
||||
<a name="l00189"></a>00189 <span class="preprocessor"></span>
|
||||
<a name="l00190"></a>00190 <span class="keywordflow">if</span> ( finished_ ) <span class="keywordflow">return</span> 0.0;
|
||||
<a name="l00191"></a>00191 <span class="keywordflow">return</span> lastFrame_[channel];
|
||||
<a name="l00192"></a>00192 }
|
||||
<a name="l00193"></a>00193
|
||||
<a name="l00194"></a>00194 } <span class="comment">// stk namespace</span>
|
||||
<a name="l00195"></a>00195
|
||||
<a name="l00196"></a>00196 <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-2010 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
||||
<tr><td>©1995-2011 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
||||
</table>
|
||||
|
||||
</BODY>
|
||||
|
||||
Reference in New Issue
Block a user