Audaspace 1.7.0
A high level audio library.
|
The IDevice interface represents an output device for sound sources. More...
#include <IDevice.h>
Public Types | |
typedef void(* | syncFunction) (void *, int, float) |
The syncFunction is called when a synchronization event happens. |
Public Member Functions | |
virtual | ~IDevice () |
Destroys the device. | |
virtual DeviceSpecs | getSpecs () const =0 |
Returns the specification of the device. | |
virtual std::shared_ptr< IHandle > | play (std::shared_ptr< IReader > reader, bool keep=false)=0 |
Plays a sound source. | |
virtual std::shared_ptr< IHandle > | play (std::shared_ptr< ISound > sound, bool keep=false)=0 |
Plays a sound source. | |
virtual void | stopAll ()=0 |
Stops all playing sounds. | |
virtual void | lock ()=0 |
Locks the device. | |
virtual void | unlock ()=0 |
Unlocks the previously locked device. | |
virtual float | getVolume () const =0 |
Retrieves the overall device volume. | |
virtual void | setVolume (float volume)=0 |
Sets the overall device volume. | |
virtual void | seekSynchronizer (double time)=0 |
virtual double | getSynchronizerPosition ()=0 |
virtual void | playSynchronizer ()=0 |
virtual void | stopSynchronizer ()=0 |
virtual void | setSyncCallback (syncFunction function, void *data)=0 |
virtual int | isSynchronizerPlaying ()=0 |
The IDevice interface represents an output device for sound sources.
Output devices may be several backends such as platform independand like SDL or OpenAL or platform specific like ALSA, but they may also be files, RAM buffers or other types of streams.
typedef void(* IDevice::syncFunction) (void *, int, float) |
The syncFunction is called when a synchronization event happens.
The function awaits three parameters. The first one is a user defined pointer, the second informs about whether playback is on and the third is the current playback time in seconds.
|
pure virtual |
Returns the specification of the device.
Implemented in NULLDevice, OpenALDevice, and SoftwareDevice.
|
pure virtual |
Implemented in JackDevice.
|
pure virtual |
Retrieves the overall device volume.
Implemented in NULLDevice, OpenALDevice, and SoftwareDevice.
|
pure virtual |
Implemented in JackDevice.
|
pure 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 ILockable.
Implemented in NULLDevice, OpenALDevice, and SoftwareDevice.
|
pure 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. |
Implemented in NULLDevice, OpenALDevice, and SoftwareDevice.
|
pure 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. |
Implemented in NULLDevice, OpenALDevice, and SoftwareDevice.
|
pure virtual |
Implemented in JackDevice.
|
pure virtual |
Implemented in JackDevice.
|
pure virtual |
Implemented in JackDevice.
|
pure virtual |
Sets the overall device volume.
volume | The overall device volume. |
Implemented in NULLDevice, OpenALDevice, and SoftwareDevice.
|
pure virtual |
Stops all playing sounds.
Implemented in NULLDevice, OpenALDevice, and SoftwareDevice.
|
pure virtual |
Implemented in JackDevice.
|
pure virtual |
Unlocks the previously locked device.
Implements ILockable.
Implemented in NULLDevice, OpenALDevice, and SoftwareDevice.