Blender V2.61 - r43446
Classes | Public Member Functions

AUD_OpenALDevice Class Reference

#include <AUD_OpenALDevice.h>

Inheritance diagram for AUD_OpenALDevice:
Inheritance graph
[legend]

List of all members.

Classes

class  AUD_OpenALHandle
 Saves the data for playback.

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_Reference
< AUD_IHandle
play (AUD_Reference< AUD_IReader > reader, bool keep=false)
virtual AUD_Reference
< AUD_IHandle
play (AUD_Reference< AUD_IFactory > factory, bool keep=false)
virtual void stopAll ()
virtual void lock ()
virtual void unlock ()
virtual float getVolume () const
virtual void setVolume (float volume)
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)

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 969 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, addon::enums::devices, AUD_DeviceSpecs::format, NULL, AUD_DeviceSpecs::rate, and strlen().

AUD_OpenALDevice::~AUD_OpenALDevice ( ) [virtual]

Definition at line 1032 of file AUD_OpenALDevice.cpp.

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


Member Function Documentation

AUD_DistanceModel AUD_OpenALDevice::getDistanceModel ( ) const [virtual]
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 1503 of file AUD_OpenALDevice.cpp.

AUD_Vector3 AUD_OpenALDevice::getListenerLocation ( ) const [virtual]

Retrieves the listener location.

Returns:
The listener location.

Implements AUD_I3DDevice.

Definition at line 1445 of file AUD_OpenALDevice.cpp.

AUD_Quaternion AUD_OpenALDevice::getListenerOrientation ( ) const [virtual]

Retrieves the listener orientation.

Returns:
The listener orientation as quaternion.

Implements AUD_I3DDevice.

Definition at line 1469 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 1457 of file AUD_OpenALDevice.cpp.

AUD_DeviceSpecs AUD_OpenALDevice::getSpecs ( ) const [virtual]

Returns the specification of the device.

Implements AUD_IDevice.

Definition at line 1068 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 1493 of file AUD_OpenALDevice.cpp.

float AUD_OpenALDevice::getVolume ( ) const [virtual]

Retrieves the overall device volume.

Returns:
The overall device volume.

Implements AUD_IDevice.

Definition at line 1311 of file AUD_OpenALDevice.cpp.

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 1301 of file AUD_OpenALDevice.cpp.

Referenced by play(), stopAll(), updateStreams(), and ~AUD_OpenALDevice().

AUD_Reference< AUD_IHandle > AUD_OpenALDevice::play ( AUD_Reference< 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 1209 of file AUD_OpenALDevice.cpp.

References play().

AUD_Reference< AUD_IHandle > AUD_OpenALDevice::play ( AUD_Reference< 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 1164 of file AUD_OpenALDevice.cpp.

References AUD_CHANNELS_INVALID, AUD_FORMAT_FLOAT32, AUD_Specs::channels, AUD_DeviceSpecs::format, lock(), and unlock().

Referenced by play().

void AUD_OpenALDevice::setDistanceModel ( AUD_DistanceModel  model) [virtual]
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 1508 of file AUD_OpenALDevice.cpp.

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

Sets the listener location.

Parameters:
locationThe new location.

Implements AUD_I3DDevice.

Definition at line 1452 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 1474 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 1464 of file AUD_OpenALDevice.cpp.

References AUD_Vector3::get().

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 1498 of file AUD_OpenALDevice.cpp.

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 1318 of file AUD_OpenALDevice.cpp.

void AUD_OpenALDevice::stopAll ( ) [virtual]

Stops all playing sounds.

Implements AUD_IDevice.

Definition at line 1286 of file AUD_OpenALDevice.cpp.

References lock(), and unlock().

void AUD_OpenALDevice::unlock ( ) [virtual]

Unlocks the previously locked device.

Implements AUD_IDevice.

Definition at line 1306 of file AUD_OpenALDevice.cpp.

Referenced by play(), stopAll(), updateStreams(), and ~AUD_OpenALDevice().

void AUD_OpenALDevice::updateStreams ( )

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