Blender V2.61 - r43446
|
#include <AUD_SoftwareDevice.h>
Classes | |
class | AUD_SoftwareHandle |
Saves the data for playback. More... | |
Public Member Functions | |
void | setQuality (bool quality) |
virtual AUD_DeviceSpecs | getSpecs () const |
virtual AUD_Reference < AUD_IHandle > | play (AUD_Reference< AUD_IReader > reader, bool keep=false) |
virtual AUD_Reference < AUD_IHandle > | play (AUD_Reference< AUD_IFactory > factory, bool keep=false) |
virtual void | stopAll () |
virtual void | lock () |
virtual void | unlock () |
virtual float | getVolume () const |
virtual void | setVolume (float volume) |
virtual AUD_Vector3 | getListenerLocation () const |
virtual void | setListenerLocation (const AUD_Vector3 &location) |
virtual AUD_Vector3 | getListenerVelocity () const |
virtual void | setListenerVelocity (const AUD_Vector3 &velocity) |
virtual AUD_Quaternion | getListenerOrientation () const |
virtual void | setListenerOrientation (const AUD_Quaternion &orientation) |
virtual float | getSpeedOfSound () const |
virtual void | setSpeedOfSound (float speed) |
virtual float | getDopplerFactor () const |
virtual void | setDopplerFactor (float factor) |
virtual AUD_DistanceModel | getDistanceModel () const |
virtual void | setDistanceModel (AUD_DistanceModel model) |
Static Public Member Functions | |
static void | setPanning (AUD_IHandle *handle, float pan) |
Protected Types | |
typedef std::list < AUD_Reference < AUD_SoftwareHandle > >::iterator | AUD_HandleIterator |
Protected Member Functions | |
void | create () |
void | destroy () |
void | mix (data_t *buffer, int length) |
virtual void | playing (bool playing)=0 |
void | setSpecs (AUD_Specs specs) |
Protected Attributes | |
AUD_DeviceSpecs | m_specs |
AUD_Reference< AUD_Mixer > | m_mixer |
bool | m_quality |
This device plays is a generic device with software mixing. Classes implementing this have to:
Definition at line 54 of file AUD_SoftwareDevice.h.
typedef std::list<AUD_Reference<AUD_SoftwareHandle> >::iterator AUD_SoftwareDevice::AUD_HandleIterator [protected] |
Definition at line 209 of file AUD_SoftwareDevice.h.
void AUD_SoftwareDevice::create | ( | ) | [protected] |
Initializes member variables.
Definition at line 656 of file AUD_SoftwareDevice.cpp.
References AUD_DISTANCE_MODEL_INVERSE_CLAMPED, m_mixer, m_quality, and m_specs.
Referenced by AUD_JackDevice::AUD_JackDevice(), AUD_ReadDevice::AUD_ReadDevice(), and AUD_SDLDevice::AUD_SDLDevice().
void AUD_SoftwareDevice::destroy | ( | ) | [protected] |
Uninitializes member variables.
Definition at line 676 of file AUD_SoftwareDevice.cpp.
References playing().
Referenced by AUD_JackDevice::AUD_JackDevice(), AUD_JackDevice::~AUD_JackDevice(), AUD_ReadDevice::~AUD_ReadDevice(), and AUD_SDLDevice::~AUD_SDLDevice().
AUD_DistanceModel AUD_SoftwareDevice::getDistanceModel | ( | ) | const [virtual] |
Retrieves the distance model.
Implements AUD_I3DDevice.
Definition at line 942 of file AUD_SoftwareDevice.cpp.
float AUD_SoftwareDevice::getDopplerFactor | ( | ) | const [virtual] |
Retrieves the doppler factor. This value is a scaling factor for the velocity vectors of sources and listener which is used while calculating the doppler effect.
Implements AUD_I3DDevice.
Definition at line 928 of file AUD_SoftwareDevice.cpp.
AUD_Vector3 AUD_SoftwareDevice::getListenerLocation | ( | ) | const [virtual] |
Retrieves the listener location.
Implements AUD_I3DDevice.
Definition at line 888 of file AUD_SoftwareDevice.cpp.
AUD_Quaternion AUD_SoftwareDevice::getListenerOrientation | ( | ) | const [virtual] |
Retrieves the listener orientation.
Implements AUD_I3DDevice.
Definition at line 908 of file AUD_SoftwareDevice.cpp.
AUD_Vector3 AUD_SoftwareDevice::getListenerVelocity | ( | ) | const [virtual] |
Retrieves the listener velocity.
Implements AUD_I3DDevice.
Definition at line 898 of file AUD_SoftwareDevice.cpp.
AUD_DeviceSpecs AUD_SoftwareDevice::getSpecs | ( | ) | const [virtual] |
Returns the specification of the device.
Implements AUD_IDevice.
Definition at line 804 of file AUD_SoftwareDevice.cpp.
References m_specs.
float AUD_SoftwareDevice::getSpeedOfSound | ( | ) | const [virtual] |
Retrieves the speed of sound. This value is needed for doppler effect calculation.
Implements AUD_I3DDevice.
Definition at line 918 of file AUD_SoftwareDevice.cpp.
float AUD_SoftwareDevice::getVolume | ( | ) | const [virtual] |
Retrieves the overall device volume.
Implements AUD_IDevice.
Definition at line 874 of file AUD_SoftwareDevice.cpp.
void AUD_SoftwareDevice::lock | ( | ) | [virtual] |
Locks the device. Used to make sure that between lock and unlock, no buffers are read, so that it is possible to start, resume, pause, stop or seek several playback handles simultaneously.
Implements AUD_IDevice.
Definition at line 864 of file AUD_SoftwareDevice.cpp.
Referenced by mix(), play(), stopAll(), and AUD_SDLDevice::~AUD_SDLDevice().
void AUD_SoftwareDevice::mix | ( | data_t * | buffer, |
int | length | ||
) | [protected] |
Mixes the next samples into the buffer.
buffer | The target buffer. |
length | The length in samples to be filled. |
Definition at line 690 of file AUD_SoftwareDevice.cpp.
References AUD_Buffer::assureSize(), AUD_SAMPLE_SIZE, AUD_Buffer::getBuffer(), len(), length(), lock(), m_mixer, m_specs, and unlock().
Referenced by AUD_ReadDevice::read().
AUD_Reference< AUD_IHandle > AUD_SoftwareDevice::play | ( | AUD_Reference< AUD_IReader > | reader, |
bool | keep = false |
||
) | [virtual] |
Plays a sound source.
reader | The reader to play. |
keep | When keep is true the sound source will not be deleted but set to paused when its end has been reached. |
AUD_Exception | Thrown if there's an unexpected (from the device side) error during creation of the reader. |
Implements AUD_IDevice.
Definition at line 809 of file AUD_SoftwareDevice.cpp.
References AUD_DeviceSpecs::channels, AUD_Reference< T >::isNull(), lock(), m_quality, m_specs, playing(), AUD_DeviceSpecs::specs, and unlock().
Referenced by AUD_openMixdownDevice(), AUD_SequencerHandle::AUD_SequencerHandle(), play(), and AUD_SequencerHandle::update().
AUD_Reference< AUD_IHandle > AUD_SoftwareDevice::play | ( | AUD_Reference< AUD_IFactory > | factory, |
bool | keep = false |
||
) | [virtual] |
Plays a sound source.
factory | The factory to create the reader for the sound source. |
keep | When keep is true the sound source will not be deleted but set to paused when its end has been reached. |
AUD_Exception | Thrown if there's an unexpected (from the device side) error during creation of the reader. |
Implements AUD_IDevice.
Definition at line 846 of file AUD_SoftwareDevice.cpp.
References play().
virtual void AUD_SoftwareDevice::playing | ( | bool | playing | ) | [protected, pure virtual] |
This function tells the device, to start or pause playback.
playing | True if device should playback. |
Implemented in AUD_ReadDevice, AUD_JackDevice, and AUD_SDLDevice.
void AUD_SoftwareDevice::setDistanceModel | ( | AUD_DistanceModel | model | ) | [virtual] |
Sets the distance model.
model | distance model. |
Implements AUD_I3DDevice.
Definition at line 947 of file AUD_SoftwareDevice.cpp.
References AUD_DISTANCE_MODEL_INVALID, and AUD_RENDER_DISTANCE.
Referenced by AUD_SequencerReader::read().
void AUD_SoftwareDevice::setDopplerFactor | ( | float | factor | ) | [virtual] |
Sets the doppler factor. This value is a scaling factor for the velocity vectors of sources and listener which is used while calculating the doppler effect.
factor | The new doppler factor. |
Implements AUD_I3DDevice.
Definition at line 933 of file AUD_SoftwareDevice.cpp.
References AUD_RENDER_DOPPLER.
Referenced by AUD_SequencerReader::read().
void AUD_SoftwareDevice::setListenerLocation | ( | const AUD_Vector3 & | location | ) | [virtual] |
Sets the listener location.
location | The new location. |
Implements AUD_I3DDevice.
Definition at line 893 of file AUD_SoftwareDevice.cpp.
Referenced by AUD_SequencerReader::read().
void AUD_SoftwareDevice::setListenerOrientation | ( | const AUD_Quaternion & | orientation | ) | [virtual] |
Sets the listener orientation.
orientation | The new orientation as quaternion. |
Implements AUD_I3DDevice.
Definition at line 913 of file AUD_SoftwareDevice.cpp.
Referenced by AUD_SequencerReader::read().
void AUD_SoftwareDevice::setListenerVelocity | ( | const AUD_Vector3 & | velocity | ) | [virtual] |
Sets the listener velocity.
velocity | The new velocity. |
Implements AUD_I3DDevice.
Definition at line 903 of file AUD_SoftwareDevice.cpp.
Referenced by AUD_SequencerReader::read().
void AUD_SoftwareDevice::setPanning | ( | AUD_IHandle * | handle, |
float | pan | ||
) | [static] |
Sets the panning of a specific handle.
handle | The handle to set the panning from. |
pan | The new panning value, should be in the range [-2, 2]. |
Definition at line 782 of file AUD_SoftwareDevice.cpp.
References AUD_SoftwareDevice::AUD_SoftwareHandle::m_user_pan.
Referenced by AUD_SequencerHandle::update().
void AUD_SoftwareDevice::setQuality | ( | bool | quality | ) |
Sets the resampling quality.
quality | Low (false) or high (true) quality. |
Definition at line 788 of file AUD_SoftwareDevice.cpp.
References m_quality.
Referenced by AUD_openMixdownDevice(), and AUD_SequencerReader::AUD_SequencerReader().
void AUD_SoftwareDevice::setSpecs | ( | AUD_Specs | specs | ) | [protected] |
Sets the audio output specification of the device.
sepcs | The output specification. |
Definition at line 793 of file AUD_SoftwareDevice.cpp.
References m_mixer, m_specs, and AUD_DeviceSpecs::specs.
Referenced by AUD_ReadDevice::changeSpecs().
void AUD_SoftwareDevice::setSpeedOfSound | ( | float | speed | ) | [virtual] |
Sets the speed of sound. This value is needed for doppler effect calculation.
speed | The new speed of sound. |
Implements AUD_I3DDevice.
Definition at line 923 of file AUD_SoftwareDevice.cpp.
Referenced by AUD_SequencerReader::read().
void AUD_SoftwareDevice::setVolume | ( | float | volume | ) | [virtual] |
Sets the overall device volume.
handle | The sound handle. |
volume | The overall device volume. |
Implements AUD_IDevice.
Definition at line 879 of file AUD_SoftwareDevice.cpp.
Referenced by AUD_openMixdownDevice(), and AUD_SequencerReader::read().
void AUD_SoftwareDevice::stopAll | ( | ) | [virtual] |
Stops all playing sounds.
Implements AUD_IDevice.
Definition at line 851 of file AUD_SoftwareDevice.cpp.
void AUD_SoftwareDevice::unlock | ( | ) | [virtual] |
Unlocks the previously locked device.
Implements AUD_IDevice.
Definition at line 869 of file AUD_SoftwareDevice.cpp.
Referenced by mix(), play(), stopAll(), and AUD_SDLDevice::~AUD_SDLDevice().
AUD_Reference<AUD_Mixer> AUD_SoftwareDevice::m_mixer [protected] |
The mixer.
Definition at line 219 of file AUD_SoftwareDevice.h.
Referenced by create(), mix(), and setSpecs().
bool AUD_SoftwareDevice::m_quality [protected] |
Whether to do high or low quality resampling.
Definition at line 224 of file AUD_SoftwareDevice.h.
Referenced by create(), play(), and setQuality().
AUD_DeviceSpecs AUD_SoftwareDevice::m_specs [protected] |
The specification of the device.
Definition at line 214 of file AUD_SoftwareDevice.h.
Referenced by AUD_JackDevice::AUD_JackDevice(), AUD_ReadDevice::AUD_ReadDevice(), AUD_SDLDevice::AUD_SDLDevice(), AUD_ReadDevice::changeSpecs(), create(), AUD_JackDevice::getPlaybackPosition(), getSpecs(), mix(), play(), AUD_ReadDevice::read(), AUD_JackDevice::seekPlayback(), setSpecs(), and AUD_JackDevice::~AUD_JackDevice().