audiere::MixerDevice Class Reference

Always produce 16-bit, stereo audio at the specified rate. More...

#include <device_mixer.h>

Inheritance diagram for audiere::MixerDevice:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MixerDevice (int rate)
OutputStreamopenStream (SampleSource *source)
OutputStreamopenBuffer (void *samples, int frame_count, int channel_count, int sample_rate, SampleFormat sample_format)

Protected Member Functions

int read (int sample_count, void *samples)

Friends

class MixerStream

Detailed Description

Always produce 16-bit, stereo audio at the specified rate.

Definition at line 25 of file device_mixer.h.


Constructor & Destructor Documentation

audiere::MixerDevice::MixerDevice int  rate  ) 
 

Definition at line 14 of file device_mixer.cpp.


Member Function Documentation

OutputStream * audiere::MixerDevice::openBuffer void *  samples,
int  frame_count,
int  channel_count,
int  sample_rate,
SampleFormat  sample_format
[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

Implements audiere::AudioDevice.

Definition at line 26 of file device_mixer.cpp.

References audiere::OpenBufferStream(), and openStream().

OutputStream * audiere::MixerDevice::openStream SampleSource source  )  [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

Implements audiere::AudioDevice.

Definition at line 20 of file device_mixer.cpp.

References MixerStream.

Referenced by openBuffer().

int audiere::MixerDevice::read int  sample_count,
void *  samples
[protected]
 

Definition at line 37 of file device_mixer.cpp.

References SYNCHRONIZED.

Referenced by audiere::OSSAudioDevice::update(), and audiere::ALAudioDevice::update().


Friends And Related Function Documentation

friend class MixerStream [friend]
 

Definition at line 48 of file device_mixer.h.

Referenced by openStream().


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