mirror of
https://github.com/thestk/stk
synced 2026-01-13 13:01:52 +00:00
99 lines
6.0 KiB
HTML
99 lines
6.0 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">#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 <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
|
|
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
|
|
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
|
|
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://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>
|