Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
NULLDevice Class Reference

This device plays nothing. More...

#include <NULLDevice.h>

Inheritance diagram for NULLDevice:
Inheritance graph
[legend]

Public Member Functions

 NULLDevice ()
 Creates a new NULLDevice.
 
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.
 
- Public Member Functions inherited from IDevice
virtual ~IDevice ()
 Destroys the device.
 

Static Public Member Functions

static void registerPlugin ()
 Registers this plugin.
 

Detailed Description

This device plays nothing.

It is similar to the linux device /dev/null.

Member Function Documentation

◆ getSpecs()

virtual DeviceSpecs NULLDevice::getSpecs ( ) const
virtual

Returns the specification of the device.

Implements IDevice.

◆ getSynchronizer()

virtual ISynchronizer * NULLDevice::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.

Implements IDevice.

◆ getVolume()

virtual float NULLDevice::getVolume ( ) const
virtual

Retrieves the overall device volume.

Returns
The overall device volume.

Implements IDevice.

◆ lock()

virtual void NULLDevice::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.

Warning
Make sure the locking time is as small as possible to avoid playback delays that result in unexpected noise and cracks.

Implements IDevice.

◆ play() [1/2]

virtual std::shared_ptr< IHandle > NULLDevice::play ( std::shared_ptr< IReader > reader,
bool keep = false )
virtual

Plays a sound source.

Parameters
readerThe reader to play.
keepWhen keep is true the sound source will not be deleted but set to paused when its end has been reached.
Returns
Returns a handle with which the playback can be controlled. This is nullptr if the sound couldn't be played back.
Exceptions
ExceptionThrown if there's an unexpected (from the device side) error during creation of the reader.

Implements IDevice.

◆ play() [2/2]

virtual std::shared_ptr< IHandle > NULLDevice::play ( std::shared_ptr< ISound > sound,
bool keep = false )
virtual

Plays a sound source.

Parameters
soundThe sound to create the reader for the sound source.
keepWhen keep is true the sound source will not be deleted but set to paused when its end has been reached.
Returns
Returns a handle with which the playback can be controlled. This is nullptr if the sound couldn't be played back.
Exceptions
ExceptionThrown if there's an unexpected (from the device side) error during creation of the reader.

Implements IDevice.

◆ setVolume()

virtual void NULLDevice::setVolume ( float volume)
virtual

Sets the overall device volume.

Parameters
volumeThe overall device volume.

Implements IDevice.

◆ stopAll()

virtual void NULLDevice::stopAll ( )
virtual

Stops all playing sounds.

Implements IDevice.

◆ unlock()

virtual void NULLDevice::unlock ( )
virtual

Unlocks the previously locked device.

Implements IDevice.


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