Files
stk/doc/html/classTcpWvOut.html
2013-09-29 23:39:37 +02:00

384 lines
18 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"> &nbsp; <img src="ccrma.gif"> &nbsp; <img src="mcgill.gif"><P>
<a class="qindex" href="index.html">Home</a> &nbsp; <a class="qindex" href="information.html">Information</a> &nbsp; <a class="qindex" href="classes.html">Classes</a> &nbsp; <a class="qindex" href="download.html">Download</a> &nbsp; <a class="qindex" href="usage.html">Usage</a> &nbsp; <a class="qindex" href="maillist.html">Mail List</a> &nbsp; <a class="qindex" href="system.html">Requirements</a> &nbsp; <a class="qindex" href="links.html">Links</a> &nbsp; <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
<HR>
<!-- Generated by Doxygen 1.3.4 -->
<h1>TcpWvOut Class Reference</h1><code>#include &lt;<a class="el" href="TcpWvOut_8h-source.html">TcpWvOut.h</a>&gt;</code>
<p>
<p>Inheritance diagram for TcpWvOut:
<p><center><img src="classTcpWvOut.png" usemap="#TcpWvOut_map" border="0" alt=""></center>
<map name="TcpWvOut_map">
<area href="classWvOut.html" alt="WvOut" shape="rect" coords="0,56,71,80">
<area href="classStk.html" alt="Stk" shape="rect" coords="0,0,71,24">
</map>
<a href="classTcpWvOut-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
STK internet streaming output class.
<p>
This protected <a class="el" href="classWvOut.html">WvOut</a> subclass can stream data over a network via a TCP socket connection. The data is converted to big-endian byte order, if necessary, before being transmitted.<p>
TcpWvOut supports multi-channel data in interleaved format. It is important to distinguish the <a class="el" href="classTcpWvOut.html#a7">tick()</a> methods, which output single samples to all channels in a sample frame, from the <a class="el" href="classTcpWvOut.html#a10">tickFrame()</a> method, which takes a pointer to multi-channel sample frame data.<p>
This class connects to a socket server, the port and IP address of which must be specified as constructor arguments. The default data type is signed 16-bit integers but any of the defined StkFormats are permissible.<p>
by Perry R. Cook and Gary P. Scavone, 1995 - 2004.
<p>
<p>
Definition at line <a class="el" href="TcpWvOut_8h-source.html#l00034">34</a> of file <a class="el" href="TcpWvOut_8h-source.html">TcpWvOut.h</a>.<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a0" doxytag="TcpWvOut::TcpWvOut" ></a>
&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classTcpWvOut.html#a0">TcpWvOut</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default constructor ... the socket is not instantiated. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classTcpWvOut.html#a1">TcpWvOut</a> (int port, const char *hostname="localhost", unsigned int nChannels=1, Stk::StkFormat format=<a class="el" href="classStk.html#s1">STK_SINT16</a>)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Overloaded constructor which opens a network connection during instantiation. </em> <a href="#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a2" doxytag="TcpWvOut::~TcpWvOut" ></a>
&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classTcpWvOut.html#a2">~TcpWvOut</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Class destructor. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classTcpWvOut.html#a3">connect</a> (int port, const char *hostname="localhost", unsigned int nChannels=1, Stk::StkFormat format=<a class="el" href="classStk.html#s1">STK_SINT16</a>)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Connect to the specified host and port and prepare to stream <em>nChannels</em> of data in the given data format. </em> <a href="#a3"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a4" doxytag="TcpWvOut::disconnect" ></a>
void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classTcpWvOut.html#a4">disconnect</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">If a connection is open, write out remaining samples in the queue and then disconnect. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a5" doxytag="TcpWvOut::getFrames" ></a>
unsigned long&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classTcpWvOut.html#a5">getFrames</a> (void) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the number of sample frames output. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a6" doxytag="TcpWvOut::getTime" ></a>
StkFloat&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classTcpWvOut.html#a6">getTime</a> (void) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the number of seconds of data output. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classTcpWvOut.html#a7">tick</a> (const StkFloat sample)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Output a single sample to all channels in a sample frame. </em> <a href="#a7"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classTcpWvOut.html#a8">tick</a> (const StkFloat *vector, unsigned int vectorSize)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Output each sample in <em>vector</em> to all channels in <em>vectorSize</em> sample frames. </em> <a href="#a8"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classTcpWvOut.html#a9">tick</a> (const <a class="el" href="classStkFrames.html">StkFrames</a> &amp;frames, unsigned int channel=1)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Output a channel of the <a class="el" href="classStkFrames.html">StkFrames</a> object to all channels of the TcpWvOut object. </em> <a href="#a9"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classTcpWvOut.html#a10">tickFrame</a> (const StkFloat *frameVector, unsigned int frames=1)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Output the <em>frameVector</em> of sample frames of the given length. </em> <a href="#a10"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classTcpWvOut.html#a11">tickFrame</a> (const <a class="el" href="classStkFrames.html">StkFrames</a> &amp;frames)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Output the <a class="el" href="classStkFrames.html">StkFrames</a> data to the TcpWvOut object. </em> <a href="#a11"></a><em><br><br></td></tr>
</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="a1" doxytag="TcpWvOut::TcpWvOut" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> TcpWvOut::TcpWvOut </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">int&nbsp;</td>
<td class="mdname" nowrap> <em>port</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>const char *&nbsp;</td>
<td class="mdname" nowrap> <em>hostname</em> = "localhost", </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>nChannels</em> = 1, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>Stk::StkFormat&nbsp;</td>
<td class="mdname" nowrap> <em>format</em> = <a class="el" href="classStk.html#s1">STK_SINT16</a></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Overloaded constructor which opens a network connection during instantiation.
<p>
An <a class="el" href="classStkError.html">StkError</a> is thrown if a socket error occurs or an invalid argument is specified. </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a3" doxytag="TcpWvOut::connect" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void TcpWvOut::connect </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">int&nbsp;</td>
<td class="mdname" nowrap> <em>port</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>const char *&nbsp;</td>
<td class="mdname" nowrap> <em>hostname</em> = "localhost", </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>nChannels</em> = 1, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>Stk::StkFormat&nbsp;</td>
<td class="mdname" nowrap> <em>format</em> = <a class="el" href="classStk.html#s1">STK_SINT16</a></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Connect to the specified host and port and prepare to stream <em>nChannels</em> of data in the given data format.
<p>
An <a class="el" href="classStkError.html">StkError</a> is thrown if a socket error occurs or an invalid argument is specified. </td>
</tr>
</table>
<a class="anchor" name="a7" doxytag="TcpWvOut::tick" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void TcpWvOut::tick </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const StkFloat&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>sample</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Output a single sample to all channels in a sample frame.
<p>
An <a class="el" href="classStkError.html">StkError</a> is thrown if a socket write error occurs.
<p>
Reimplemented from <a class="el" href="classWvOut.html#a9">WvOut</a>. </td>
</tr>
</table>
<a class="anchor" name="a8" doxytag="TcpWvOut::tick" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void TcpWvOut::tick </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const StkFloat *&nbsp;</td>
<td class="mdname" nowrap> <em>vector</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>vectorSize</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Output each sample in <em>vector</em> to all channels in <em>vectorSize</em> sample frames.
<p>
An <a class="el" href="classStkError.html">StkError</a> is thrown if a socket write error occurs.
<p>
Reimplemented from <a class="el" href="classWvOut.html#a10">WvOut</a>. </td>
</tr>
</table>
<a class="anchor" name="a9" doxytag="TcpWvOut::tick" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void TcpWvOut::tick </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const <a class="el" href="classStkFrames.html">StkFrames</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>frames</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>channel</em> = 1</td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Output a channel of the <a class="el" href="classStkFrames.html">StkFrames</a> object to all channels of the TcpWvOut object.
<p>
The <code>channel</code> argument should be one or greater (the first channel is specified by 1). An <a class="el" href="classStkError.html">StkError</a> will be thrown if a socket write error occurs or the <code>channel</code> argument is zero or it is greater than the number of channels in the <a class="el" href="classStkFrames.html">StkFrames</a> object.
<p>
Reimplemented from <a class="el" href="classWvOut.html#a11">WvOut</a>. </td>
</tr>
</table>
<a class="anchor" name="a10" doxytag="TcpWvOut::tickFrame" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void TcpWvOut::tickFrame </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const StkFloat *&nbsp;</td>
<td class="mdname" nowrap> <em>frameVector</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>frames</em> = 1</td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Output the <em>frameVector</em> of sample frames of the given length.
<p>
An <a class="el" href="classStkError.html">StkError</a> is thrown if a socket write error occurs.
<p>
Reimplemented from <a class="el" href="classWvOut.html#a12">WvOut</a>. </td>
</tr>
</table>
<a class="anchor" name="a11" doxytag="TcpWvOut::tickFrame" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> virtual void TcpWvOut::tickFrame </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const <a class="el" href="classStkFrames.html">StkFrames</a> &amp;&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>frames</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Output the <a class="el" href="classStkFrames.html">StkFrames</a> data to the TcpWvOut object.
<p>
An <a class="el" href="classStkError.html">StkError</a> will be thrown if a socket write error occurs or if there is an incompatability between the number of channels in the TcpWvOut object and that in the <a class="el" href="classStkFrames.html">StkFrames</a> object.
<p>
Reimplemented from <a class="el" href="classWvOut.html#a13">WvOut</a>. </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="TcpWvOut_8h-source.html">TcpWvOut.h</a></ul>
<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>&copy;1995-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
</table>
</BODY>
</HTML>