Audaspace 1.4.0
A high level audio library.
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
PulseAudioDevice Class Reference

This device plays back through PulseAudio, the simple direct media layer. More...

#include <PulseAudioDevice.h>

Inheritance diagram for PulseAudioDevice:
Inheritance graph
[legend]

Public Member Functions

 PulseAudioDevice (std::string name, DeviceSpecs specs, int buffersize=AUD_DEFAULT_BUFFER_SIZE)
 Opens the PulseAudio audio device for playback.
 
virtual ~PulseAudioDevice ()
 Closes the PulseAudio audio device.
 
virtual ISynchronizergetSynchronizer ()
 Retrieves the synchronizer for this device, which enables accurate synchronization between audio playback and video playback for example.
 
- Public Member Functions inherited from SoftwareDevice
void setQuality (bool quality)
 Sets the resampling quality.
 
virtual DeviceSpecs getSpecs () const
 Returns the specification of the device.
 
virtual std::shared_ptr< IHandleplay (std::shared_ptr< IReader > reader, bool keep=false)
 Plays a sound source.
 
virtual std::shared_ptr< IHandleplay (std::shared_ptr< ISound > sound, bool keep=false)
 Plays a sound source.
 
virtual void stopAll ()
 Stops all playing sounds.
 
virtual void lock ()
 Locks the device.
 
virtual void unlock ()
 Unlocks the previously locked device.
 
virtual float getVolume () const
 Retrieves the overall device volume.
 
virtual void setVolume (float volume)
 Sets the overall device volume.
 
virtual ISynchronizergetSynchronizer ()
 Retrieves the synchronizer for this device, which enables accurate synchronization between audio playback and video playback for example.
 
virtual Vector3 getListenerLocation () const
 Retrieves the listener location.
 
virtual void setListenerLocation (const Vector3 &location)
 Sets the listener location.
 
virtual Vector3 getListenerVelocity () const
 Retrieves the listener velocity.
 
virtual void setListenerVelocity (const Vector3 &velocity)
 Sets the listener velocity.
 
virtual Quaternion getListenerOrientation () const
 Retrieves the listener orientation.
 
virtual void setListenerOrientation (const Quaternion &orientation)
 Sets the listener orientation.
 
virtual float getSpeedOfSound () const
 Retrieves the speed of sound.
 
virtual void setSpeedOfSound (float speed)
 Sets the speed of sound.
 
virtual float getDopplerFactor () const
 Retrieves the doppler factor.
 
virtual void setDopplerFactor (float factor)
 Sets the doppler factor.
 
virtual DistanceModel getDistanceModel () const
 Retrieves the distance model.
 
virtual void setDistanceModel (DistanceModel model)
 Sets the distance model.
 
- Public Member Functions inherited from IDevice
virtual ~IDevice ()
 Destroys the device.
 
virtual DeviceSpecs getSpecs () const =0
 Returns the specification of the device.
 
virtual std::shared_ptr< IHandleplay (std::shared_ptr< IReader > reader, bool keep=false)=0
 Plays a sound source.
 
virtual std::shared_ptr< IHandleplay (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 ISynchronizergetSynchronizer ()=0
 Retrieves the synchronizer for this device, which enables accurate synchronization between audio playback and video playback for example.
 
virtual void lock ()=0
 Locks the object.
 
virtual void unlock ()=0
 Unlocks the previously locked object.
 
virtual Vector3 getListenerLocation () const =0
 Retrieves the listener location.
 
virtual void setListenerLocation (const Vector3 &location)=0
 Sets the listener location.
 
virtual Vector3 getListenerVelocity () const =0
 Retrieves the listener velocity.
 
virtual void setListenerVelocity (const Vector3 &velocity)=0
 Sets the listener velocity.
 
virtual Quaternion getListenerOrientation () const =0
 Retrieves the listener orientation.
 
virtual void setListenerOrientation (const Quaternion &orientation)=0
 Sets the listener orientation.
 
virtual float getSpeedOfSound () const =0
 Retrieves the speed of sound.
 
virtual void setSpeedOfSound (float speed)=0
 Sets the speed of sound.
 
virtual float getDopplerFactor () const =0
 Retrieves the doppler factor.
 
virtual void setDopplerFactor (float factor)=0
 Sets the doppler factor.
 
virtual DistanceModel getDistanceModel () const =0
 Retrieves the distance model.
 
virtual void setDistanceModel (DistanceModel model)=0
 Sets the distance model.
 

Static Public Member Functions

static void registerPlugin ()
 Registers this plugin.
 
- Static Public Member Functions inherited from SoftwareDevice
static void setPanning (IHandle *handle, float pan)
 Sets the panning of a specific handle.
 

Protected Member Functions

virtual void playing (bool playing)
 This function tells the device, to start or pause playback.
 
- Protected Member Functions inherited from SoftwareDevice
void create ()
 Initializes member variables.
 
void destroy ()
 Uninitializes member variables.
 
void mix (data_t *buffer, int length)
 Mixes the next samples into the buffer.
 
virtual void playing (bool playing)=0
 This function tells the device, to start or pause playback.
 
void setSpecs (Specs specs)
 Sets the audio output specification of the device.
 
void setSpecs (DeviceSpecs specs)
 Sets the audio output specification of the device.
 
 SoftwareDevice ()
 Empty default constructor.
 

Additional Inherited Members

- Protected Attributes inherited from SoftwareDevice
DeviceSpecs m_specs
 The specification of the device.
 
std::shared_ptr< Mixerm_mixer
 The mixer.
 
bool m_quality
 Whether to do high or low quality resampling.
 

Detailed Description

This device plays back through PulseAudio, the simple direct media layer.

Constructor & Destructor Documentation

◆ PulseAudioDevice()

PulseAudioDevice::PulseAudioDevice ( std::string  name,
DeviceSpecs  specs,
int  buffersize = AUD_DEFAULT_BUFFER_SIZE 
)

Opens the PulseAudio audio device for playback.

Parameters
specsThe wanted audio specification.
buffersizeThe size of the internal buffer.
Note
The specification really used for opening the device may differ.
Exceptions
ExceptionThrown if the audio device cannot be opened.

Member Function Documentation

◆ getSynchronizer()

virtual ISynchronizer * PulseAudioDevice::getSynchronizer ( )
virtual

Retrieves the synchronizer for this device, which enables accurate synchronization between audio playback and video playback for example.

Returns
The synchronizer which will be the DefaultSynchronizer if synchonization is not supported.

Reimplemented from SoftwareDevice.

◆ playing()

virtual void PulseAudioDevice::playing ( bool  playing)
protectedvirtual

This function tells the device, to start or pause playback.

Parameters
playingTrue if device should playback.
Note
This method is only called when the device is locked.

Implements SoftwareDevice.


The documentation for this class was generated from the following file: