|
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 SpeakerServer * | GetInstance () |
| | 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
|
|
SpeakerServer & | operator= (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 |
| Socket * | socket |
|
Packet | packet |
|
Buffer * | frame |
|
Buffer * | resampled |
|
SoundManager::Play_ID | channel |
Static Private Attributes |
|
static SpeakerServer * | instance = 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...
|