mirror of
https://github.com/thestk/stk
synced 2026-01-11 20:11:52 +00:00
92 lines
5.4 KiB
HTML
92 lines
5.4 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"> <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="tutorial.html">Tutorial</a></CENTER>
|
|
<HR>
|
|
<!-- Generated by Doxygen 1.3.4 -->
|
|
<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>
|
|
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>;
|
|
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>:
|
|
00090
|
|
00091 <span class="comment">// Initialize class variables.</span>
|
|
00092 <span class="keywordtype">void</span> init( <span class="keywordtype">int</span> port );
|
|
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>
|
|
</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-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
|
</table>
|
|
|
|
</BODY>
|
|
</HTML>
|