File: classstk_1_1InetWvOut.html

package info (click to toggle)
stk 4.4.4-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 24,856 kB
  • sloc: cpp: 33,976; tcl: 2,375; sh: 2,319; ansic: 163; perl: 114; makefile: 37
file content (221 lines) | stat: -rw-r--r-- 14,892 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<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="faq.html">FAQ</a> &nbsp; <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
<HR>
<!-- Generated by Doxygen 1.6.2 -->
  <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" -->
<p>STK internet streaming output class.  
<a href="#_details">More...</a></p>

<p><code>#include &lt;<a class="el" href="InetWvOut_8h_source.html">InetWvOut.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for stk::InetWvOut:</div>
<div class="dynsection">
 <div class="center">
  <img src="classstk_1_1InetWvOut.png" usemap="#stk::InetWvOut_map" alt=""/>
  <map id="stk::InetWvOut_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>
</div>

<p><a href="classstk_1_1InetWvOut-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acc7c0b00c68cb76d1b15e7187d67a966"></a><!-- doxytag: member="stk::InetWvOut::InetWvOut" ref="acc7c0b00c68cb76d1b15e7187d67a966" args="(unsigned long packetFrames=1024)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1InetWvOut.html#acc7c0b00c68cb76d1b15e7187d67a966">InetWvOut</a> (unsigned long packetFrames=1024)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default constructor ... the socket is not instantiated. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1InetWvOut.html#af486ade34547956d4ad7c27cf304a085">InetWvOut</a> (int port, Socket::ProtocolType protocol=Socket::PROTO_TCP, std::string hostname=&quot;localhost&quot;, unsigned int nChannels=1, Stk::StkFormat format=<a class="el" href="classstk_1_1Stk.html#a5a807971b7fc3c8985d97823be079a7b">STK_SINT16</a>, unsigned long packetFrames=1024)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Overloaded constructor which opens a network connection during instantiation.  <a href="#af486ade34547956d4ad7c27cf304a085"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae58f286de491788df700479f88b3c625"></a><!-- doxytag: member="stk::InetWvOut::~InetWvOut" ref="ae58f286de491788df700479f88b3c625" args="()" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1InetWvOut.html#ae58f286de491788df700479f88b3c625">~InetWvOut</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Class destructor. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1InetWvOut.html#a4c8b6fb25c6d751b7929bec9a2d04a53">connect</a> (int port, Socket::ProtocolType protocol=Socket::PROTO_TCP, std::string hostname=&quot;localhost&quot;, unsigned int nChannels=1, Stk::StkFormat format=<a class="el" href="classstk_1_1Stk.html#a5a807971b7fc3c8985d97823be079a7b">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.  <a href="#a4c8b6fb25c6d751b7929bec9a2d04a53"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2314d2e2d005c5b08aa24d21075af638"></a><!-- doxytag: member="stk::InetWvOut::disconnect" ref="a2314d2e2d005c5b08aa24d21075af638" args="(void)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1InetWvOut.html#a2314d2e2d005c5b08aa24d21075af638">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/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1InetWvOut.html#a800f77228d851a2d276fae6a24bcdc9a">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.  <a href="#a800f77228d851a2d276fae6a24bcdc9a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1InetWvOut.html#a0305b3498e0277443a9309799e4ad8b7">tick</a> (const <a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &amp;frames)</td></tr>
<tr><td class="mdescLeft">&nbsp;</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="#a0305b3498e0277443a9309799e4ad8b7"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>STK internet streaming output class. </p>
<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>
<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#a800f77228d851a2d276fae6a24bcdc9a" 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>
<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>
<p>by Perry R. Cook and Gary P. Scavone, 1995-2012. </p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="af486ade34547956d4ad7c27cf304a085"></a><!-- doxytag: member="stk::InetWvOut::InetWvOut" ref="af486ade34547956d4ad7c27cf304a085" args="(int port, Socket::ProtocolType protocol=Socket::PROTO_TCP, std::string hostname=&quot;localhost&quot;, 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&nbsp;</td>
          <td class="paramname"> <em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Socket::ProtocolType&nbsp;</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&nbsp;</td>
          <td class="paramname"> <em>hostname</em> = <code>&quot;localhost&quot;</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&nbsp;</td>
          <td class="paramname"> <em>nChannels</em> = <code>1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Stk::StkFormat&nbsp;</td>
          <td class="paramname"> <em>format</em> = <code><a class="el" href="classstk_1_1Stk.html#a5a807971b7fc3c8985d97823be079a7b">STK_SINT16</a></code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&nbsp;</td>
          <td class="paramname"> <em>packetFrames</em> = <code>1024</code></td><td>&nbsp;</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>
<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. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a4c8b6fb25c6d751b7929bec9a2d04a53"></a><!-- doxytag: member="stk::InetWvOut::connect" ref="a4c8b6fb25c6d751b7929bec9a2d04a53" args="(int port, Socket::ProtocolType protocol=Socket::PROTO_TCP, std::string hostname=&quot;localhost&quot;, 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&nbsp;</td>
          <td class="paramname"> <em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Socket::ProtocolType&nbsp;</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&nbsp;</td>
          <td class="paramname"> <em>hostname</em> = <code>&quot;localhost&quot;</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&nbsp;</td>
          <td class="paramname"> <em>nChannels</em> = <code>1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Stk::StkFormat&nbsp;</td>
          <td class="paramname"> <em>format</em> = <code><a class="el" href="classstk_1_1Stk.html#a5a807971b7fc3c8985d97823be079a7b">STK_SINT16</a></code></td><td>&nbsp;</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>
<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. </p>

</div>
</div>
<a class="anchor" id="a800f77228d851a2d276fae6a24bcdc9a"></a><!-- doxytag: member="stk::InetWvOut::tick" ref="a800f77228d851a2d276fae6a24bcdc9a" 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&nbsp;</td>
          <td class="paramname"> <em>sample</em></td>
          <td>&nbsp;)&nbsp;</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>
<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>

<p>Implements <a class="el" href="classstk_1_1WvOut.html#a7fe517928a0043353ebc2a852b49953c">stk::WvOut</a>.</p>

</div>
</div>
<a class="anchor" id="a0305b3498e0277443a9309799e4ad8b7"></a><!-- doxytag: member="stk::InetWvOut::tick" ref="a0305b3498e0277443a9309799e4ad8b7" args="(const StkFrames &amp;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> &amp;&nbsp;</td>
          <td class="paramname"> <em>frames</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></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>
<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). </p>

<p>Implements <a class="el" href="classstk_1_1WvOut.html#a7e20334ec73dde8c6c5edef697812b7e">stk::WvOut</a>.</p>

</div>
</div>
<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></li>
</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>&copy;1995-2012 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
</table>

</BODY>
</HTML>