mirror of
https://github.com/thestk/stk
synced 2026-01-14 21:41:53 +00:00
118 lines
7.9 KiB
HTML
118 lines
7.9 KiB
HTML
<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"><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="tutorial.html">Tutorial</a></CENTER>
|
|
<HR>
|
|
<!-- Generated by Doxygen 1.2.8.1 -->
|
|
<h1>WvOut.h</h1><div class="fragment"><pre>00001 <font class="comment">/***************************************************/</font>
|
|
00034 <font class="comment">/***************************************************/</font>
|
|
00035
|
|
00036 <font class="preprocessor">#if !defined(__WVOUT_H)</font>
|
|
00037 <font class="preprocessor"></font><font class="preprocessor">#define __WVOUT_H</font>
|
|
00038 <font class="preprocessor"></font>
|
|
00039 <font class="preprocessor">#include "Stk.h"</font>
|
|
00040 <font class="preprocessor">#include <stdio.h></font>
|
|
00041
|
|
00042 <font class="preprocessor">#define BUFFER_SIZE 1024 // sample frames</font>
|
|
00043 <font class="preprocessor"></font>
|
|
00044 <font class="keyword">class </font><a class="code" href="classWvOut.html">WvOut</a> : <font class="keyword">public</font> <a class="code" href="classStk.html">Stk</a>
|
|
00045 {
|
|
00046 <font class="keyword">public</font>:
|
|
00047
|
|
00048 <font class="keyword">typedef</font> <font class="keywordtype">unsigned</font> <font class="keywordtype">long</font> FILE_TYPE;
|
|
00049
|
|
<a name="l00050"></a><a class="code" href="classWvOut.html#p0">00050</a> <font class="keyword">static</font> <font class="keyword">const</font> FILE_TYPE WVOUT_RAW;
|
|
<a name="l00051"></a><a class="code" href="classWvOut.html#p1">00051</a> <font class="keyword">static</font> <font class="keyword">const</font> FILE_TYPE WVOUT_WAV;
|
|
<a name="l00052"></a><a class="code" href="classWvOut.html#p2">00052</a> <font class="keyword">static</font> <font class="keyword">const</font> FILE_TYPE WVOUT_SND;
|
|
<a name="l00053"></a><a class="code" href="classWvOut.html#p3">00053</a> <font class="keyword">static</font> <font class="keyword">const</font> FILE_TYPE WVOUT_AIF;
|
|
<a name="l00054"></a><a class="code" href="classWvOut.html#p4">00054</a> <font class="keyword">static</font> <font class="keyword">const</font> FILE_TYPE WVOUT_MAT;
|
|
00055
|
|
00057 <a class="code" href="classWvOut.html#a0">WvOut</a>();
|
|
00058
|
|
00060
|
|
00063 <a class="code" href="classWvOut.html#a0">WvOut</a>( <font class="keyword">const</font> <font class="keywordtype">char</font> *fileName, <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> nChannels = 1, FILE_TYPE type = WVOUT_WAV, Stk::STK_FORMAT format = STK_SINT16 );
|
|
00064
|
|
00066 <font class="keyword">virtual</font> <a class="code" href="classWvOut.html#a2">~WvOut</a>();
|
|
00067
|
|
00069
|
|
00072 <font class="keywordtype">void</font> <a class="code" href="classWvOut.html#a3">openFile</a>( <font class="keyword">const</font> <font class="keywordtype">char</font> *fileName, <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> nChannels = 1,
|
|
00073 WvOut::FILE_TYPE type = WVOUT_WAV, Stk::STK_FORMAT format = STK_SINT16 );
|
|
00074
|
|
00076 <font class="keywordtype">void</font> <a class="code" href="classWvOut.html#a4">closeFile</a>( <font class="keywordtype">void</font> );
|
|
00077
|
|
00079 <font class="keywordtype">unsigned</font> <font class="keywordtype">long</font> <a class="code" href="classWvOut.html#a5">getFrames</a>( <font class="keywordtype">void</font> ) <font class="keyword">const</font>;
|
|
00080
|
|
00082 MY_FLOAT <a class="code" href="classWvOut.html#a6">getTime</a>( <font class="keywordtype">void</font> ) <font class="keyword">const</font>;
|
|
00083
|
|
00085
|
|
00088 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classWvOut.html#a7">tick</a>(<font class="keyword">const</font> MY_FLOAT sample);
|
|
00089
|
|
00091
|
|
00094 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classWvOut.html#a7">tick</a>(<font class="keyword">const</font> MY_FLOAT *vector, <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> vectorSize);
|
|
00095
|
|
00097
|
|
00100 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classWvOut.html#a9">tickFrame</a>(<font class="keyword">const</font> MY_FLOAT *frameVector, <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> frames = 1);
|
|
00101
|
|
00102 <font class="keyword">protected</font>:
|
|
00103
|
|
00104 <font class="comment">// Initialize class variables.</font>
|
|
00105 <font class="keywordtype">void</font> init( <font class="keywordtype">void</font> );
|
|
00106
|
|
00107 <font class="comment">// Write data to output file;</font>
|
|
00108 <font class="keyword">virtual</font> <font class="keywordtype">void</font> writeData( <font class="keywordtype">unsigned</font> <font class="keywordtype">long</font> frames );
|
|
00109
|
|
00110 <font class="comment">// Write STK RAW file header.</font>
|
|
00111 <font class="keywordtype">bool</font> setRawFile( <font class="keyword">const</font> <font class="keywordtype">char</font> *fileName );
|
|
00112
|
|
00113 <font class="comment">// Write WAV file header.</font>
|
|
00114 <font class="keywordtype">bool</font> setWavFile( <font class="keyword">const</font> <font class="keywordtype">char</font> *fileName );
|
|
00115
|
|
00116 <font class="comment">// Close WAV file, updating the header.</font>
|
|
00117 <font class="keywordtype">void</font> closeWavFile( <font class="keywordtype">void</font> );
|
|
00118
|
|
00119 <font class="comment">// Write SND (AU) file header.</font>
|
|
00120 <font class="keywordtype">bool</font> setSndFile( <font class="keyword">const</font> <font class="keywordtype">char</font> *fileName );
|
|
00121
|
|
00122 <font class="comment">// Close SND file, updating the header.</font>
|
|
00123 <font class="keywordtype">void</font> closeSndFile( <font class="keywordtype">void</font> );
|
|
00124
|
|
00125 <font class="comment">// Write AIFF file header.</font>
|
|
00126 <font class="keywordtype">bool</font> setAifFile( <font class="keyword">const</font> <font class="keywordtype">char</font> *fileName );
|
|
00127
|
|
00128 <font class="comment">// Close AIFF file, updating the header.</font>
|
|
00129 <font class="keywordtype">void</font> closeAifFile( <font class="keywordtype">void</font> );
|
|
00130
|
|
00131 <font class="comment">// Write MAT-file header.</font>
|
|
00132 <font class="keywordtype">bool</font> setMatFile( <font class="keyword">const</font> <font class="keywordtype">char</font> *fileName );
|
|
00133
|
|
00134 <font class="comment">// Close MAT-file, updating the header.</font>
|
|
00135 <font class="keywordtype">void</font> closeMatFile( <font class="keywordtype">void</font> );
|
|
00136
|
|
00137 <font class="keywordtype">char</font> msg[256];
|
|
00138 FILE *fd;
|
|
00139 MY_FLOAT *data;
|
|
00140 FILE_TYPE fileType;
|
|
00141 STK_FORMAT dataType;
|
|
00142 <font class="keywordtype">bool</font> byteswap;
|
|
00143 <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> channels;
|
|
00144 <font class="keywordtype">unsigned</font> <font class="keywordtype">long</font> counter;
|
|
00145 <font class="keywordtype">unsigned</font> <font class="keywordtype">long</font> totalCount;
|
|
00146
|
|
00147 };
|
|
00148
|
|
00149 <font class="preprocessor">#endif // defined(__WVOUT_H)</font>
|
|
</font></pre></div><HR>
|
|
|
|
<table>
|
|
<tr><td><A HREF="http://www-ccrma.stanford.edu/software/stk/"><I>The Synthesis ToolKit in C++ (STK)</I></A></td></tr>
|
|
<tr><td>©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
|
</table>
|
|
|
|
</BODY>
|
|
</HTML>
|