Blender V2.61 - r43446
Public Member Functions | Protected Attributes

AUD_Mixer Class Reference

#include <AUD_Mixer.h>

List of all members.

Public Member Functions

 AUD_Mixer (AUD_DeviceSpecs specs)
virtual ~AUD_Mixer ()
AUD_DeviceSpecs getSpecs () const
void setSpecs (AUD_Specs specs)
void mix (sample_t *buffer, int start, int length, float volume)
void read (data_t *buffer, float volume)
void clear (int length)

Protected Attributes

AUD_DeviceSpecs m_specs
int m_length
AUD_Buffer m_buffer
AUD_convert_f m_convert

Detailed Description

This abstract class is able to mix audiosignals with same channel count and sample rate and convert it to a specific output format.

Definition at line 42 of file AUD_Mixer.h.


Constructor & Destructor Documentation

AUD_Mixer::AUD_Mixer ( AUD_DeviceSpecs  specs)
virtual AUD_Mixer::~AUD_Mixer ( ) [inline, virtual]

Destroys the mixer.

Definition at line 74 of file AUD_Mixer.h.


Member Function Documentation

void AUD_Mixer::clear ( int  length)

Clears the mixing buffer.

Parameters:
lengthThe length of the buffer in samples.

Definition at line 78 of file AUD_Mixer.cpp.

References AUD_Buffer::assureSize(), AUD_SAMPLE_SIZE, AUD_DeviceSpecs::channels, AUD_Buffer::getBuffer(), length(), m_buffer, m_length, and m_specs.

AUD_DeviceSpecs AUD_Mixer::getSpecs ( ) const

Returns the target specification for superposing.

Returns:
The target specification.

Definition at line 68 of file AUD_Mixer.cpp.

References m_specs.

void AUD_Mixer::mix ( sample_t buffer,
int  start,
int  length,
float  volume 
)

Mixes a buffer.

Parameters:
bufferThe buffer to superpose.
startThe start sample of the buffer.
lengthThe length of the buffer in samples.
volumeThe mixing volume. Must be a value between 0.0 and 1.0.

Definition at line 87 of file AUD_Mixer.cpp.

References AUD_MIN, AUD_DeviceSpecs::channels, AUD_Buffer::getBuffer(), i, m_buffer, m_length, and m_specs.

void AUD_Mixer::read ( data_t buffer,
float  volume 
)

Writes the mixing buffer into an output buffer.

Parameters:
bufferThe target buffer for superposing.
volumeThe mixing volume. Must be a value between 0.0 and 1.0.

Definition at line 98 of file AUD_Mixer.cpp.

References AUD_DeviceSpecs::channels, AUD_Buffer::getBuffer(), i, m_buffer, m_convert, m_length, and m_specs.

void AUD_Mixer::setSpecs ( AUD_Specs  specs)

Sets the target specification for superposing.

Parameters:
specsThe target specification.

Definition at line 73 of file AUD_Mixer.cpp.

References m_specs, and AUD_DeviceSpecs::specs.


Member Data Documentation

The mixing buffer.

Definition at line 58 of file AUD_Mixer.h.

Referenced by clear(), mix(), and read().

Converter function.

Definition at line 63 of file AUD_Mixer.h.

Referenced by AUD_Mixer(), and read().

int AUD_Mixer::m_length [protected]

The length of the mixing buffer.

Definition at line 53 of file AUD_Mixer.h.

Referenced by clear(), mix(), and read().

The output specification.

Definition at line 48 of file AUD_Mixer.h.

Referenced by AUD_Mixer(), clear(), getSpecs(), mix(), read(), and setSpecs().


The documentation for this class was generated from the following files: