audiere::AudioDevice Class Reference

#include <audiere.h>

Inheritance diagram for audiere::AudioDevice:

Inheritance graph
[legend]
Collaboration diagram for audiere::AudioDevice:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void update ()=0
virtual OutputStreamopenStream (SampleSource *source)=0
virtual OutputStreamopenBuffer (void *samples, int frame_count, int channel_count, int sample_rate, SampleFormat sample_format)=0
virtual const char * getName ()=0
virtual void registerCallback (Callback *callback)=0
virtual void unregisterCallback (Callback *callback)=0
virtual void clearCallbacks ()=0

Protected Member Functions

 ~AudioDevice ()

Detailed Description

AudioDevice represents a device on the system which is capable of opening and mixing multiple output streams. In Windows, DirectSound is such a device.

This interface is synchronized. update() and openStream() may be called on different threads.

Definition at line 696 of file audiere.h.


Constructor & Destructor Documentation

audiere::AudioDevice::~AudioDevice  )  [inline, protected]
 

Definition at line 698 of file audiere.h.


Member Function Documentation

virtual void audiere::AudioDevice::clearCallbacks  )  [pure virtual]
 

Clears all of the callbacks from the device.

virtual const char* audiere::AudioDevice::getName  )  [pure virtual]
 

Gets the name of the audio device. For example "directsound" or "oss".

Returns:
name of audio device

virtual OutputStream* audiere::AudioDevice::openBuffer void *  samples,
int  frame_count,
int  channel_count,
int  sample_rate,
SampleFormat  sample_format
[pure virtual]
 

Open a single buffer with the specified PCM data. This is sometimes more efficient than streaming and works on a larger variety of audio devices. In some implementations, this may download the audio data to the sound card's memory itself.

Parameters:
samples Buffer containing sample data. openBuffer() does not take ownership of the memory. The application is responsible for freeing it. There must be at least |frame_count * channel_count * GetSampleSize(sample_format)| bytes in the buffer.
frame_count Number of frames in the buffer.
channel_count Number of audio channels. 1 = mono, 2 = stereo.
sample_rate Number of samples per second.
sample_format Format of samples in buffer.
Returns:
new output stream if successful, 0 if failure

virtual OutputStream* audiere::AudioDevice::openStream SampleSource source  )  [pure virtual]
 

Open an output stream with a given sample source. If the sample source ever runs out of data, the output stream automatically stops itself.

The output stream takes ownership of the sample source, even if opening the output stream fails (in which case the source is immediately deleted).

Parameters:
source the source used to feed the output stream with samples
Returns:
new output stream if successful, 0 if failure

virtual void audiere::AudioDevice::registerCallback Callback callback  )  [pure virtual]
 

Registers 'callback' to receive events. Callbacks can be registered multiple times.

virtual void audiere::AudioDevice::unregisterCallback Callback callback  )  [pure virtual]
 

Unregisters 'callback' once. If it is registered multiple times, each unregisterStopCallback call unregisters one of the instances.

virtual void audiere::AudioDevice::update  )  [pure virtual]
 

Tell the device to do any internal state updates. Some devices update on an internal thread. If that is the case, this method does nothing.


The documentation for this class was generated from the following file:
Generated on Mon Feb 13 23:07:23 2006 for audiere by  doxygen 1.4.6