Blender  V2.59
Public Member Functions
AUD_OpenALDevice Class Reference

#include <AUD_OpenALDevice.h>

Inheritance diagram for AUD_OpenALDevice:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 AUD_OpenALDevice (AUD_DeviceSpecs specs, int buffersize=AUD_DEFAULT_BUFFER_SIZE)
void updateStreams ()
virtual ~AUD_OpenALDevice ()
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=NULL, void *data=NULL)
virtual AUD_Vector3 getListenerLocation () const
virtual void setListenerLocation (const AUD_Vector3 &location)
virtual AUD_Vector3 getListenerVelocity () const
virtual void setListenerVelocity (const AUD_Vector3 &velocity)
virtual AUD_Quaternion getListenerOrientation () const
virtual void setListenerOrientation (const AUD_Quaternion &orientation)
virtual float getSpeedOfSound () const
virtual void setSpeedOfSound (float speed)
virtual float getDopplerFactor () const
virtual void setDopplerFactor (float factor)
virtual AUD_DistanceModel getDistanceModel () const
virtual void setDistanceModel (AUD_DistanceModel model)
virtual AUD_Vector3 getSourceLocation (AUD_Handle *handle)
virtual bool setSourceLocation (AUD_Handle *handle, const AUD_Vector3 &location)
virtual AUD_Vector3 getSourceVelocity (AUD_Handle *handle)
virtual bool setSourceVelocity (AUD_Handle *handle, const AUD_Vector3 &velocity)
virtual AUD_Quaternion getSourceOrientation (AUD_Handle *handle)
virtual bool setSourceOrientation (AUD_Handle *handle, const AUD_Quaternion &orientation)
virtual bool isRelative (AUD_Handle *handle)
virtual bool setRelative (AUD_Handle *handle, bool relative)
virtual float getVolumeMaximum (AUD_Handle *handle)
virtual bool setVolumeMaximum (AUD_Handle *handle, float volume)
virtual float getVolumeMinimum (AUD_Handle *handle)
virtual bool setVolumeMinimum (AUD_Handle *handle, float volume)
virtual float getDistanceMaximum (AUD_Handle *handle)
virtual bool setDistanceMaximum (AUD_Handle *handle, float distance)
virtual float getDistanceReference (AUD_Handle *handle)
virtual bool setDistanceReference (AUD_Handle *handle, float distance)
virtual float getAttenuation (AUD_Handle *handle)
virtual bool setAttenuation (AUD_Handle *handle, float factor)
virtual float getConeAngleOuter (AUD_Handle *handle)
virtual bool setConeAngleOuter (AUD_Handle *handle, float angle)
virtual float getConeAngleInner (AUD_Handle *handle)
virtual bool setConeAngleInner (AUD_Handle *handle, float angle)
virtual float getConeVolumeOuter (AUD_Handle *handle)
virtual bool setConeVolumeOuter (AUD_Handle *handle, float volume)

Detailed Description

This device plays through OpenAL.

Definition at line 48 of file AUD_OpenALDevice.h.


Constructor & Destructor Documentation

AUD_OpenALDevice::AUD_OpenALDevice ( AUD_DeviceSpecs  specs,
int  buffersize = AUD_DEFAULT_BUFFER_SIZE 
)

Opens the OpenAL 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.
The buffersize will be multiplicated by three for this device.
Exceptions:
AUD_ExceptionThrown if the audio device cannot be opened.

Definition at line 311 of file AUD_OpenALDevice.cpp.

References AUD_CHANNELS_STEREO, AUD_ERROR_OPENAL, AUD_FORMAT_FLOAT32, AUD_FORMAT_S16, AUD_RATE_INVALID, AUD_THROW, AUD_DeviceSpecs::channels, AUD_DeviceSpecs::format, NULL, and AUD_DeviceSpecs::rate.

AUD_OpenALDevice::~AUD_OpenALDevice ( ) [virtual]

Member Function Documentation

float AUD_OpenALDevice::getAttenuation ( AUD_Handle handle) [virtual]

Retrieves the attenuation of a source.

Parameters:
handleThe handle of the source.
Returns:
The attenuation.

Implements AUD_I3DDevice.

Definition at line 1534 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

float AUD_OpenALDevice::getConeAngleInner ( AUD_Handle handle) [virtual]

Retrieves the inner angle of the cone of a source.

Parameters:
handleThe handle of the source.
Returns:
The inner angle of the cone.

Implements AUD_I3DDevice.

Definition at line 1588 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

float AUD_OpenALDevice::getConeAngleOuter ( AUD_Handle handle) [virtual]

Retrieves the outer angle of the cone of a source.

Parameters:
handleThe handle of the source.
Returns:
The outer angle of the cone.

Implements AUD_I3DDevice.

Definition at line 1561 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

float AUD_OpenALDevice::getConeVolumeOuter ( AUD_Handle handle) [virtual]

Retrieves the outer volume of the cone of a source. The volume between inner and outer angle is interpolated between inner volume and this value.

Parameters:
handleThe handle of the source.
Returns:
The outer volume of the cone.

Implements AUD_I3DDevice.

Definition at line 1615 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

float AUD_OpenALDevice::getDistanceMaximum ( AUD_Handle handle) [virtual]

Retrieves the maximum distance of a source. If a source is further away from the reader than this distance, the volume will automatically be set to 0.

Parameters:
handleThe handle of the source.
Returns:
The maximum distance.

Implements AUD_I3DDevice.

Definition at line 1480 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

AUD_DistanceModel AUD_OpenALDevice::getDistanceModel ( ) const [virtual]
float AUD_OpenALDevice::getDistanceReference ( AUD_Handle handle) [virtual]

Retrieves the reference distance of a source.

Parameters:
handleThe handle of the source.
Returns:
The reference distance.

Implements AUD_I3DDevice.

Definition at line 1507 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

float AUD_OpenALDevice::getDopplerFactor ( ) const [virtual]

Retrieves the doppler factor. This value is a scaling factor for the velocity vectors of sources and listener which is used while calculating the doppler effect.

Returns:
The doppler factor.

Implements AUD_I3DDevice.

Definition at line 1254 of file AUD_OpenALDevice.cpp.

bool AUD_OpenALDevice::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 824 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

AUD_Vector3 AUD_OpenALDevice::getListenerLocation ( ) const [virtual]

Retrieves the listener location.

Returns:
The listener location.

Implements AUD_I3DDevice.

Definition at line 1196 of file AUD_OpenALDevice.cpp.

References p.

AUD_Quaternion AUD_OpenALDevice::getListenerOrientation ( ) const [virtual]

Retrieves the listener orientation.

Returns:
The listener orientation as quaternion.

Implements AUD_I3DDevice.

Definition at line 1220 of file AUD_OpenALDevice.cpp.

AUD_Vector3 AUD_OpenALDevice::getListenerVelocity ( ) const [virtual]

Retrieves the listener velocity.

Returns:
The listener velocity.

Implements AUD_I3DDevice.

Definition at line 1208 of file AUD_OpenALDevice.cpp.

int AUD_OpenALDevice::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 1038 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

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

Retrieves the pitch of a playing sound.

Returns:
The pitch.

Implements AUD_IDevice.

Definition at line 1018 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

float AUD_OpenALDevice::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 920 of file AUD_OpenALDevice.cpp.

References AUD_OPENAL_CYCLE_BUFFERS, AUD_IReader::getPosition(), AUD_IReader::getSpecs(), AUD_OpenALHandle::isBuffered, lock(), AUD_Specs::rate, AUD_OpenALHandle::reader, AUD_OpenALHandle::source, and unlock().

AUD_Vector3 AUD_OpenALDevice::getSourceLocation ( AUD_Handle handle) [virtual]

Retrieves the location of a source.

Parameters:
handleThe handle of the source.
Returns:
The location.

Implements AUD_I3DDevice.

Definition at line 1312 of file AUD_OpenALDevice.cpp.

References lock(), p, and unlock().

AUD_Quaternion AUD_OpenALDevice::getSourceOrientation ( AUD_Handle handle) [virtual]

Retrieves the orientation of a source.

Parameters:
handleThe handle of the source.
Returns:
The orientation as quaternion.

Implements AUD_I3DDevice.

Definition at line 1370 of file AUD_OpenALDevice.cpp.

AUD_Vector3 AUD_OpenALDevice::getSourceVelocity ( AUD_Handle handle) [virtual]

Retrieves the velocity of a source.

Parameters:
handleThe handle of the source.
Returns:
The velocity.

Implements AUD_I3DDevice.

Definition at line 1341 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

AUD_DeviceSpecs AUD_OpenALDevice::getSpecs ( ) const [virtual]

Returns the specification of the device.

Implements AUD_IDevice.

Definition at line 437 of file AUD_OpenALDevice.cpp.

float AUD_OpenALDevice::getSpeedOfSound ( ) const [virtual]

Retrieves the speed of sound. This value is needed for doppler effect calculation.

Returns:
The speed of sound.

Implements AUD_I3DDevice.

Definition at line 1244 of file AUD_OpenALDevice.cpp.

AUD_Status AUD_OpenALDevice::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 943 of file AUD_OpenALDevice.cpp.

References AUD_STATUS_INVALID, AUD_STATUS_PAUSED, AUD_STATUS_PLAYING, i, lock(), and unlock().

float AUD_OpenALDevice::getVolume ( ) const [virtual]

Retrieves the overall device volume.

Returns:
The overall device volume.

Implements AUD_IDevice.

Definition at line 986 of file AUD_OpenALDevice.cpp.

float AUD_OpenALDevice::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 998 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

float AUD_OpenALDevice::getVolumeMaximum ( AUD_Handle handle) [virtual]

Retrieves the maximum volume of a source.

Parameters:
handleThe handle of the source.
Returns:
The maximum volume.

Implements AUD_I3DDevice.

Definition at line 1425 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

float AUD_OpenALDevice::getVolumeMinimum ( AUD_Handle handle) [virtual]

Retrieves the minimum volume of a source.

Parameters:
handleThe handle of the source.
Returns:
The minimum volume.

Implements AUD_I3DDevice.

Definition at line 1453 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

bool AUD_OpenALDevice::isRelative ( AUD_Handle handle) [virtual]

Checks whether the source location, velocity and orientation are relative to the listener.

Parameters:
handleThe handle of the source.
Returns:
Whether the source is relative.

Implements AUD_I3DDevice.

Definition at line 1398 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

void AUD_OpenALDevice::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 976 of file AUD_OpenALDevice.cpp.

Referenced by getAttenuation(), getConeAngleInner(), getConeAngleOuter(), getConeVolumeOuter(), getDistanceMaximum(), getDistanceReference(), getKeep(), getLoopCount(), getPitch(), getPosition(), getSourceLocation(), getSourceVelocity(), getStatus(), getVolume(), getVolumeMaximum(), getVolumeMinimum(), isRelative(), pause(), play(), resume(), seek(), setAttenuation(), setConeAngleInner(), setConeAngleOuter(), setConeVolumeOuter(), setDistanceMaximum(), setDistanceReference(), setKeep(), setLoopCount(), setPitch(), setRelative(), setSourceLocation(), setSourceOrientation(), setSourceVelocity(), setStopCallback(), setVolume(), setVolumeMaximum(), setVolumeMinimum(), stop(), updateStreams(), and ~AUD_OpenALDevice().

bool AUD_OpenALDevice::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 721 of file AUD_OpenALDevice.cpp.

References i, lock(), and unlock().

Referenced by updateStreams().

AUD_Handle * AUD_OpenALDevice::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 542 of file AUD_OpenALDevice.cpp.

References AUD_CHANNELS_INVALID, AUD_DEVICE_SAMPLE_SIZE, AUD_ERROR_OPENAL, AUD_FORMAT_FLOAT32, AUD_OPENAL_CYCLE_BUFFERS, AUD_THROW, AUD_OpenALHandle::buffers, AUD_DeviceSpecs::channels, AUD_OpenALHandle::current, AUD_OpenALHandle::data_end, AUD_OpenALHandle::format, AUD_DeviceSpecs::format, AUD_IReader::getSpecs(), i, AUD_OpenALHandle::isBuffered, AUD_OpenALHandle::keep, length(), lock(), AUD_OpenALHandle::loopcount, NULL, AUD_DeviceSpecs::rate, AUD_IReader::read(), AUD_OpenALHandle::reader, AUD_OpenALHandle::source, AUD_DeviceSpecs::specs, AUD_OpenALHandle::stop, AUD_OpenALHandle::stop_data, and unlock().

Referenced by play().

AUD_Handle * AUD_OpenALDevice::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 645 of file AUD_OpenALDevice.cpp.

References AUD_ERROR_OPENAL, AUD_THROW, AUD_IFactory::createReader(), AUD_OpenALHandle::current, AUD_OpenALHandle::data_end, i, AUD_OpenALHandle::isBuffered, AUD_OpenALHandle::keep, lock(), AUD_OpenALHandle::loopcount, NULL, play(), AUD_OpenALHandle::source, AUD_OpenALHandle::stop, AUD_OpenALHandle::stop_data, and unlock().

bool AUD_OpenALDevice::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 746 of file AUD_OpenALDevice.cpp.

References i, lock(), and unlock().

bool AUD_OpenALDevice::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 855 of file AUD_OpenALDevice.cpp.

References AUD_DEVICE_SAMPLE_SIZE, AUD_OPENAL_CYCLE_BUFFERS, AUD_OpenALHandle::buffers, AUD_OpenALHandle::current, AUD_OpenALHandle::data_end, err, AUD_OpenALHandle::format, AUD_IReader::getSpecs(), i, AUD_OpenALHandle::isBuffered, length(), lock(), AUD_Specs::rate, AUD_DeviceSpecs::rate, AUD_IReader::read(), AUD_OpenALHandle::reader, AUD_IReader::seek(), AUD_OpenALHandle::source, AUD_DeviceSpecs::specs, and unlock().

bool AUD_OpenALDevice::setAttenuation ( AUD_Handle handle,
float  factor 
) [virtual]

Sets the attenuation of a source. This value is used for distance calculation.

Parameters:
handleThe handle of the source.
factorThe new attenuation.
Returns:
Whether the action succeeded.

Implements AUD_I3DDevice.

Definition at line 1548 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

bool AUD_OpenALDevice::setConeAngleInner ( AUD_Handle handle,
float  angle 
) [virtual]

Sets the inner angle of the cone of a source.

Parameters:
handleThe handle of the source.
angleThe new inner angle of the cone.
Returns:
Whether the action succeeded.

Implements AUD_I3DDevice.

Definition at line 1602 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

bool AUD_OpenALDevice::setConeAngleOuter ( AUD_Handle handle,
float  angle 
) [virtual]

Sets the outer angle of the cone of a source.

Parameters:
handleThe handle of the source.
angleThe new outer angle of the cone.
Returns:
Whether the action succeeded.

Implements AUD_I3DDevice.

Definition at line 1575 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

bool AUD_OpenALDevice::setConeVolumeOuter ( AUD_Handle handle,
float  volume 
) [virtual]

Sets the outer volume of the cone of a source. The volume between inner and outer angle is interpolated between inner volume and this value.

Parameters:
handleThe handle of the source.
volumeThe new outer volume of the cone.
Returns:
Whether the action succeeded.

Implements AUD_I3DDevice.

Definition at line 1629 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

bool AUD_OpenALDevice::setDistanceMaximum ( AUD_Handle handle,
float  distance 
) [virtual]

Sets the maximum distance of a source. If a source is further away from the reader than this distance, the volume will automatically be set to 0.

Parameters:
handleThe handle of the source.
distanceThe new maximum distance.
Returns:
Whether the action succeeded.

Implements AUD_I3DDevice.

Definition at line 1494 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

void AUD_OpenALDevice::setDistanceModel ( AUD_DistanceModel  model) [virtual]
bool AUD_OpenALDevice::setDistanceReference ( AUD_Handle handle,
float  distance 
) [virtual]

Sets the reference distance of a source.

Parameters:
handleThe handle of the source.
distanceThe new reference distance.
Returns:
Whether the action succeeded.

Implements AUD_I3DDevice.

Definition at line 1521 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

void AUD_OpenALDevice::setDopplerFactor ( float  factor) [virtual]

Sets the doppler factor. This value is a scaling factor for the velocity vectors of sources and listener which is used while calculating the doppler effect.

Parameters:
factorThe new doppler factor.

Implements AUD_I3DDevice.

Definition at line 1259 of file AUD_OpenALDevice.cpp.

bool AUD_OpenALDevice::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 838 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

void AUD_OpenALDevice::setListenerLocation ( const AUD_Vector3 location) [virtual]

Sets the listener location.

Parameters:
locationThe new location.

Implements AUD_I3DDevice.

Definition at line 1203 of file AUD_OpenALDevice.cpp.

References AUD_Vector3::get().

void AUD_OpenALDevice::setListenerOrientation ( const AUD_Quaternion orientation) [virtual]

Sets the listener orientation.

Parameters:
orientationThe new orientation as quaternion.

Implements AUD_I3DDevice.

Definition at line 1226 of file AUD_OpenALDevice.cpp.

References AUD_Quaternion::w(), AUD_Quaternion::x(), AUD_Quaternion::y(), and AUD_Quaternion::z().

void AUD_OpenALDevice::setListenerVelocity ( const AUD_Vector3 velocity) [virtual]

Sets the listener velocity.

Parameters:
velocityThe new velocity.

Implements AUD_I3DDevice.

Definition at line 1215 of file AUD_OpenALDevice.cpp.

References AUD_Vector3::get().

bool AUD_OpenALDevice::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 1048 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

bool AUD_OpenALDevice::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 1028 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

bool AUD_OpenALDevice::setRelative ( AUD_Handle handle,
bool  relative 
) [virtual]

Sets whether the source location, velocity and orientation are relative to the listener.

Parameters:
handleThe handle of the source.
relativeWhether the source is relative.
Returns:
Whether the action succeeded.

Implements AUD_I3DDevice.

Definition at line 1412 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

bool AUD_OpenALDevice::setSourceLocation ( AUD_Handle handle,
const AUD_Vector3 location 
) [virtual]

Sets the location of a source.

Parameters:
handleThe handle of the source.
locationThe new location.
Returns:
Whether the action succeeded.

Implements AUD_I3DDevice.

Definition at line 1328 of file AUD_OpenALDevice.cpp.

References AUD_Vector3::get(), lock(), and unlock().

bool AUD_OpenALDevice::setSourceOrientation ( AUD_Handle handle,
const AUD_Quaternion orientation 
) [virtual]

Sets the orientation of a source.

Parameters:
handleThe handle of the source.
orientationThe new orientation as quaternion.
Returns:
Whether the action succeeded.

Implements AUD_I3DDevice.

Definition at line 1376 of file AUD_OpenALDevice.cpp.

References lock(), unlock(), AUD_Quaternion::w(), AUD_Quaternion::x(), AUD_Quaternion::y(), and AUD_Quaternion::z().

bool AUD_OpenALDevice::setSourceVelocity ( AUD_Handle handle,
const AUD_Vector3 velocity 
) [virtual]

Sets the velocity of a source.

Parameters:
handleThe handle of the source.
velocityThe new velocity.
Returns:
Whether the action succeeded.

Implements AUD_I3DDevice.

Definition at line 1357 of file AUD_OpenALDevice.cpp.

References AUD_Vector3::get(), lock(), and unlock().

void AUD_OpenALDevice::setSpeedOfSound ( float  speed) [virtual]

Sets the speed of sound. This value is needed for doppler effect calculation.

Parameters:
speedThe new speed of sound.

Implements AUD_I3DDevice.

Definition at line 1249 of file AUD_OpenALDevice.cpp.

bool AUD_OpenALDevice::setStopCallback ( AUD_Handle handle,
stopCallback  callback = NULL,
void *  data = NULL 
) [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 1058 of file AUD_OpenALDevice.cpp.

References lock(), AUD_OpenALHandle::stop, AUD_OpenALHandle::stop_data, and unlock().

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

Sets the overall device volume.

Parameters:
handleThe sound handle.
volumeThe overall device volume.

Implements AUD_IDevice.

Definition at line 993 of file AUD_OpenALDevice.cpp.

bool AUD_OpenALDevice::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 1008 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

bool AUD_OpenALDevice::setVolumeMaximum ( AUD_Handle handle,
float  volume 
) [virtual]

Sets the maximum volume of a source.

Parameters:
handleThe handle of the source.
volumeThe new maximum volume.
Returns:
Whether the action succeeded.

Implements AUD_I3DDevice.

Definition at line 1439 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

bool AUD_OpenALDevice::setVolumeMinimum ( AUD_Handle handle,
float  volume 
) [virtual]

Sets the minimum volume of a source.

Parameters:
handleThe handle of the source.
volumeThe new minimum volume.
Returns:
Whether the action succeeded.

Implements AUD_I3DDevice.

Definition at line 1467 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

bool AUD_OpenALDevice::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 771 of file AUD_OpenALDevice.cpp.

References AUD_OPENAL_CYCLE_BUFFERS, AUD_OpenALHandle::buffers, i, AUD_OpenALHandle::isBuffered, lock(), AUD_OpenALHandle::reader, AUD_OpenALHandle::source, and unlock().

Referenced by updateStreams().

void AUD_OpenALDevice::unlock ( ) [virtual]
void AUD_OpenALDevice::updateStreams ( )

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