![]() |
Blender V2.61 - r43446
|
#include <AUD_Mixer.h>
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 |
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.
| AUD_Mixer::AUD_Mixer | ( | AUD_DeviceSpecs | specs | ) |
Creates the mixer.
Definition at line 35 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 74 of file AUD_Mixer.h.
| void AUD_Mixer::clear | ( | int | length | ) |
Clears the mixing buffer.
| length | The 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.
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.
| 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 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.
| buffer | The target buffer for superposing. |
| volume | The 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.
| specs | The target specification. |
Definition at line 73 of file AUD_Mixer.cpp.
References m_specs, and AUD_DeviceSpecs::specs.
AUD_Buffer AUD_Mixer::m_buffer [protected] |
The mixing buffer.
Definition at line 58 of file AUD_Mixer.h.
AUD_convert_f AUD_Mixer::m_convert [protected] |
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.
AUD_DeviceSpecs AUD_Mixer::m_specs [protected] |
The output specification.
Definition at line 48 of file AUD_Mixer.h.
Referenced by AUD_Mixer(), clear(), getSpecs(), mix(), read(), and setSpecs().