Blender  V2.59
Public Member Functions
AUD_NULLDevice Class Reference

#include <AUD_NULLDevice.h>

Inheritance diagram for AUD_NULLDevice:
Inheritance graph
[legend]

List of all members.

Public Member Functions

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

Detailed Description

This device plays nothing.

Definition at line 40 of file AUD_NULLDevice.h.


Constructor & Destructor Documentation

AUD_NULLDevice::AUD_NULLDevice ( )

Creates a new NULL device.

Definition at line 38 of file AUD_NULLDevice.cpp.


Member Function Documentation

bool AUD_NULLDevice::getKeep ( AUD_Handle handle) [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.

Implements AUD_IDevice.

Definition at line 76 of file AUD_NULLDevice.cpp.

int AUD_NULLDevice::getLoopCount ( AUD_Handle handle) [virtual]

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

Returns:
The remaining loop count.

Implements AUD_IDevice.

Definition at line 138 of file AUD_NULLDevice.cpp.

float AUD_NULLDevice::getPitch ( AUD_Handle handle) [virtual]

Retrieves the pitch of a playing sound.

Returns:
The pitch.

Implements AUD_IDevice.

Definition at line 128 of file AUD_NULLDevice.cpp.

float AUD_NULLDevice::getPosition ( AUD_Handle handle) [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.

Implements AUD_IDevice.

Definition at line 91 of file AUD_NULLDevice.cpp.

AUD_DeviceSpecs AUD_NULLDevice::getSpecs ( ) const [virtual]

Returns the specification of the device.

Implements AUD_IDevice.

Definition at line 42 of file AUD_NULLDevice.cpp.

References AUD_CHANNELS_INVALID, AUD_FORMAT_INVALID, AUD_RATE_INVALID, AUD_DeviceSpecs::channels, AUD_DeviceSpecs::format, and AUD_DeviceSpecs::rate.

AUD_Status AUD_NULLDevice::getStatus ( AUD_Handle handle) [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

Implements AUD_IDevice.

Definition at line 96 of file AUD_NULLDevice.cpp.

References AUD_STATUS_INVALID.

float AUD_NULLDevice::getVolume ( ) const [virtual]

Retrieves the overall device volume.

Returns:
The overall device volume.

Implements AUD_IDevice.

Definition at line 109 of file AUD_NULLDevice.cpp.

float AUD_NULLDevice::getVolume ( AUD_Handle handle) [virtual]

Retrieves the volume of a playing sound.

Parameters:
handleThe sound handle.
Returns:
The volume.

Implements AUD_IDevice.

Definition at line 118 of file AUD_NULLDevice.cpp.

void AUD_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 AUD_IDevice.

Definition at line 101 of file AUD_NULLDevice.cpp.

bool AUD_NULLDevice::pause ( AUD_Handle handle) [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.

Implements AUD_IDevice.

Definition at line 61 of file AUD_NULLDevice.cpp.

AUD_Handle * AUD_NULLDevice::play ( AUD_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 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.

Implements AUD_IDevice.

Definition at line 51 of file AUD_NULLDevice.cpp.

AUD_Handle * AUD_NULLDevice::play ( AUD_IFactory factory,
bool  keep = false 
) [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.

Implements AUD_IDevice.

Definition at line 56 of file AUD_NULLDevice.cpp.

bool AUD_NULLDevice::resume ( AUD_Handle handle) [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.

Implements AUD_IDevice.

Definition at line 66 of file AUD_NULLDevice.cpp.

bool AUD_NULLDevice::seek ( AUD_Handle handle,
float  position 
) [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.

Implements AUD_IDevice.

Definition at line 86 of file AUD_NULLDevice.cpp.

bool AUD_NULLDevice::setKeep ( AUD_Handle handle,
bool  keep 
) [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.

Implements AUD_IDevice.

Definition at line 81 of file AUD_NULLDevice.cpp.

bool AUD_NULLDevice::setLoopCount ( AUD_Handle handle,
int  count 
) [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.

Implements AUD_IDevice.

Definition at line 143 of file AUD_NULLDevice.cpp.

bool AUD_NULLDevice::setPitch ( AUD_Handle handle,
float  pitch 
) [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.

Implements AUD_IDevice.

Definition at line 133 of file AUD_NULLDevice.cpp.

bool AUD_NULLDevice::setStopCallback ( AUD_Handle handle,
stopCallback  callback = 0,
void *  data = 0 
) [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.

Implements AUD_IDevice.

Definition at line 148 of file AUD_NULLDevice.cpp.

void AUD_NULLDevice::setVolume ( float  volume) [virtual]

Sets the overall device volume.

Parameters:
handleThe sound handle.
volumeThe overall device volume.

Implements AUD_IDevice.

Definition at line 114 of file AUD_NULLDevice.cpp.

bool AUD_NULLDevice::setVolume ( AUD_Handle handle,
float  volume 
) [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.

Implements AUD_IDevice.

Definition at line 123 of file AUD_NULLDevice.cpp.

bool AUD_NULLDevice::stop ( AUD_Handle handle) [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.

Implements AUD_IDevice.

Definition at line 71 of file AUD_NULLDevice.cpp.

void AUD_NULLDevice::unlock ( ) [virtual]

Unlocks the previously locked device.

Implements AUD_IDevice.

Definition at line 105 of file AUD_NULLDevice.cpp.


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