Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

MicrophoneServer Class Reference

#include <MicrophoneServer.h>

Inheritance diagram for MicrophoneServer:

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

static MicrophoneServergetInstance ()
 enforces singleton status
static bool SetMicrophoneUnidirectional (bool unidirectional)
 makes Aperios-specific call to set microphone mode
static bool SetMicrophoneAlcEnabled (bool enabled)
 makes Aperios-specific call to set microphone mode

Private Member Functions

 MicrophoneServer ()
 constructor
 MicrophoneServer (const MicrophoneServer &rhs)
 don't call
MicrophoneServeroperator= (const MicrophoneServer &rhs)
 don't call
unsigned int GetResampledFrameSize (unsigned int samplesSize, unsigned int newSampleRate, unsigned int newSampleBits, bool newStereo)
 returns size of a "frame" at the given sampling rate and resolution
unsigned int ResampleFrame (const char *samples, unsigned int samplesSize, unsigned int &newSampleRate, unsigned int &newSampleBits, bool &newStereo, void *newSamples, unsigned int newSamplesSize)
 performs sampling to a specified rate and resolution, stores into newSamples (which you must allocate)

Static Private Member Functions

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

Private Attributes

class Socketsocket
 socket for communication

Static Private Attributes

static const unsigned int SEND_BUFFER_SIZE = 2048 + 16
 max transmission buffer size for socket
static MicrophoneServerinstance = 0
 global instance of the server
static const char *const MIC_LOCATOR = "PRM:/r1/c1/c2/c3/m1-Mic:M1"
 aperios specific identifier for microphone access

Constructor & Destructor Documentation

MicrophoneServer::~MicrophoneServer (  )  [virtual]

destructor

Definition at line 29 of file MicrophoneServer.cc.

MicrophoneServer::MicrophoneServer (  )  [private]

constructor

Definition at line 23 of file MicrophoneServer.cc.

Referenced by getInstance().

MicrophoneServer::MicrophoneServer ( const MicrophoneServer rhs  )  [private]

don't call


Member Function Documentation

MicrophoneServer & MicrophoneServer::getInstance (  )  [static]

enforces singleton status

Definition at line 16 of file MicrophoneServer.cc.

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 36 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 52 of file MicrophoneServer.cc.

void MicrophoneServer::processEvent ( const EventBase  )  [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 64 of file MicrophoneServer.cc.

bool MicrophoneServer::SetMicrophoneUnidirectional ( bool  unidirectional  )  [static]

makes Aperios-specific call to set microphone mode

Definition at line 232 of file MicrophoneServer.cc.

bool MicrophoneServer::SetMicrophoneAlcEnabled ( bool  enabled  )  [static]

makes Aperios-specific call to set microphone mode

Definition at line 251 of file MicrophoneServer.cc.

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

don't call

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

returns size of a "frame" at the given sampling rate and resolution

Definition at line 111 of file MicrophoneServer.cc.

Referenced by processEvent().

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

performs sampling to a specified rate and resolution, stores into newSamples (which you must allocate)

Definition at line 142 of file MicrophoneServer.cc.

Referenced by processEvent().

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

writes value to dst and advances dst

Definition at line 58 of file MicrophoneServer.h.

Referenced by processEvent().

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

writes length bytes from src to dst

Definition at line 65 of file MicrophoneServer.h.


Member Data Documentation

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

max transmission buffer size for socket

Definition at line 26 of file MicrophoneServer.h.

Referenced by DoStart().

global instance of the server

Definition at line 31 of file MicrophoneServer.h.

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

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

aperios specific identifier for microphone access

Definition at line 51 of file MicrophoneServer.h.

class Socket* MicrophoneServer::socket [private]

socket for communication

Definition at line 54 of file MicrophoneServer.h.

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


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

Tekkotsu v4.0
Generated Thu Nov 22 00:58:32 2007 by Doxygen 1.5.4