Home Information Classes Download Usage Mail List Requirements Links Tutorial

# TcpWvIn Class Reference

STK internet streaming input class. More...

`#include <TcpWvIn.h>`

Inheritance diagram for TcpWvIn:

List of all members.

## Public Member Functions

| TcpWvIn (int port=2006)
| Default constructor starts a socket server. If not specified, the server is associated with port 2006.
| ~TcpWvIn ()
| Class destructor.
void | listen (unsigned int nChannels=1, Stk::STK_FORMAT format=STK_SINT16)
| Listen for a (new) connection with specified data channels and format.
bool | isConnected (void)
| Returns TRUE is an input connection exists or input data remains in the queue.
MY_FLOAT | lastOut (void) const
| Return the average across the last output sample frame.
MY_FLOAT | tick (void)
| Read out the average across one sample frame of data.
MY_FLOAT * | tick (MY_FLOAT *vector, unsigned int vectorSize)
| Read out vectorSize averaged sample frames of data in vector.
const MY_FLOAT * | lastFrame (void) const
| Return a pointer to the last output sample frame.
const MY_FLOAT * | tickFrame (void)
| Return a pointer to the next sample frame of data.
MY_FLOAT * | tickFrame (MY_FLOAT *frameVector, unsigned int frames)
| Read out sample frames of data to frameVector.

## Detailed Description

STK internet streaming input class.

This protected Wvin subclass can read streamed data over a network via a TCP socket connection. The data is assumed in big-endian, or network, byte order.

TcpWvIn supports multi-channel data in interleaved format. It is important to distinguish the tick() methods, which return samples produced by averaging across sample frames, from the tickFrame() methods, which return pointers to multi-channel sample frames. For single-channel data, these methods return equivalent values.

This class starts a socket server, which waits for a single remote connection. The default data type for the incoming stream is signed 16-bit integers, though any of the defined STK_FORMATs are permissible.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

Definition at line 41 of file TcpWvIn.h.

## Constructor & Destructor Documentation

TcpWvIn::TcpWvIn | ( | int | port = 2006 | ) |

| Default constructor starts a socket server. If not specified, the server is associated with port 2006. An StkError will be thrown if an error occurs while initializing the input thread or starting the socket server.

## Member Function Documentation

void TcpWvIn::listen | ( | unsigned int | nChannels = 1,
|  | Stk::STK_FORMAT | format = STK_SINT16
| ) |

| Listen for a (new) connection with specified data channels and format. An StkError will be thrown a socket error or an invalid function argument.

bool TcpWvIn::isConnected | ( | void |  | ) |

| Returns TRUE is an input connection exists or input data remains in the queue. This method will not return FALSE after an input connection has been closed until all buffered input data has been read out.

The documentation for this class was generated from the following file:

- TcpWvIn.h

The Synthesis ToolKit in C++ (STK)
©1995-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved.