mirror of
https://github.com/thestk/stk
synced 2026-01-17 06:41:51 +00:00
Release 4.2.0 tarball
This commit is contained in:
committed by
Stephen Sinclair
parent
fe20fe92a2
commit
de344668dd
@@ -12,78 +12,85 @@
|
||||
<h1>TcpWvIn.h</h1><div class="fragment"><pre>00001 <span class="comment">/***************************************************/</span>
|
||||
00027 <span class="comment">/***************************************************/</span>
|
||||
00028
|
||||
00029 <span class="preprocessor">#if !defined(__TCPWVIN_H)</span>
|
||||
00030 <span class="preprocessor"></span><span class="preprocessor">#define __TCPWVIN_H</span>
|
||||
00029 <span class="preprocessor">#ifndef STK_TCPWVIN_H</span>
|
||||
00030 <span class="preprocessor"></span><span class="preprocessor">#define STK_TCPWVIN_H</span>
|
||||
00031 <span class="preprocessor"></span>
|
||||
00032 <span class="preprocessor">#include "WvIn.h"</span>
|
||||
00033 <span class="preprocessor">#include "Socket.h"</span>
|
||||
00034 <span class="preprocessor">#include "Thread.h"</span>
|
||||
00035
|
||||
00036 <span class="keyword">typedef</span> <span class="keyword">struct </span>{
|
||||
00037 <span class="keywordtype">bool</span> finished;
|
||||
00038 <span class="keywordtype">void</span> *object;
|
||||
00039 } thread_info;
|
||||
00040
|
||||
<a name="l00041"></a><a class="code" href="classTcpWvIn.html">00041</a> <span class="keyword">class </span><a class="code" href="classTcpWvIn.html">TcpWvIn</a> : <span class="keyword">protected</span> <a class="code" href="classWvIn.html">WvIn</a>
|
||||
00042 {
|
||||
00043 <span class="keyword">public</span>:
|
||||
00045
|
||||
00048 <a class="code" href="classTcpWvIn.html#a0">TcpWvIn</a>( <span class="keywordtype">int</span> port = 2006 );
|
||||
00049
|
||||
00051 <a class="code" href="classTcpWvIn.html#a1">~TcpWvIn</a>();
|
||||
00052
|
||||
00054
|
||||
00057 <span class="keywordtype">void</span> <a class="code" href="classTcpWvIn.html#a2">listen</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nChannels = 1, Stk::STK_FORMAT format = <a class="code" href="classStk.html#s1">STK_SINT16</a>);
|
||||
00058
|
||||
00060
|
||||
00064 <span class="keywordtype">bool</span> <a class="code" href="classTcpWvIn.html#a3">isConnected</a>(<span class="keywordtype">void</span>);
|
||||
00065
|
||||
00067 MY_FLOAT <a class="code" href="classTcpWvIn.html#a4">lastOut</a>(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
|
||||
00068
|
||||
00070 MY_FLOAT <a class="code" href="classTcpWvIn.html#a5">tick</a>(<span class="keywordtype">void</span>);
|
||||
00071
|
||||
00073 MY_FLOAT *<a class="code" href="classTcpWvIn.html#a5">tick</a>(MY_FLOAT *vector, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> vectorSize);
|
||||
00074
|
||||
00076 <span class="keyword">const</span> MY_FLOAT *<a class="code" href="classTcpWvIn.html#a7">lastFrame</a>(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
|
||||
00035 <span class="preprocessor">#include "Mutex.h"</span>
|
||||
00036
|
||||
00037 <span class="keyword">typedef</span> <span class="keyword">struct </span>{
|
||||
00038 <span class="keywordtype">bool</span> finished;
|
||||
00039 <span class="keywordtype">void</span> *object;
|
||||
00040 } thread_info;
|
||||
00041
|
||||
<a name="l00042"></a><a class="code" href="classTcpWvIn.html">00042</a> <span class="keyword">class </span><a class="code" href="classTcpWvIn.html">TcpWvIn</a> : <span class="keyword">protected</span> <a class="code" href="classWvIn.html">WvIn</a>
|
||||
00043 {
|
||||
00044 <span class="keyword">public</span>:
|
||||
00046
|
||||
00049 <a class="code" href="classTcpWvIn.html#a0">TcpWvIn</a>( <span class="keywordtype">int</span> port = 2006 );
|
||||
00050
|
||||
00052 <a class="code" href="classTcpWvIn.html#a1">~TcpWvIn</a>();
|
||||
00053
|
||||
00055
|
||||
00058 <span class="keywordtype">void</span> <a class="code" href="classTcpWvIn.html#a2">listen</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nChannels = 1, Stk::StkFormat format = <a class="code" href="classStk.html#s1">STK_SINT16</a>);
|
||||
00059
|
||||
00061
|
||||
00065 <span class="keywordtype">bool</span> <a class="code" href="classTcpWvIn.html#a3">isConnected</a>(<span class="keywordtype">void</span>);
|
||||
00066
|
||||
00068 StkFloat <a class="code" href="classTcpWvIn.html#a4">lastOut</a>(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
|
||||
00069
|
||||
00071 StkFloat <a class="code" href="classTcpWvIn.html#a5">tick</a>(<span class="keywordtype">void</span>);
|
||||
00072
|
||||
00074 StkFloat *<a class="code" href="classTcpWvIn.html#a5">tick</a>(StkFloat *vector, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> vectorSize);
|
||||
00075
|
||||
00077
|
||||
00079 <span class="keyword">const</span> MY_FLOAT *<a class="code" href="classTcpWvIn.html#a8">tickFrame</a>(<span class="keywordtype">void</span>);
|
||||
00080
|
||||
00082 MY_FLOAT *<a class="code" href="classTcpWvIn.html#a8">tickFrame</a>(MY_FLOAT *frameVector, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> frames);
|
||||
00083
|
||||
00084 <span class="comment">// Called by the thread routine to receive data via the socket connection</span>
|
||||
00085 <span class="comment">// and fill the socket buffer. This is not intended for general use but</span>
|
||||
00086 <span class="comment">// had to be made public for access from the thread.</span>
|
||||
00087 <span class="keywordtype">void</span> receive(<span class="keywordtype">void</span>);
|
||||
00088
|
||||
00089 <span class="keyword">protected</span>:
|
||||
00083 <a class="code" href="classStkFrames.html">StkFrames</a>& <a class="code" href="classTcpWvIn.html#a5">tick</a>( <a class="code" href="classStkFrames.html">StkFrames</a>& frames, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channel = 1 );
|
||||
00084
|
||||
00086 <span class="keyword">const</span> StkFloat *<a class="code" href="classTcpWvIn.html#a8">lastFrame</a>(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
|
||||
00087
|
||||
00089 <span class="keyword">const</span> StkFloat *<a class="code" href="classTcpWvIn.html#a9">tickFrame</a>(<span class="keywordtype">void</span>);
|
||||
00090
|
||||
00091 <span class="comment">// Initialize class variables.</span>
|
||||
00092 <span class="keywordtype">void</span> init( <span class="keywordtype">int</span> port );
|
||||
00092 StkFloat *<a class="code" href="classTcpWvIn.html#a9">tickFrame</a>(StkFloat *frameVector, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> frames);
|
||||
00093
|
||||
00094 <span class="comment">// Read buffered socket data into the data buffer ... will block if none available.</span>
|
||||
00095 <span class="keywordtype">int</span> readData( <span class="keywordtype">void</span> );
|
||||
00096
|
||||
00097 <a class="code" href="classSocket.html">Socket</a> *soket;
|
||||
00098 <a class="code" href="classThread.html">Thread</a> *thread;
|
||||
00099 Mutex mutex;
|
||||
00100 <span class="keywordtype">char</span> *buffer;
|
||||
00101 <span class="keywordtype">long</span> bufferBytes;
|
||||
00102 <span class="keywordtype">long</span> bytesFilled;
|
||||
00103 <span class="keywordtype">long</span> writePoint;
|
||||
00104 <span class="keywordtype">long</span> readPoint;
|
||||
00105 <span class="keywordtype">long</span> counter;
|
||||
00106 <span class="keywordtype">int</span> dataSize;
|
||||
00107 <span class="keywordtype">bool</span> connected;
|
||||
00108 <span class="keywordtype">int</span> fd;
|
||||
00109 thread_info threadInfo;
|
||||
00110
|
||||
00111 };
|
||||
00112
|
||||
00113 <span class="preprocessor">#endif</span>
|
||||
00095
|
||||
00100 <a class="code" href="classStkFrames.html">StkFrames</a>& <a class="code" href="classTcpWvIn.html#a9">tickFrame</a>( <a class="code" href="classStkFrames.html">StkFrames</a>& frames );
|
||||
00101
|
||||
00102 <span class="comment">// Called by the thread routine to receive data via the socket connection</span>
|
||||
00103 <span class="comment">// and fill the socket buffer. This is not intended for general use but</span>
|
||||
00104 <span class="comment">// had to be made public for access from the thread.</span>
|
||||
00105 <span class="keywordtype">void</span> receive(<span class="keywordtype">void</span>);
|
||||
00106
|
||||
00107 <span class="keyword">protected</span>:
|
||||
00108
|
||||
00109 <span class="comment">// Initialize class variables.</span>
|
||||
00110 <span class="keywordtype">void</span> init( <span class="keywordtype">int</span> port );
|
||||
00111
|
||||
00112 <span class="comment">// Read buffered socket data into the data buffer ... will block if none available.</span>
|
||||
00113 <span class="keywordtype">int</span> readData( <span class="keywordtype">void</span> );
|
||||
00114
|
||||
00115 <a class="code" href="classSocket.html">Socket</a> *soket_;
|
||||
00116 <a class="code" href="classThread.html">Thread</a> *thread_;
|
||||
00117 <a class="code" href="classMutex.html">Mutex</a> mutex_;
|
||||
00118 <span class="keywordtype">char</span> *buffer_;
|
||||
00119 <span class="keywordtype">long</span> bufferBytes_;
|
||||
00120 <span class="keywordtype">long</span> bytesFilled_;
|
||||
00121 <span class="keywordtype">long</span> writePoint_;
|
||||
00122 <span class="keywordtype">long</span> readPoint_;
|
||||
00123 <span class="keywordtype">long</span> counter_;
|
||||
00124 <span class="keywordtype">int</span> dataSize_;
|
||||
00125 <span class="keywordtype">bool</span> connected_;
|
||||
00126 <span class="keywordtype">int</span> fd_;
|
||||
00127 thread_info threadInfo_;
|
||||
00128
|
||||
00129 };
|
||||
00130
|
||||
00131 <span class="preprocessor">#endif</span>
|
||||
</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><A HREF="http://ccrma.stanford.edu/software/stk/"><I>The Synthesis ToolKit in C++ (STK)</I></A></td></tr>
|
||||
<tr><td>©1995-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user