|
Blender
V2.59
|
#include <AUD_Mixer.h>

Public Member Functions | |
| AUD_Mixer (AUD_DeviceSpecs specs) | |
| virtual | ~AUD_Mixer () |
| AUD_DeviceSpecs | getSpecs () const |
| virtual AUD_IReader * | prepare (AUD_IReader *reader)=0 |
| virtual void | add (sample_t *buffer, int start, int length, float volume) |
| virtual void | superpose (data_t *buffer, int length, float volume) |
Protected Attributes | |
| std::list< AUD_MixerBuffer > | m_buffers |
| const AUD_DeviceSpecs | m_specs |
| AUD_Buffer | m_buffer |
| AUD_convert_f | m_convert |
This abstract class is able to mix audiosignals of different channel count and sample rate and convert it to a specific output format.
Definition at line 52 of file AUD_Mixer.h.
| AUD_Mixer::AUD_Mixer | ( | AUD_DeviceSpecs | specs | ) |
Creates the mixer.
Definition at line 37 of file AUD_Mixer.cpp.
References AUD_convert_float_double(), AUD_convert_float_s16(), AUD_convert_float_s24_be(), AUD_convert_float_s24_le(), AUD_convert_float_s32(), AUD_convert_float_u8(), AUD_FORMAT_FLOAT32, AUD_FORMAT_FLOAT64, AUD_FORMAT_S16, AUD_FORMAT_S24, AUD_FORMAT_S32, AUD_FORMAT_U8, AUD_DeviceSpecs::format, m_convert, and m_specs.
| virtual AUD_Mixer::~AUD_Mixer | ( | ) | [inline, virtual] |
Destroys the mixer.
Definition at line 84 of file AUD_Mixer.h.
| void AUD_Mixer::add | ( | sample_t * | buffer, |
| int | start, | ||
| int | length, | ||
| float | volume | ||
| ) | [virtual] |
Adds a buffer for superposition.
| buffer | The buffer to superpose. |
| start | The start sample of the buffer. |
| length | The length of the buffer in samples. |
| volume | The mixing volume. Must be a value between 0.0 and 1.0. |
Definition at line 76 of file AUD_Mixer.cpp.
References AUD_MixerBuffer::buffer, AUD_MixerBuffer::length, length(), m_buffers, AUD_MixerBuffer::start, and AUD_MixerBuffer::volume.
Referenced by AUD_SoftwareDevice::mix(), and AUD_SequencerReader::read().
| AUD_DeviceSpecs AUD_Mixer::getSpecs | ( | ) | const |
Returns the target specification for superposing.
Definition at line 71 of file AUD_Mixer.cpp.
References m_specs.
Referenced by AUD_SequencerReader::getSpecs(), and AUD_SequencerReader::read().
| virtual AUD_IReader* AUD_Mixer::prepare | ( | AUD_IReader * | reader | ) | [pure virtual] |
This funuction prepares a reader for playback.
| reader | The reader to prepare. |
Implemented in AUD_DefaultMixer.
Referenced by AUD_SequencerReader::add(), AUD_SequencerReader::AUD_SequencerReader(), AUD_SoftwareDevice::play(), and AUD_SequencerReader::read().
| void AUD_Mixer::superpose | ( | data_t * | buffer, |
| int | length, | ||
| float | volume | ||
| ) | [virtual] |
Superposes all added buffers into an output buffer.
| buffer | The target buffer for superposing. |
| length | The length of the buffer in samples. |
| volume | The mixing volume. Must be a value between 0.0 and 1.0. |
Definition at line 86 of file AUD_Mixer.cpp.
References AUD_MixerBuffer::buffer, AUD_DeviceSpecs::channels, AUD_Buffer::getBuffer(), AUD_Buffer::getSize(), i, AUD_MixerBuffer::length, m_buffer, m_buffers, m_convert, m_specs, AUD_Buffer::resize(), AUD_MixerBuffer::start, and AUD_MixerBuffer::volume.
Referenced by AUD_SoftwareDevice::mix(), and AUD_SequencerReader::read().
AUD_Buffer AUD_Mixer::m_buffer [protected] |
std::list<AUD_MixerBuffer> AUD_Mixer::m_buffers [protected] |
The list of buffers to superpose.
Definition at line 58 of file AUD_Mixer.h.
Referenced by add(), and superpose().
AUD_convert_f AUD_Mixer::m_convert [protected] |
Converter function.
Definition at line 73 of file AUD_Mixer.h.
Referenced by AUD_Mixer(), and superpose().
const AUD_DeviceSpecs AUD_Mixer::m_specs [protected] |
The output specification.
Definition at line 63 of file AUD_Mixer.h.
Referenced by AUD_Mixer(), getSpecs(), AUD_DefaultMixer::prepare(), and superpose().