Files
stk/doc/html/classInetWvIn.html
2013-09-29 23:40:35 +02:00

178 lines
9.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"> &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.4.4 -->
<h1>InetWvIn Class Reference</h1><!-- doxytag: class="InetWvIn" --><!-- doxytag: inherits="WvIn" --><code>#include &lt;<a class="el" href="InetWvIn_8h-source.html">InetWvIn.h</a>&gt;</code>
<p>
<p>Inheritance diagram for InetWvIn:
<p><center><img src="classInetWvIn.png" usemap="#InetWvIn_map" border="0" alt=""></center>
<map name="InetWvIn_map">
<area href="classWvIn.html" alt="WvIn" shape="rect" coords="0,56,60,80">
<area href="classStk.html" alt="Stk" shape="rect" coords="0,0,60,24">
</map>
<a href="classInetWvIn-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
STK internet streaming input class.
<p>
This Wvin subclass reads streamed audio data over a network via a TCP or UDP socket connection. The data is assumed in big-endian, or network, byte order. Only a single socket connection is supported.<p>
InetWvIn supports multi-channel data. It is important to distinguish the <a class="el" href="classWvIn.html#a5">tick()</a> methods, which return samples produced by averaging across sample frames, from the <a class="el" href="classWvIn.html#a7">tickFrame()</a> methods, which return references or pointers to multi-channel sample frames.<p>
This class implements a socket server. When using the TCP protocol, the server "listens" for a single remote connection within the InetWvIn::start() function. For the UDP protocol, no attempt is made to verify packet delivery or order. The default data type for the incoming stream is signed 16-bit integers, though any of the defined StkFormats are permissible.<p>
by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
<p>
<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">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInetWvIn.html#a0">InetWvIn</a> (unsigned long bufferFrames=1024, unsigned int nBuffers=8)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default constructor. <a href="#a0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a1"></a><!-- doxytag: member="InetWvIn::~InetWvIn" ref="a1" args="()" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInetWvIn.html#a1">~InetWvIn</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Class destructor. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInetWvIn.html#a2">listen</a> (int port=2006, unsigned int nChannels=1, Stk::StkFormat format=<a class="el" href="classStk.html#s1">STK_SINT16</a>, Socket::ProtocolType protocol=Socket::PROTO_TCP)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wait for a (new) socket connection with specified protocol, port, data channels and format. <a href="#a2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInetWvIn.html#a3">isConnected</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true is an input connection exists or input data remains in the queue. <a href="#a3"></a><br></td></tr>
</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="a0"></a><!-- doxytag: member="InetWvIn::InetWvIn" ref="a0" args="(unsigned long bufferFrames=1024, unsigned int nBuffers=8)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">InetWvIn::InetWvIn </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">unsigned long&nbsp;</td>
<td class="mdname" nowrap> <em>bufferFrames</em> = <code>1024</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>nBuffers</em> = <code>8</code></td>
</tr>
<tr>
<td class="md"></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>
Default constructor.
<p>
An <a class="el" href="classStkError.html">StkError</a> will be thrown if an error occurs while initializing the input thread. </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a2"></a><!-- doxytag: member="InetWvIn::listen" ref="a2" args="(int port=2006, unsigned int nChannels=1, Stk::StkFormat format=STK_SINT16, Socket::ProtocolType protocol=Socket::PROTO_TCP)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void InetWvIn::listen </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">int&nbsp;</td>
<td class="mdname" nowrap> <em>port</em> = <code>2006</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>nChannels</em> = <code>1</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>Stk::StkFormat&nbsp;</td>
<td class="mdname" nowrap> <em>format</em> = <code><a class="el" href="classStk.html#s1">STK_SINT16</a></code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>Socket::ProtocolType&nbsp;</td>
<td class="mdname" nowrap> <em>protocol</em> = <code>Socket::PROTO_TCP</code></td>
</tr>
<tr>
<td class="md"></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>
Wait for a (new) socket connection with specified protocol, port, data channels and format.
<p>
For the UDP protocol, this function will create a socket instance and return. For the TCP protocol, this function will block until a connection is established. An <a class="el" href="classStkError.html">StkError</a> will be thrown if a socket error occurs or an invalid function argument is provided. </td>
</tr>
</table>
<a class="anchor" name="a3"></a><!-- doxytag: member="InetWvIn::isConnected" ref="a3" args="(void)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">bool InetWvIn::isConnected </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">void&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Returns true is an input connection exists or input data remains in the queue.
<p>
This method will not return false after an input connection has been closed until all buffered input data has been read out. </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="InetWvIn_8h-source.html">InetWvIn.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-2005 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
</table>
</BODY>
</HTML>