Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   FAQ   Tutorial


InetWvIn Class Reference

#include <InetWvIn.h>

Inheritance diagram for InetWvIn:

WvIn Stk List of all members.

Detailed Description

STK internet streaming input class.

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.

InetWvIn supports multi-channel data. It is important to distinguish the tick() methods, which return samples produced by averaging across sample frames, from the tickFrame() methods, which return references or pointers to multi-channel sample frames.

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.

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


Public Member Functions

 InetWvIn (unsigned long bufferFrames=1024, unsigned int nBuffers=8)
 Default constructor.
 ~InetWvIn ()
 Class destructor.
void listen (int port=2006, unsigned int nChannels=1, Stk::StkFormat format=STK_SINT16, Socket::ProtocolType protocol=Socket::PROTO_TCP)
 Wait for a (new) socket connection with specified protocol, port, data channels and format.
bool isConnected (void)
 Returns true is an input connection exists or input data remains in the queue.


Constructor & Destructor Documentation

InetWvIn::InetWvIn unsigned long  bufferFrames = 1024,
unsigned int  nBuffers = 8
 

Default constructor.

An StkError will be thrown if an error occurs while initializing the input thread.


Member Function Documentation

void InetWvIn::listen int  port = 2006,
unsigned int  nChannels = 1,
Stk::StkFormat  format = STK_SINT16,
Socket::ProtocolType  protocol = Socket::PROTO_TCP
 

Wait for a (new) socket connection with specified protocol, port, data channels and format.

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 StkError will be thrown if a socket error occurs or an invalid function argument is provided.

bool InetWvIn::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:
The Synthesis ToolKit in C++ (STK)
©1995-2007 Perry R. Cook and Gary P. Scavone. All Rights Reserved.