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 ()
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 ()
static int socket_callback (char *buf, int size)

Private Member Functions

 SpeakerServer ()
 SpeakerServer (const SpeakerServer &rhs)
 don't call
SpeakerServeroperator= (const SpeakerServer &rhs)
 don't call
int GotSocketData (char *data, int dataSize)
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)

Private Attributes

Socketsocket
Packet packet
Bufferframe
Bufferresampled
SoundManager::Play_ID channel

Static Private Attributes

static SpeakerServerinstance = 0
static const int MAX_PACKET_SIZE = 1024 * 1024
static const int RECEIVE_BUFFER_SIZE = 2048

Classes

class  Packet


Constructor & Destructor Documentation

SpeakerServer::~SpeakerServer  )  [virtual]
 

Definition at line 25 of file SpeakerServer.cc.

SpeakerServer::SpeakerServer  )  [private]
 

Definition at line 17 of file SpeakerServer.cc.

Referenced by GetInstance().

SpeakerServer::SpeakerServer const SpeakerServer rhs  )  [private]
 

don't call


Member Function Documentation

void SpeakerServer::AddPacket const void *  samples,
int  samplesSize,
int  sampleRate,
byte  sampleBits
[private]
 

Definition at line 165 of file SpeakerServer.cc.

Referenced by GotSocketData().

void SpeakerServer::DoStart  )  [virtual]
 

By default, merely adds to the reference counter (through AddReference()); Note you should still call this from your overriding methods.

Reimplemented from BehaviorBase.

Definition at line 35 of file SpeakerServer.cc.

void SpeakerServer::DoStop  )  [virtual]
 

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 ).

Reimplemented from BehaviorBase.

Definition at line 54 of file SpeakerServer.cc.

SpeakerServer * SpeakerServer::GetInstance  )  [static]
 

Definition at line 10 of file SpeakerServer.cc.

static short SpeakerServer::GetShort const void *  buf  )  [inline, static, private]
 

Definition at line 27 of file SpeakerServer.h.

Referenced by GotSocketData().

int SpeakerServer::GotSocketData char *  data,
int  dataSize
[private]
 

Definition at line 91 of file SpeakerServer.cc.

Referenced by socket_callback().

SpeakerServer& SpeakerServer::operator= const SpeakerServer rhs  )  [private]
 

don't call

void SpeakerServer::QueueFrame const char *  samples,
int  samplesSize
[private]
 

Definition at line 217 of file SpeakerServer.cc.

Referenced by AddPacket().

const void * SpeakerServer::ResampleForSpeaker const void *  samples,
int  samplesSize,
int  sampleRate,
byte  bitsPerSample,
int &  newSamplesSize
[private]
 

Definition at line 241 of file SpeakerServer.cc.

Referenced by AddPacket().

int SpeakerServer::socket_callback char *  buf,
int  size
[static]
 

Definition at line 72 of file SpeakerServer.cc.

Referenced by DoStart().


Member Data Documentation

SoundManager::Play_ID SpeakerServer::channel [private]
 

Definition at line 67 of file SpeakerServer.h.

Referenced by DoStart(), DoStop(), and QueueFrame().

class Buffer* SpeakerServer::frame [private]
 

Definition at line 54 of file SpeakerServer.h.

Referenced by AddPacket(), DoStop(), and ~SpeakerServer().

SpeakerServer * SpeakerServer::instance = 0 [static, private]
 

Definition at line 23 of file SpeakerServer.h.

Referenced by GetInstance(), socket_callback(), and ~SpeakerServer().

const int SpeakerServer::MAX_PACKET_SIZE = 1024 * 1024 [static, private]
 

Definition at line 29 of file SpeakerServer.h.

Referenced by GotSocketData().

Packet SpeakerServer::packet [private]
 

Definition at line 53 of file SpeakerServer.h.

Referenced by DoStart(), DoStop(), and GotSocketData().

const int SpeakerServer::RECEIVE_BUFFER_SIZE = 2048 [static, private]
 

Definition at line 30 of file SpeakerServer.h.

Referenced by DoStart().

class Buffer* SpeakerServer::resampled [private]
 

Definition at line 55 of file SpeakerServer.h.

Referenced by DoStop(), ResampleForSpeaker(), and ~SpeakerServer().

class Socket* SpeakerServer::socket [private]
 

Definition at line 26 of file SpeakerServer.h.

Referenced by DoStart(), and DoStop().


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

Tekkotsu v2.4.1
Generated Tue Aug 16 16:35:10 2005 by Doxygen 1.4.4