mirror of
https://github.com/thestk/stk
synced 2026-01-13 21:11:53 +00:00
284 lines
11 KiB
HTML
284 lines
11 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="links.html">Links</a> <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
|
|
<HR>
|
|
<!-- Generated by Doxygen 1.2.8.1 -->
|
|
<h1>TcpWvOut Class Reference</h1>STK internet streaming output class.
|
|
<a href="#_details">More...</a>
|
|
<p>
|
|
<code>#include <<a class="el" href="TcpWvOut_8h-source.html">TcpWvOut.h</a>></code>
|
|
<p>
|
|
<p>Inheritance diagram for TcpWvOut::
|
|
<p><center><img src="classTcpWvOut.gif" usemap="#TcpWvOut_map" border="0"></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><table border=0 cellpadding=0 cellspacing=0>
|
|
<tr><td colspan=2><br><h2>Public Methods</h2></td></tr>
|
|
<tr><td nowrap align=right valign=top><a name="a0" doxytag="TcpWvOut::TcpWvOut"></a>
|
|
</td><td valign=bottom><a class="el" href="classTcpWvOut.html#a0">TcpWvOut</a> ()</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Default constructor ... the socket is not instantiated.</em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classTcpWvOut.html#a1">TcpWvOut</a> (int port, const char *hostname="localhost", unsigned int nChannels=1, Stk::STK_FORMAT format=<a class="el" href="classStk.html#p1">STK_SINT16</a>)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Overloaded constructor which opens a network connection during instantiation.</em> <a href="#a1">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top><a name="a2" doxytag="TcpWvOut::~TcpWvOut"></a>
|
|
</td><td valign=bottom><a class="el" href="classTcpWvOut.html#a2">~TcpWvOut</a> ()</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Class destructor.</em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classTcpWvOut.html#a3">connect</a> (int port, const char *hostname="localhost", unsigned int nChannels=1, Stk::STK_FORMAT format=<a class="el" href="classStk.html#p1">STK_SINT16</a>)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>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">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top><a name="a4" doxytag="TcpWvOut::disconnect"></a>
|
|
void </td><td valign=bottom><a class="el" href="classTcpWvOut.html#a4">disconnect</a> (void)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>If a connection is open, write out remaining samples in the queue and then disconnect.</em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top><a name="a5" doxytag="TcpWvOut::getFrames"></a>
|
|
unsigned long </td><td valign=bottom><a class="el" href="classTcpWvOut.html#a5">getFrames</a> (void) const</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Return the number of sample frames output.</em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top><a name="a6" doxytag="TcpWvOut::getTime"></a>
|
|
MY_FLOAT </td><td valign=bottom><a class="el" href="classTcpWvOut.html#a6">getTime</a> (void) const</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Return the number of seconds of data output.</em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classTcpWvOut.html#a7">tick</a> (MY_FLOAT sample)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Output a single sample to all channels in a sample frame.</em> <a href="#a7">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classTcpWvOut.html#a8">tick</a> (const MY_FLOAT *vector, unsigned int vectorSize)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Output each sample in <em>vector</em> to all channels in <em>vectorSize</em> sample frames.</em> <a href="#a8">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classTcpWvOut.html#a9">tickFrame</a> (const MY_FLOAT *frameVector, unsigned int frames=1)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Output the <em>frameVector</em> of sample frames of the given length.</em> <a href="#a9">More...</a><em></em></font><br><br></td></tr>
|
|
</table>
|
|
<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#a9">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 STK_FORMATs are permissible.
|
|
<p>
|
|
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
|
|
<p>
|
|
<hr><h2>Constructor & Destructor Documentation</h2>
|
|
<a name="a1" doxytag="TcpWvOut::TcpWvOut"></a><p>
|
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td nowrap valign="top"><b>
|
|
TcpWvOut::TcpWvOut (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
int <em>port</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
const char * <em>hostname</em> = "localhost",
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
unsigned int <em>nChannels</em> = 1,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
Stk::STK_FORMAT <em>format</em> = <a class="el" href="classStk.html#p1">STK_SINT16</a> )
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</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 name="a3" doxytag="TcpWvOut::connect"></a><p>
|
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td nowrap valign="top"><b>
|
|
void TcpWvOut::connect (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
int <em>port</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
const char * <em>hostname</em> = "localhost",
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
unsigned int <em>nChannels</em> = 1,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
Stk::STK_FORMAT <em>format</em> = <a class="el" href="classStk.html#p1">STK_SINT16</a> )
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</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 name="a7" doxytag="TcpWvOut::tick"></a><p>
|
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td nowrap valign="top"><b>
|
|
void TcpWvOut::tick (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
MY_FLOAT <em>sample</em> )<code> [virtual]</code>
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</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#a7">WvOut</a>. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="a8" doxytag="TcpWvOut::tick"></a><p>
|
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td nowrap valign="top"><b>
|
|
void TcpWvOut::tick (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
const MY_FLOAT * <em>vector</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
unsigned int <em>vectorSize</em> )<code> [virtual]</code>
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</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#a8">WvOut</a>. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="a9" doxytag="TcpWvOut::tickFrame"></a><p>
|
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td nowrap valign="top"><b>
|
|
void TcpWvOut::tickFrame (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
const MY_FLOAT * <em>frameVector</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
unsigned int <em>frames</em> = 1 )<code> [virtual]</code>
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</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#a9">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://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>
|