Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   FAQ   Tutorial


InetWvOut.h
1#ifndef STK_INETWVOUT_H
2#define STK_INETWVOUT_H
3
4#include "WvOut.h"
5#include "Socket.h"
6
7namespace stk {
8
9/***************************************************/
30/***************************************************/
31
32class InetWvOut : public WvOut
33{
34 public:
36 InetWvOut( unsigned long packetFrames = 1024 );
37
39
42 InetWvOut( int port, Socket::ProtocolType protocol = Socket::PROTO_TCP,
43 std::string hostname = "localhost", unsigned int nChannels = 1, Stk::StkFormat format = STK_SINT16,
44 unsigned long packetFrames = 1024 );
45
48
50
53 void connect( int port, Socket::ProtocolType protocol = Socket::PROTO_TCP,
54 std::string hostname = "localhost", unsigned int nChannels = 1, Stk::StkFormat format = STK_SINT16 );
55
57 void disconnect( void );
58
60
65 void tick( const StkFloat sample );
66
68
77 void tick( const StkFrames& frames );
78
79 protected:
80
81 void incrementFrame( void );
82
83 // Write a buffer of length frames via the socket connection.
84 void writeData( unsigned long frames );
85
86 char *buffer_;
87 Socket *soket_;
88 unsigned long bufferFrames_;
89 unsigned long bufferBytes_;
90 unsigned long bufferIndex_;
91 unsigned long iData_;
92 unsigned int dataBytes_;
93 Stk::StkFormat dataType_;
94};
95
96} // stk namespace
97
98#endif
STK internet streaming output class.
Definition InetWvOut.h:33
void tick(const StkFrames &frames)
Output the StkFrames data.
void disconnect(void)
If a connection is open, write out remaining samples in the queue and then disconnect.
void connect(int port, Socket::ProtocolType protocol=Socket::PROTO_TCP, std::string hostname="localhost", unsigned int nChannels=1, Stk::StkFormat format=STK_SINT16)
Connect to the specified host and port and prepare to stream nChannels of data in the given data form...
void tick(const StkFloat sample)
Output a single sample to all channels in a sample frame.
InetWvOut(unsigned long packetFrames=1024)
Default constructor ... the socket is not instantiated.
~InetWvOut()
Class destructor.
InetWvOut(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)
Overloaded constructor which opens a network connection during instantiation.
STK internet socket abstract base class.
Definition Socket.h:39
An STK class to handle vectorized audio data.
Definition Stk.h:279
static const StkFormat STK_SINT16
Definition Stk.h:141
STK audio output abstract base class.
Definition WvOut.h:23
The STK namespace.
Definition ADSR.h:6

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