rasdaman complete source
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
soundPlayer Class Reference

#include <rviewSound.hh>

Public Member Functions

 soundPlayer (void)
 
 soundPlayer (int frq, int ch, FILE *fp, rviewSoundFormat fmt, int lat=RVIEW_SND_LATENCY)
 
 soundPlayer (int frq, int ch, const signed char *data, int len, rviewSoundFormat fmt=rsf_lin8, int lat=RVIEW_SND_LATENCY)
 
 soundPlayer (int frq, int ch, const unsigned char *data, int len, rviewSoundFormat fmt=rsf_ulaw8, int lat=RVIEW_SND_LATENCY)
 
 soundPlayer (int frq, int ch, const short *data, int len, rviewSoundFormat fmt=rsf_lin16, int lat=RVIEW_SND_LATENCY)
 
 ~soundPlayer (void)
 
int newSample (int frq, int ch, FILE *fp, rviewSoundFormat fmt, int lat=RVIEW_SND_LATENCY)
 
int newSample (int frq, int ch, const signed char *data, int len, rviewSoundFormat=rsf_lin8, int lat=RVIEW_SND_LATENCY)
 
int newSample (int frq, int ch, const unsigned char *data, int len, rviewSoundFormat=rsf_ulaw8, int lat=RVIEW_SND_LATENCY)
 
int newSample (int frq, int ch, const short *data, int len, rviewSoundFormat=rsf_lin16, int lat=RVIEW_SND_LATENCY)
 
int playbackGetOffset (void)
 
int playbackActive (void)
 
void playbackSuspend (void)
 
void playbackResume (void)
 
void playbackStop (void)
 
int playbackSetPosition (int position)
 
int playbackLoopMode (int lpMode)
 
void writeSamples (DWORD systime)
 
void writeSamples (void)
 

Protected Member Functions

void setupVariables (void)
 
const char * ensureSamplesForDevice (const char *source, int len)
 
const char * ensureSamples (int &num)
 
int configureDevice (int frq, int ch, int len, rviewSoundFormat fmt, int lat)
 
void ensureUlawTable (int ulawsize)
 
void ensureLinearTable (void)
 
char * ensureConvBuff (int size)
 
char * ensureSampleBuff (int size)
 
int setTimerInterval (unsigned int ti)
 
int startTimer (int ap=1)
 
int stopTimer (int ap=1)
 
int handleOutOfData (int dataSize)
 
void freeWaveHeaders (void)
 

Protected Attributes

rviewSoundFormat format
 
rviewSoundFormat devFormat
 
int sampleSize
 
int devSampSize
 
FILE * sampleFile
 
int dataOffset
 
int inLength
 
int frequency
 
int channels
 
int latency
 
int samplesWriteahead
 
int buffSize
 
int cbuffSize
 
char * buffer
 
char * convBuff
 
const char * inData
 
unsigned char * LinToUlaw
 
short * UlawToLin
 
int ldUlawSize
 
int samplesWritten
 
soundPlayersuspendedPlayer
 
int loopMode
 
bool timerActive
 
HWAVEOUT waveOut
 
WAVEFORMATEX waveFmt
 
WAVEHDR waveHdrs [RVIEW_SND_BUFFERS]
 
UINT timerID
 
DWORD lastSyncTime
 
int currentHeader
 
int emptyBuffers
 
int audioDevice
 
struct timeval lastSyncTime
 
struct sigaction oact
 
struct itimerval ovalue
 

Constructor & Destructor Documentation

soundPlayer::soundPlayer ( void  )
soundPlayer::soundPlayer ( int  frq,
int  ch,
FILE *  fp,
rviewSoundFormat  fmt,
int  lat = RVIEW_SND_LATENCY 
)
soundPlayer::soundPlayer ( int  frq,
int  ch,
const signed char *  data,
int  len,
rviewSoundFormat  fmt = rsf_lin8,
int  lat = RVIEW_SND_LATENCY 
)
soundPlayer::soundPlayer ( int  frq,
int  ch,
const unsigned char *  data,
int  len,
rviewSoundFormat  fmt = rsf_ulaw8,
int  lat = RVIEW_SND_LATENCY 
)
soundPlayer::soundPlayer ( int  frq,
int  ch,
const short *  data,
int  len,
rviewSoundFormat  fmt = rsf_lin16,
int  lat = RVIEW_SND_LATENCY 
)
soundPlayer::~soundPlayer ( void  )

Member Function Documentation

int soundPlayer::configureDevice ( int  frq,
int  ch,
int  len,
rviewSoundFormat  fmt,
int  lat 
)
protected
char* soundPlayer::ensureConvBuff ( int  size)
protected
void soundPlayer::ensureLinearTable ( void  )
protected
char* soundPlayer::ensureSampleBuff ( int  size)
protected
const char* soundPlayer::ensureSamples ( int &  num)
protected
const char* soundPlayer::ensureSamplesForDevice ( const char *  source,
int  len 
)
protected
void soundPlayer::ensureUlawTable ( int  ulawsize)
protected
void soundPlayer::freeWaveHeaders ( void  )
protected
int soundPlayer::handleOutOfData ( int  dataSize)
protected
int soundPlayer::newSample ( int  frq,
int  ch,
FILE *  fp,
rviewSoundFormat  fmt,
int  lat = RVIEW_SND_LATENCY 
)
int soundPlayer::newSample ( int  frq,
int  ch,
const signed char *  data,
int  len,
rviewSoundFormat  = rsf_lin8,
int  lat = RVIEW_SND_LATENCY 
)
int soundPlayer::newSample ( int  frq,
int  ch,
const unsigned char *  data,
int  len,
rviewSoundFormat  = rsf_ulaw8,
int  lat = RVIEW_SND_LATENCY 
)
int soundPlayer::newSample ( int  frq,
int  ch,
const short *  data,
int  len,
rviewSoundFormat  = rsf_lin16,
int  lat = RVIEW_SND_LATENCY 
)
int soundPlayer::playbackActive ( void  )
int soundPlayer::playbackGetOffset ( void  )
int soundPlayer::playbackLoopMode ( int  lpMode)
void soundPlayer::playbackResume ( void  )
int soundPlayer::playbackSetPosition ( int  position)
void soundPlayer::playbackStop ( void  )
void soundPlayer::playbackSuspend ( void  )
int soundPlayer::setTimerInterval ( unsigned int  ti)
protected
void soundPlayer::setupVariables ( void  )
protected
int soundPlayer::startTimer ( int  ap = 1)
protected
int soundPlayer::stopTimer ( int  ap = 1)
protected
void soundPlayer::writeSamples ( DWORD  systime)
void soundPlayer::writeSamples ( void  )

Member Data Documentation

int soundPlayer::audioDevice
protected
char* soundPlayer::buffer
protected
int soundPlayer::buffSize
protected
int soundPlayer::cbuffSize
protected
int soundPlayer::channels
protected
char * soundPlayer::convBuff
protected
int soundPlayer::currentHeader
protected
int soundPlayer::dataOffset
protected
rviewSoundFormat soundPlayer::devFormat
protected
int soundPlayer::devSampSize
protected
int soundPlayer::emptyBuffers
protected
rviewSoundFormat soundPlayer::format
protected
int soundPlayer::frequency
protected
const char* soundPlayer::inData
protected
int soundPlayer::inLength
protected
DWORD soundPlayer::lastSyncTime
protected
struct timeval soundPlayer::lastSyncTime
protected
int soundPlayer::latency
protected
int soundPlayer::ldUlawSize
protected
unsigned char* soundPlayer::LinToUlaw
protected
int soundPlayer::loopMode
protected
struct sigaction soundPlayer::oact
protected
struct itimerval soundPlayer::ovalue
protected
FILE* soundPlayer::sampleFile
protected
int soundPlayer::sampleSize
protected
int soundPlayer::samplesWriteahead
protected
int soundPlayer::samplesWritten
protected
soundPlayer* soundPlayer::suspendedPlayer
protected
bool soundPlayer::timerActive
protected
UINT soundPlayer::timerID
protected
short* soundPlayer::UlawToLin
protected
WAVEFORMATEX soundPlayer::waveFmt
protected
WAVEHDR soundPlayer::waveHdrs[RVIEW_SND_BUFFERS]
protected
HWAVEOUT soundPlayer::waveOut
protected

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