#include <gxAudioCard.h>
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. |
.. 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
|
|
|
|
|
|
|
Close the audio stream.
|
|
Get the card's state (closed, open, started).
|
|
Specifies whether this filter is a clock source, and if so, provides a reference to the gxAudioClockSource interface implemented by this filter.
|
|
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. |
|
Opens the audio stream for output, but does not play sound.
|
|
Always invoke readyToWrite and ensure it returns true before writing.
|
|
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. |
|
Stops playing the sound.
|
|
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 |