Homepage Demos Overview Downloads Tutorials Reference
Credits

MicrophoneServer Class Reference

#include <MicrophoneServer.h>

Inheritance diagram for MicrophoneServer:

Inheritance graph
[legend]
List of all members.

Detailed Description

Streams audio from the microphone over the network.

Definition at line 9 of file MicrophoneServer.h.

Public Member Functions

virtual ~MicrophoneServer ()
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 ).
virtual void processEvent (const EventBase &event)
 By defining here, allows you to get away with not supplying a processEvent() function for the EventListener interface. By default, does nothing.

Static Public Member Functions

MicrophoneServerGetInstance ()
bool SetMicrophoneUnidirectional (bool unidirectional)
bool SetMicrophoneAlcEnabled (bool enabled)

Private Member Functions

 MicrophoneServer ()
 MicrophoneServer (const MicrophoneServer &rhs)
MicrophoneServeroperator= (const MicrophoneServer &rhs)
unsigned int GetResampledFrameSize (unsigned int samplesSize, unsigned int newSampleRate, unsigned int newSampleBits, bool newStereo)
unsigned int ResampleFrame (const char *samples, unsigned int samplesSize, unsigned int &newSampleRate, unsigned int &newSampleBits, bool &newStereo, void *newSamples, unsigned int newSamplesSize)

Static Private Member Functions

template<class T>
void encode (char **dst, const T &value)
 writes value to dst and advances dst
template<class T>
void encode (char **dst, const T *src, int num)
 writes length bytes from src to dst

Private Attributes

Socketsocket

Static Private Attributes

const unsigned int SEND_BUFFER_SIZE = 2048 + 16
MicrophoneServerinstance = 0
const char *const MIC_LOCATOR = "PRM:/r1/c1/c2/c3/m1-Mic:M1"


Constructor & Destructor Documentation

MicrophoneServer::~MicrophoneServer  )  [virtual]
 

Definition at line 26 of file MicrophoneServer.cc.

MicrophoneServer::MicrophoneServer  )  [private]
 

Definition at line 20 of file MicrophoneServer.cc.

Referenced by GetInstance().

MicrophoneServer::MicrophoneServer const MicrophoneServer rhs  )  [private]
 


Member Function Documentation

void MicrophoneServer::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 33 of file MicrophoneServer.cc.

void MicrophoneServer::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 49 of file MicrophoneServer.cc.

template<class T>
void MicrophoneServer::encode char **  dst,
const T *  src,
int  num
[inline, static, private]
 

writes length bytes from src to dst

Definition at line 57 of file MicrophoneServer.h.

template<class T>
void MicrophoneServer::encode char **  dst,
const T &  value
[inline, static, private]
 

writes value to dst and advances dst

Definition at line 50 of file MicrophoneServer.h.

Referenced by processEvent().

MicrophoneServer * MicrophoneServer::GetInstance  )  [static]
 

Definition at line 13 of file MicrophoneServer.cc.

unsigned int MicrophoneServer::GetResampledFrameSize unsigned int  samplesSize,
unsigned int  newSampleRate,
unsigned int  newSampleBits,
bool  newStereo
[private]
 

Definition at line 108 of file MicrophoneServer.cc.

Referenced by processEvent().

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

void MicrophoneServer::processEvent const EventBase event  )  [virtual]
 

By defining here, allows you to get away with not supplying a processEvent() function for the EventListener interface. By default, does nothing.

Reimplemented from BehaviorBase.

Definition at line 61 of file MicrophoneServer.cc.

unsigned int MicrophoneServer::ResampleFrame const char *  samples,
unsigned int  samplesSize,
unsigned int &  newSampleRate,
unsigned int &  newSampleBits,
bool &  newStereo,
void *  newSamples,
unsigned int  newSamplesSize
[private]
 

Definition at line 139 of file MicrophoneServer.cc.

Referenced by processEvent().

bool MicrophoneServer::SetMicrophoneAlcEnabled bool  enabled  )  [static]
 

Definition at line 231 of file MicrophoneServer.cc.

bool MicrophoneServer::SetMicrophoneUnidirectional bool  unidirectional  )  [static]
 

Definition at line 215 of file MicrophoneServer.cc.


Member Data Documentation

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

Definition at line 10 of file MicrophoneServer.cc.

Referenced by GetInstance(), and ~MicrophoneServer().

const char *const MicrophoneServer::MIC_LOCATOR = "PRM:/r1/c1/c2/c3/m1-Mic:M1" [static, private]
 

Definition at line 11 of file MicrophoneServer.cc.

Referenced by SetMicrophoneAlcEnabled(), and SetMicrophoneUnidirectional().

const unsigned int MicrophoneServer::SEND_BUFFER_SIZE = 2048 + 16 [static, private]
 

Definition at line 22 of file MicrophoneServer.h.

Referenced by DoStart().

class Socket* MicrophoneServer::socket [private]
 

Definition at line 46 of file MicrophoneServer.h.

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


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

Tekkotsu v2.2.1
Generated Tue Nov 23 16:37:48 2004 by Doxygen 1.3.9.1