Blender  V2.59
Public Member Functions
AUD_IDevice Class Reference

#include <AUD_IDevice.h>

Inheritance diagram for AUD_IDevice:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~AUD_IDevice ()
virtual AUD_DeviceSpecs getSpecs () const =0
virtual AUD_Handleplay (AUD_IReader *reader, bool keep=false)=0
virtual AUD_Handleplay (AUD_IFactory *factory, bool keep=false)=0
virtual bool pause (AUD_Handle *handle)=0
virtual bool resume (AUD_Handle *handle)=0
virtual bool stop (AUD_Handle *handle)=0
virtual bool getKeep (AUD_Handle *handle)=0
virtual bool setKeep (AUD_Handle *handle, bool keep)=0
virtual bool seek (AUD_Handle *handle, float position)=0
virtual float getPosition (AUD_Handle *handle)=0
virtual AUD_Status getStatus (AUD_Handle *handle)=0
virtual void lock ()=0
virtual void unlock ()=0
virtual float getVolume () const =0
virtual void setVolume (float volume)=0
virtual float getVolume (AUD_Handle *handle)=0
virtual bool setVolume (AUD_Handle *handle, float volume)=0
virtual float getPitch (AUD_Handle *handle)=0
virtual bool setPitch (AUD_Handle *handle, float pitch)=0
virtual int getLoopCount (AUD_Handle *handle)=0
virtual bool setLoopCount (AUD_Handle *handle, int count)=0
virtual bool setStopCallback (AUD_Handle *handle, stopCallback callback=0, void *data=0)=0

Detailed Description

This class represents an output device for sound sources. Output devices may be several backends such as plattform independand like SDL or OpenAL or plattform specific like DirectSound, but they may also be files, RAM buffers or other types of streams.

Warning:
Thread safety must be insured so that no reader is beeing called twice at the same time.

Definition at line 54 of file AUD_IDevice.h.


Constructor & Destructor Documentation

virtual AUD_IDevice::~AUD_IDevice ( ) [inline, virtual]

Destroys the device.

Definition at line 60 of file AUD_IDevice.h.


Member Function Documentation

virtual bool AUD_IDevice::getKeep ( AUD_Handle handle) [pure virtual]

Gets the behaviour of the device for a played back sound when the sound doesn't return any more samples.

Parameters:
handleThe handle returned by the play function.
Returns:
  • true if the source will be paused when it's end is reached
  • false if the handle won't kept or is invalid.

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

Referenced by Handle_get_keep().

virtual int AUD_IDevice::getLoopCount ( AUD_Handle handle) [pure virtual]

Retrieves the loop count of a playing sound. A negative value indicates infinity.

Returns:
The remaining loop count.

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

Referenced by Handle_get_loop_count().

virtual float AUD_IDevice::getPitch ( AUD_Handle handle) [pure virtual]

Retrieves the pitch of a playing sound.

Returns:
The pitch.

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

Referenced by Handle_get_pitch().

virtual float AUD_IDevice::getPosition ( AUD_Handle handle) [pure virtual]

Retrieves the current playback position of a sound.

Parameters:
handleThe handle returned by the play function.
Returns:
The playback position in seconds, or 0.0 if the handle is invalid.

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

Referenced by AUD_getPosition(), AUD_getSequencerPosition(), and Handle_get_position().

virtual AUD_DeviceSpecs AUD_IDevice::getSpecs ( ) const [pure virtual]

Returns the specification of the device.

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

virtual AUD_Status AUD_IDevice::getStatus ( AUD_Handle handle) [pure virtual]

Returns the status of a played back sound.

Parameters:
handleThe handle returned by the play function.
Returns:
  • AUD_STATUS_INVALID if the sound has stopped or the handle is . invalid
  • AUD_STATUS_PLAYING if the sound is currently played back.
  • AUD_STATUS_PAUSED if the sound is currently paused.
See also:
AUD_Status

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

Referenced by AUD_getStatus(), and Handle_get_status().

virtual float AUD_IDevice::getVolume ( ) const [pure virtual]

Retrieves the overall device volume.

Returns:
The overall device volume.

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

Referenced by Handle_get_volume().

virtual float AUD_IDevice::getVolume ( AUD_Handle handle) [pure virtual]

Retrieves the volume of a playing sound.

Parameters:
handleThe sound handle.
Returns:
The volume.

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

virtual void AUD_IDevice::lock ( ) [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.

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

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

Referenced by AUD_lock().

virtual bool AUD_IDevice::pause ( AUD_Handle handle) [pure virtual]

Pauses a played back sound.

Parameters:
handleThe handle returned by the play function.
Returns:
  • true if the sound has been paused.
  • false if the sound isn't playing back or the handle is invalid.

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

Referenced by AUD_pause(), Handle_pause(), and pauseSound().

virtual AUD_Handle* AUD_IDevice::play ( AUD_IReader reader,
bool  keep = false 
) [pure 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 NULL if the sound couldn't be played back.
Exceptions:
AUD_ExceptionThrown if there's an unexpected (from the device side) error during creation of the reader.

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

Referenced by AUD_pauseAfter(), and AUD_play().

virtual AUD_Handle* AUD_IDevice::play ( AUD_IFactory factory,
bool  keep = false 
) [pure virtual]

Plays a sound source.

Parameters:
factoryThe factory 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 NULL if the sound couldn't be played back.
Exceptions:
AUD_ExceptionThrown if there's an unexpected (from the device side) error during creation of the reader.

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

virtual bool AUD_IDevice::resume ( AUD_Handle handle) [pure virtual]

Resumes a paused sound.

Parameters:
handleThe handle returned by the play function.
Returns:
  • true if the sound has been resumed.
  • false if the sound isn't paused or the handle is invalid.

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

Referenced by AUD_resume(), and Handle_resume().

virtual bool AUD_IDevice::seek ( AUD_Handle handle,
float  position 
) [pure virtual]

Seeks in a played back sound.

Parameters:
handleThe handle returned by the play function.
positionThe new position from where to play back, in seconds.
Returns:
  • true if the handle is valid.
  • false if the handle is invalid.
Warning:
Whether the seek works or not depends on the sound source.

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

Referenced by AUD_seek(), AUD_seekSequencer(), and Handle_set_position().

virtual bool AUD_IDevice::setKeep ( AUD_Handle handle,
bool  keep 
) [pure virtual]

Sets the behaviour of the device for a played back sound when the sound doesn't return any more samples.

Parameters:
handleThe handle returned by the play function.
keepTrue when the source should be paused and not deleted.
Returns:
  • true if the behaviour has been changed.
  • false if the handle is invalid.

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

Referenced by AUD_setKeep(), and Handle_set_keep().

virtual bool AUD_IDevice::setLoopCount ( AUD_Handle handle,
int  count 
) [pure virtual]

Sets the loop count of a playing sound. A negative value indicates infinity.

Parameters:
handleThe sound handle.
countThe new loop count.
Returns:
  • true if the handle is valid.
  • false if the handle is invalid.

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

Referenced by AUD_setLoop(), and Handle_set_loop_count().

virtual bool AUD_IDevice::setPitch ( AUD_Handle handle,
float  pitch 
) [pure virtual]

Sets the pitch of a playing sound.

Parameters:
handleThe sound handle.
pitchThe pitch.
Returns:
  • true if the handle is valid.
  • false if the handle is invalid.

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

Referenced by AUD_setSoundPitch(), and Handle_set_pitch().

virtual bool AUD_IDevice::setStopCallback ( AUD_Handle handle,
stopCallback  callback = 0,
void *  data = 0 
) [pure virtual]

Sets the callback function that's called when the end of a playing sound is reached.

Parameters:
handleThe sound handle.
callbackThe callback function.
dataThe data that should be passed to the callback function.
Returns:
  • true if the handle is valid.
  • false if the handle is invalid.

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

Referenced by AUD_pauseAfter().

virtual void AUD_IDevice::setVolume ( float  volume) [pure virtual]

Sets the overall device volume.

Parameters:
handleThe sound handle.
volumeThe overall device volume.

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

Referenced by AUD_setSoundVolume(), and Handle_set_volume().

virtual bool AUD_IDevice::setVolume ( AUD_Handle handle,
float  volume 
) [pure virtual]

Sets the volume of a playing sound.

Parameters:
handleThe sound handle.
volumeThe volume.
Returns:
  • true if the handle is valid.
  • false if the handle is invalid.

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

virtual bool AUD_IDevice::stop ( AUD_Handle handle) [pure virtual]

Stops a played back or paused sound. The handle is definitely invalid afterwards.

Parameters:
handleThe handle returned by the play function.
Returns:
  • true if the sound has been stopped.
  • false if the handle is invalid.

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

Referenced by AUD_stop(), and Handle_stop().

virtual void AUD_IDevice::unlock ( ) [pure virtual]

Unlocks the previously locked device.

Implemented in AUD_OpenALDevice, AUD_SoftwareDevice, and AUD_NULLDevice.

Referenced by AUD_unlock().


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