gxAudioCard Class Reference

Writes audio data to a sound card . More...

#include <gxAudioCard.h>

List of all members.

Public Types

enum  state_t { STATE_CLOSED, STATE_OPEN, STATE_STARTED }

Public Member Functions

 gxAudioCard ()
virtual ~gxAudioCard ()
virtual int write (float *samples, int sampleCount)=0
 Write some audio frames to the stream.
virtual bool readyToWrite ()=0
 Always invoke readyToWrite and ensure it returns true before writing.
virtual bool lookup (const char *driverName)=0
 Lookup the named device.
virtual int open (int framesPerBuffer, int sampleRate)=0
 Opens the audio stream for output, but does not play sound.
virtual int start ()=0
 Starts playing the sound.
virtual int stop ()=0
 Stops playing the sound.
virtual int close ()=0
 Close the audio stream.
virtual state_t getState ()=0
 Get the card's state (closed, open, started).
virtual bool isClockSource (gxAudioClockSource **sourceInterface)=0
 Specifies whether this filter is a clock source, and if so, provides a reference to the gxAudioClockSource interface implemented by this filter.


Detailed Description

Writes audio data to a sound card .

.. so we can hear all this stuff.

To use this class, perform the following steps:

TODO: fix up the result values from open,start,stop,close


Member Enumeration Documentation

enum gxAudioCard::state_t
 

Enumerator:
STATE_CLOSED 
STATE_OPEN 
STATE_STARTED 


Constructor & Destructor Documentation

gxAudioCard::gxAudioCard  )  [inline]
 

virtual gxAudioCard::~gxAudioCard  )  [inline, virtual]
 


Member Function Documentation

virtual int gxAudioCard::close  )  [pure virtual]
 

Close the audio stream.

virtual state_t gxAudioCard::getState  )  [pure virtual]
 

Get the card's state (closed, open, started).

virtual bool gxAudioCard::isClockSource gxAudioClockSource **  sourceInterface  )  [pure virtual]
 

Specifies whether this filter is a clock source, and if so, provides a reference to the gxAudioClockSource interface implemented by this filter.

virtual bool gxAudioCard::lookup const char *  driverName  )  [pure virtual]
 

Lookup the named device.

Returns true if the device exists. Otherwise returns false.

TODO: Lookup device grabs some internal device info such as supported sample rates etc. Should add some accessors to allow application to retreive this information.

virtual int gxAudioCard::open int  framesPerBuffer,
int  sampleRate
[pure virtual]
 

Opens the audio stream for output, but does not play sound.

virtual bool gxAudioCard::readyToWrite  )  [pure virtual]
 

Always invoke readyToWrite and ensure it returns true before writing.

virtual int gxAudioCard::start  )  [pure virtual]
 

Starts playing the sound.

Callbacks will be invoked, the notification event will be signaled periodically and writes will be allowed as audio data moves through the system.

virtual int gxAudioCard::stop  )  [pure virtual]
 

Stops playing the sound.

virtual int gxAudioCard::write float *  samples,
int  sampleCount
[pure virtual]
 

Write some audio frames to the stream.

"samples" is a pointer to the beginning of an array of interlaced audio samples. sampleCount indicates the number of samples in the array. Each frame contains one floating point number for each audio channel. So, for a stereo stream, the sample array will contain 2 x samplecount floating point numbers.

After a successful write, the readyToWrite bit is false. Do not perform any more writes until readyToWrite becomes true.

returns - the number of samples actually written


The documentation for this class was generated from the following file:
Generated on Mon Nov 21 01:01:36 2005 for gxLib by  doxygen 1.4.5