Audaspace
1.4.0
A high level audio library.
|
The software device is a generic device with software mixing. More...
#include <SoftwareDevice.h>
Classes | |
class | SoftwareHandle |
Saves the data for playback. More... | |
Public Member Functions | |
void | setQuality (bool quality) |
Sets the resampling quality. More... | |
virtual DeviceSpecs | getSpecs () const |
Returns the specification of the device. | |
virtual std::shared_ptr< IHandle > | play (std::shared_ptr< IReader > reader, bool keep=false) |
Plays a sound source. More... | |
virtual std::shared_ptr< IHandle > | play (std::shared_ptr< ISound > sound, bool keep=false) |
Plays a sound source. More... | |
virtual void | stopAll () |
Stops all playing sounds. | |
virtual void | lock () |
Locks the device. More... | |
virtual void | unlock () |
Unlocks the previously locked device. | |
virtual float | getVolume () const |
Retrieves the overall device volume. More... | |
virtual void | setVolume (float volume) |
Sets the overall device volume. More... | |
virtual ISynchronizer * | getSynchronizer () |
Retrieves the synchronizer for this device, which enables accurate synchronization between audio playback and video playback for example. More... | |
virtual Vector3 | getListenerLocation () const |
Retrieves the listener location. More... | |
virtual void | setListenerLocation (const Vector3 &location) |
Sets the listener location. More... | |
virtual Vector3 | getListenerVelocity () const |
Retrieves the listener velocity. More... | |
virtual void | setListenerVelocity (const Vector3 &velocity) |
Sets the listener velocity. More... | |
virtual Quaternion | getListenerOrientation () const |
Retrieves the listener orientation. More... | |
virtual void | setListenerOrientation (const Quaternion &orientation) |
Sets the listener orientation. More... | |
virtual float | getSpeedOfSound () const |
Retrieves the speed of sound. More... | |
virtual void | setSpeedOfSound (float speed) |
Sets the speed of sound. More... | |
virtual float | getDopplerFactor () const |
Retrieves the doppler factor. More... | |
virtual void | setDopplerFactor (float factor) |
Sets the doppler factor. More... | |
virtual DistanceModel | getDistanceModel () const |
Retrieves the distance model. More... | |
virtual void | setDistanceModel (DistanceModel model) |
Sets the distance model. More... | |
![]() | |
virtual | ~IDevice () |
Destroys the device. | |
Static Public Member Functions | |
static void | setPanning (IHandle *handle, float pan) |
Sets the panning of a specific handle. More... | |
Protected Member Functions | |
void | create () |
Initializes member variables. | |
void | destroy () |
Uninitializes member variables. | |
void | mix (data_t *buffer, int length) |
Mixes the next samples into the buffer. More... | |
virtual void | playing (bool playing)=0 |
This function tells the device, to start or pause playback. More... | |
void | setSpecs (Specs specs) |
Sets the audio output specification of the device. More... | |
void | setSpecs (DeviceSpecs specs) |
Sets the audio output specification of the device. More... | |
SoftwareDevice () | |
Empty default constructor. More... | |
Protected Attributes | |
DeviceSpecs | m_specs |
The specification of the device. | |
std::shared_ptr< Mixer > | m_mixer |
The mixer. | |
bool | m_quality |
Whether to do high or low quality resampling. | |
The software device is a generic device with software mixing.
It is a base class for all software mixing classes. Classes implementing this have to:
|
protected |
|
virtual |
|
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 I3DDevice.
|
virtual |
|
virtual |
Retrieves the listener orientation.
Implements I3DDevice.
|
virtual |
|
virtual |
Retrieves the speed of sound.
This value is needed for doppler effect calculation.
Implements I3DDevice.
|
virtual |
Retrieves the synchronizer for this device, which enables accurate synchronization between audio playback and video playback for example.
Implements IDevice.
Reimplemented in JackDevice, PulseAudioDevice, and CoreAudioDevice.
|
virtual |
|
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 IDevice.
|
protected |
Mixes the next samples into the buffer.
buffer | The target buffer. |
length | The length in samples to be filled. |
|
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. |
Exception | Thrown if there's an unexpected (from the device side) error during creation of the reader. |
Implements IDevice.
|
virtual |
Plays a sound source.
sound | The sound 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. |
Exception | Thrown if there's an unexpected (from the device side) error during creation of the reader. |
Implements IDevice.
|
protectedpure virtual |
This function tells the device, to start or pause playback.
playing | True if device should playback. |
Implemented in JackDevice, PulseAudioDevice, CoreAudioDevice, ThreadedDevice, SDLDevice, and ReadDevice.
|
virtual |
|
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 I3DDevice.
|
virtual |
Sets the listener location.
location | The new location. |
Implements I3DDevice.
|
virtual |
Sets the listener orientation.
orientation | The new orientation as quaternion. |
Implements I3DDevice.
|
virtual |
Sets the listener velocity.
velocity | The new velocity. |
Implements I3DDevice.
|
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]. |
void SoftwareDevice::setQuality | ( | bool | quality | ) |
Sets the resampling quality.
quality | Low (false) or high (true) quality. |
|
protected |
Sets the audio output specification of the device.
specs | The output specification. |
|
protected |
Sets the audio output specification of the device.
specs | The output specification. |
|
virtual |
Sets the speed of sound.
This value is needed for doppler effect calculation.
speed | The new speed of sound. |
Implements I3DDevice.
|
virtual |