Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

SpeakerServer Class Reference

#include <SpeakerServer.h>

Inheritance diagram for SpeakerServer:

Inheritance graph
[legend]
List of all members.

Detailed Description

Plays streamed audio via the speaker.

Definition at line 9 of file SpeakerServer.h.

Public Member Functions

virtual ~SpeakerServer ()
 destructor
virtual void DoStart ()
 By default, merely adds to the reference counter (through AddReference()); Note you should still call this from your overriding methods.
virtual void DoStop ()
 By default, subtracts from the reference counter (RemoveReference()), and thus may deletex if zero; Don't forget to still call this when you override this; Warning: call this at the end of your DoStop(), not beginning (it might delete this ).

Static Public Member Functions

static SpeakerServerGetInstance ()
 returns global instance
static int socket_callback (char *buf, int size)
 registered by DoStart() to be called by networking module with incoming data

Private Member Functions

 SpeakerServer ()
 constructor
 SpeakerServer (const SpeakerServer &rhs)
 don't call
SpeakerServeroperator= (const SpeakerServer &rhs)
 don't call
int GotSocketData (char *data, int dataSize)
 should be called with new sound data from the network
void AddPacket (const void *samples, int samplesSize, int sampleRate, byte sampleBits)
const void * ResampleForSpeaker (const void *samples, int samplesSize, int sampleRate, byte bitsPerSample, int &newSamplesSize)
void QueueFrame (const char *samples, int samplesSize)

Static Private Member Functions

static short GetShort (const void *buf)
 returns the next sizeof(short) bytes from buf as a short

Private Attributes

Socketsocket
Packet packet
Bufferframe
Bufferresampled
SoundManager::Play_ID channel

Static Private Attributes

static SpeakerServerinstance = 0
 global instance of the server (only ever want to have one of these)
static const int MAX_PACKET_SIZE = 1024 * 1024
 maximum size of sound buffer to send to system
static const int RECEIVE_BUFFER_SIZE = 2048
 maximum network packet size to accept

Classes

class  Packet
 stores information about current sound buffer More...


Member Data Documentation

class Socket* SpeakerServer::socket [private]

network communications socket for receiving sound data

Definition at line 27 of file SpeakerServer.h.

Referenced by DoStart(), and DoStop().


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

Tekkotsu v3.0
Generated Fri May 11 20:08:49 2007 by Doxygen 1.4.7