audiere::DSAudioDevice Class Reference

#include <device_ds.h>

Inheritance diagram for audiere::DSAudioDevice:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

void update ()
OutputStreamopenStream (SampleSource *source)
OutputStreamopenBuffer (void *samples, int frame_count, int channel_count, int sample_rate, SampleFormat sample_format)
const char * getName ()

Static Public Member Functions

static DSAudioDevicecreate (const ParameterList &parameters)
static int Volume_AudiereToDirectSound (float volume)
static int Pan_AudiereToDirectSound (float pan)

Friends

class DSOutputBuffer
class DSOutputStream

Detailed Description

Definition at line 27 of file device_ds.h.


Member Function Documentation

DSAudioDevice * audiere::DSAudioDevice::create const ParameterList parameters  )  [static]
 

Definition at line 17 of file device_ds.cpp.

References ADR_GUARD, ADR_LOG, audiere::ParameterList::getBoolean(), audiere::ParameterList::getInt(), and audiere::ParameterList::getValue().

const char * audiere::DSAudioDevice::getName  )  [virtual]
 

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

Returns:
name of audio device

Implements audiere::AudioDevice.

Definition at line 326 of file device_ds.cpp.

OutputStream * audiere::DSAudioDevice::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 239 of file device_ds.cpp.

References ADR_GUARD, ADR_IF_DEBUG, ADR_LOG, DSOutputBuffer, audiere::GetSampleSize(), and SYNCHRONIZED.

OutputStream * audiere::DSAudioDevice::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 180 of file device_ds.cpp.

References ADR_GUARD, ADR_LOG, DSOutputStream, audiere::SampleSource::getFormat(), audiere::GetSampleSize(), and SYNCHRONIZED.

int audiere::DSAudioDevice::Pan_AudiereToDirectSound float  pan  )  [static]
 

Definition at line 357 of file device_ds.cpp.

References Volume_AudiereToDirectSound().

Referenced by audiere::DSOutputStream::setPan(), and audiere::DSOutputBuffer::setPan().

void audiere::DSAudioDevice::update  )  [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.

Implements audiere::AudioDevice.

Definition at line 152 of file device_ds.cpp.

References ADR_GUARD, and SYNCHRONIZED.

int audiere::DSAudioDevice::Volume_AudiereToDirectSound float  volume  )  [static]
 

DirectSound treats volumes and pan levels as decibels (exponential growth like the Richter scale). We want a linear ramp. Do the conversion!

Definition at line 346 of file device_ds.cpp.

Referenced by Pan_AudiereToDirectSound(), audiere::DSOutputStream::setVolume(), and audiere::DSOutputBuffer::setVolume().


Friends And Related Function Documentation

friend class DSOutputBuffer [friend]
 

Definition at line 73 of file device_ds.h.

Referenced by openBuffer().

friend class DSOutputStream [friend]
 

Definition at line 74 of file device_ds.h.

Referenced by openStream().


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