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

This device enables to let the user read raw data out of it. More...

#include <ReadDevice.h>

Inheritance diagram for ReadDevice:
Inheritance graph
[legend]

Public Member Functions

 ReadDevice (DeviceSpecs specs)
 Creates a new read device.
 
 ReadDevice (Specs specs)
 Creates a new read device.
 
virtual ~ReadDevice ()
 Closes the device.
 
bool read (data_t *buffer, int length)
 Reads the next bytes into the supplied buffer.
 
void changeSpecs (Specs specs)
 Changes the output specification.
 
- Public Member Functions inherited from SoftwareDevice
void setQuality (ResampleQuality 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.
 

Protected Member Functions

virtual void AUD_LOCAL 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.
 
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

- Static Public Member Functions inherited from SoftwareDevice
static void setPanning (IHandle *handle, float pan)
 Sets the panning of a specific handle.
 
- Protected Attributes inherited from SoftwareDevice
DeviceSpecs m_specs
 The specification of the device.
 
std::shared_ptr< Mixerm_mixer
 The mixer.
 
ResampleQuality m_quality
 Resampling quality.
 

Detailed Description

This device enables to let the user read raw data out of it.

Constructor & Destructor Documentation

◆ ReadDevice() [1/2]

ReadDevice::ReadDevice ( DeviceSpecs specs)

Creates a new read device.

Parameters
specsThe wanted audio specification.

◆ ReadDevice() [2/2]

ReadDevice::ReadDevice ( Specs specs)

Creates a new read device.

Parameters
specsThe wanted audio specification.

Member Function Documentation

◆ changeSpecs()

void ReadDevice::changeSpecs ( Specs specs)

Changes the output specification.

Parameters
specsThe new audio data specification.

◆ playing()

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

◆ read()

bool ReadDevice::read ( data_t * buffer,
int length )

Reads the next bytes into the supplied buffer.

Parameters
bufferThe target buffer.
lengthThe length in samples to be filled.
Returns
True if the reading succeeded, false if there are no sounds played back currently, in that case the buffer is filled with silence.

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