mirror of
https://github.com/thestk/stk
synced 2026-01-14 05:21:53 +00:00
230 lines
14 KiB
HTML
230 lines
14 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="faq.html">FAQ</a> <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
|
|
<HR>
|
|
<!-- Generated by Doxygen 1.5.8 -->
|
|
<div class="navpath"><a class="el" href="namespacestk.html">stk</a>::<a class="el" href="classstk_1_1InetWvOut.html">InetWvOut</a>
|
|
</div>
|
|
<div class="contents">
|
|
<h1>stk::InetWvOut Class Reference</h1><!-- doxytag: class="stk::InetWvOut" --><!-- doxytag: inherits="stk::WvOut" -->STK internet streaming output class.
|
|
<a href="#_details">More...</a>
|
|
<p>
|
|
<code>#include <<a class="el" href="InetWvOut_8h-source.html">InetWvOut.h</a>></code>
|
|
<p>
|
|
<div class="dynheader">
|
|
Inheritance diagram for stk::InetWvOut:</div>
|
|
<div class="dynsection">
|
|
|
|
<p><center><img src="classstk_1_1InetWvOut.png" usemap="#stk::InetWvOut_map" border="0" alt=""></center>
|
|
<map name="stk::InetWvOut_map">
|
|
<area href="classstk_1_1WvOut.html" alt="stk::WvOut" shape="rect" coords="0,56,91,80">
|
|
<area href="classstk_1_1Stk.html" alt="stk::Stk" shape="rect" coords="0,0,91,24">
|
|
</map>
|
|
</div>
|
|
|
|
<p>
|
|
<a href="classstk_1_1InetWvOut-members.html">List of all members.</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="cc7c0b00c68cb76d1b15e7187d67a966"></a><!-- doxytag: member="stk::InetWvOut::InetWvOut" ref="cc7c0b00c68cb76d1b15e7187d67a966" args="(unsigned long packetFrames=1024)" -->
|
|
</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1InetWvOut.html#cc7c0b00c68cb76d1b15e7187d67a966">InetWvOut</a> (unsigned long packetFrames=1024)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor ... the socket is not instantiated. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1InetWvOut.html#f486ade34547956d4ad7c27cf304a085">InetWvOut</a> (int port, Socket::ProtocolType protocol=Socket::PROTO_TCP, std::string hostname="localhost", unsigned int nChannels=1, Stk::StkFormat format=<a class="el" href="classstk_1_1Stk.html#5a807971b7fc3c8985d97823be079a7b">STK_SINT16</a>, unsigned long packetFrames=1024)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Overloaded constructor which opens a network connection during instantiation. <a href="#f486ade34547956d4ad7c27cf304a085"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e58f286de491788df700479f88b3c625"></a><!-- doxytag: member="stk::InetWvOut::~InetWvOut" ref="e58f286de491788df700479f88b3c625" args="()" -->
|
|
</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1InetWvOut.html#e58f286de491788df700479f88b3c625">~InetWvOut</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Class destructor. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1InetWvOut.html#4c8b6fb25c6d751b7929bec9a2d04a53">connect</a> (int port, Socket::ProtocolType protocol=Socket::PROTO_TCP, std::string hostname="localhost", unsigned int nChannels=1, Stk::StkFormat format=<a class="el" href="classstk_1_1Stk.html#5a807971b7fc3c8985d97823be079a7b">STK_SINT16</a>)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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. <a href="#4c8b6fb25c6d751b7929bec9a2d04a53"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2314d2e2d005c5b08aa24d21075af638"></a><!-- doxytag: member="stk::InetWvOut::disconnect" ref="2314d2e2d005c5b08aa24d21075af638" args="(void)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1InetWvOut.html#2314d2e2d005c5b08aa24d21075af638">disconnect</a> (void)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">If a connection is open, write out remaining samples in the queue and then disconnect. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1InetWvOut.html#800f77228d851a2d276fae6a24bcdc9a">tick</a> (const StkFloat sample)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Output a single sample to all channels in a sample frame. <a href="#800f77228d851a2d276fae6a24bcdc9a"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1InetWvOut.html#0305b3498e0277443a9309799e4ad8b7">tick</a> (const <a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &frames)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Output the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> data. <a href="#0305b3498e0277443a9309799e4ad8b7"></a><br></td></tr>
|
|
</table>
|
|
<hr><a name="_details"></a><h2>Detailed Description</h2>
|
|
STK internet streaming output class.
|
|
<p>
|
|
This <a class="el" href="classstk_1_1WvOut.html" title="STK audio output abstract base class.">WvOut</a> subclass can stream data over a network via a TCP or UDP socket connection. The data is converted to big-endian byte order, if necessary, before being transmitted.<p>
|
|
<a class="el" href="classstk_1_1InetWvOut.html" title="STK internet streaming output class.">InetWvOut</a> supports multi-channel data. It is important to distinguish the <a class="el" href="classstk_1_1InetWvOut.html#800f77228d851a2d276fae6a24bcdc9a" title="Output a single sample to all channels in a sample frame.">tick()</a> method that outputs a single sample to all channels in a sample frame from the overloaded one that takes a reference to an <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> object for multi-channel and/or multi-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 - 2009. <hr><h2>Constructor & Destructor Documentation</h2>
|
|
<a class="anchor" name="f486ade34547956d4ad7c27cf304a085"></a><!-- doxytag: member="stk::InetWvOut::InetWvOut" ref="f486ade34547956d4ad7c27cf304a085" args="(int port, Socket::ProtocolType protocol=Socket::PROTO_TCP, std::string hostname="localhost", unsigned int nChannels=1, Stk::StkFormat format=STK_SINT16, unsigned long packetFrames=1024)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">stk::InetWvOut::InetWvOut </td>
|
|
<td>(</td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>port</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">Socket::ProtocolType </td>
|
|
<td class="paramname"> <em>protocol</em> = <code>Socket::PROTO_TCP</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">std::string </td>
|
|
<td class="paramname"> <em>hostname</em> = <code>"localhost"</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned int </td>
|
|
<td class="paramname"> <em>nChannels</em> = <code>1</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">Stk::StkFormat </td>
|
|
<td class="paramname"> <em>format</em> = <code><a class="el" href="classstk_1_1Stk.html#5a807971b7fc3c8985d97823be079a7b">STK_SINT16</a></code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned long </td>
|
|
<td class="paramname"> <em>packetFrames</em> = <code>1024</code></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Overloaded constructor which opens a network connection during instantiation.
|
|
<p>
|
|
An <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> is thrown if a socket error occurs or an invalid argument is specified.
|
|
</div>
|
|
</div><p>
|
|
<hr><h2>Member Function Documentation</h2>
|
|
<a class="anchor" name="4c8b6fb25c6d751b7929bec9a2d04a53"></a><!-- doxytag: member="stk::InetWvOut::connect" ref="4c8b6fb25c6d751b7929bec9a2d04a53" args="(int port, Socket::ProtocolType protocol=Socket::PROTO_TCP, std::string hostname="localhost", unsigned int nChannels=1, Stk::StkFormat format=STK_SINT16)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void stk::InetWvOut::connect </td>
|
|
<td>(</td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>port</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">Socket::ProtocolType </td>
|
|
<td class="paramname"> <em>protocol</em> = <code>Socket::PROTO_TCP</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">std::string </td>
|
|
<td class="paramname"> <em>hostname</em> = <code>"localhost"</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned int </td>
|
|
<td class="paramname"> <em>nChannels</em> = <code>1</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">Stk::StkFormat </td>
|
|
<td class="paramname"> <em>format</em> = <code><a class="el" href="classstk_1_1Stk.html#5a807971b7fc3c8985d97823be079a7b">STK_SINT16</a></code></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<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="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> is thrown if a socket error occurs or an invalid argument is specified.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="800f77228d851a2d276fae6a24bcdc9a"></a><!-- doxytag: member="stk::InetWvOut::tick" ref="800f77228d851a2d276fae6a24bcdc9a" args="(const StkFloat sample)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void stk::InetWvOut::tick </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const StkFloat </td>
|
|
<td class="paramname"> <em>sample</em> </td>
|
|
<td> ) </td>
|
|
<td><code> [virtual]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Output a single sample to all channels in a sample frame.
|
|
<p>
|
|
An <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> is thrown if an output error occurs. If a socket connection does not exist, the function does nothing (a warning will be issued if _STK_DEBUG_ is defined during compilation).
|
|
<p>Implements <a class="el" href="classstk_1_1WvOut.html#7fe517928a0043353ebc2a852b49953c">stk::WvOut</a>.</p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="0305b3498e0277443a9309799e4ad8b7"></a><!-- doxytag: member="stk::InetWvOut::tick" ref="0305b3498e0277443a9309799e4ad8b7" args="(const StkFrames &frames)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void stk::InetWvOut::tick </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> & </td>
|
|
<td class="paramname"> <em>frames</em> </td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Output the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> data.
|
|
<p>
|
|
An <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> will be thrown if an output error occurs. An <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> will also be thrown if _STK_DEBUG_ is defined during compilation and there is an incompatability between the number of channels in the <a class="el" href="classstk_1_1FileWvOut.html" title="STK audio file output class.">FileWvOut</a> object and that in the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> object. If a socket connection does not exist, the function does nothing (a warning will be issued if _STK_DEBUG_ is defined during compilation).
|
|
</div>
|
|
</div><p>
|
|
<hr>The documentation for this class was generated from the following file:<ul>
|
|
<li><a class="el" href="InetWvOut_8h-source.html">InetWvOut.h</a></ul>
|
|
</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-2009 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
|
</table>
|
|
|
|
</BODY>
|
|
</HTML>
|