OpenAL implementation of the SoundI interface. More...
#include "SoundImpl.hpp"
Public Member Functions | |
SoundImplT (SoundSysImplT *SoundSys, bool Is3D_, const SoundShaderT *Shader_=NULL, BufferT *Buffer_=NULL) | |
The constructor. More... | |
~SoundImplT () | |
The destructor. Deletes the sound by removing it from its current mixer track (if any) and buffer. More... | |
bool | Play () |
Plays the sound using the current sound system. More... | |
void | Stop () |
Stops the sound. More... | |
void | Pause () |
Pauses the sound. More... | |
bool | Resume () |
Resumes a previously paused sound. More... | |
bool | IsPlaying () const |
Checks if the sound is currently playing. More... | |
bool | Is3D () const |
Checks if the sound is for 3D playback. More... | |
void | ResetProperties () |
Resets the sound properties to those of the shader it was created from. More... | |
void | SetPosition (const Vector3dT &Position_) |
Set the position from which the sound is emanating. More... | |
void | SetVelocity (const Vector3dT &Velocity_) |
Sets the velocity of the source that emits the sound. More... | |
void | SetDirection (const Vector3dT &Direction_) |
Sets the direction into which the sound source is moving. More... | |
void | SetPriority (unsigned int Priority_) |
Sets the priority of this sound. More... | |
void | SetInnerVolume (float InnerVolume_) |
Sets the volume. More... | |
void | SetMinDistance (float MinDist_) |
Sets the minimal distance. More... | |
void | SetMaxDistance (float MaxDist_) |
Sets the maximal distance. More... | |
void | SetInnerConeAngle (float InnerConeAngle_) |
Sets the angle of the inner sound cone. More... | |
void | SetOuterConeAngle (float OuterConeAngle_) |
Sets the angle of the outer sound cone. More... | |
void | SetOuterVolume (float OuterVolume_) |
Sets the volume inside the outer sound cone. More... | |
unsigned int | GetPriority () const |
Gets the priority of this sound. More... | |
float | GetInnerVolume () const |
Gets the volume. More... | |
float | GetMinDistance () const |
Gets the minimal distance. More... | |
float | GetMaxDistance () const |
Gets the maximal distance. More... | |
float | GetInnerConeAngle () const |
Gets the angle of the inner sound cone. More... | |
float | GetOuterConeAngle () const |
Sets the angle of the outer sound cone. More... | |
float | GetOuterVolume () const |
Gets the volume inside the outer sound cone. More... | |
![]() | |
virtual | ~SoundI () |
The virtual destructor makes sure that deleting derived classes via a SoundI pointer works properly. More... | |
Public Attributes | |
BufferT * | Buffer |
The buffer played by this sound. More... | |
MixerTrackT * | MixerTrack |
The mixertrack on which this sound is played. More... | |
Vector3dT | Position |
Position of this sound in the world (only relevant if sound is 3D). More... | |
Vector3dT | Velocity |
Velocity of the the object that emits this sound (only relevant if sound is 3D). More... | |
Vector3dT | Direction |
Direction of the sound (only relevant if ConeAngle (defined in shader) is smaller than 360 degree and sound is 3D). More... | |
float | InnerVolume |
The volume of this sound (inside its sound cone/at minimal distance). 1.0 meaning 100% volume and 0.0 mute sound. More... | |
float | OuterVolume |
The sounds volume if listener is outside the sound cone. More... | |
float | InnerConeAngle |
The inner angle of the cone in which the sound is emited at normal volume. More... | |
float | OuterConeAngle |
The outer angle of the cone outside which the sound is emited at outside volume. More... | |
float | MinDistance |
The minimum distance that the sound will cease to continue growing louder at (stays at max. volume). More... | |
float | MaxDistance |
The maximum distance that the sound will cease to attenuate. More... | |
const bool | Is3DSound |
Whether the sound is 2D or 3D. More... | |
unsigned int | Priority |
Priority of the sound. Values <0 mean that the priority is not set and therefore obtained from the sound shader. More... | |
OpenAL implementation of the SoundI interface.
SoundImplT::SoundImplT | ( | SoundSysImplT * | SoundSys, |
bool | Is3D_, | ||
const SoundShaderT * | Shader_ = NULL , |
||
BufferT * | Buffer_ = NULL |
||
) |
The constructor.
Creates a new sound using a specified sound shader and buffer. If either sound shader or buffer are NULL the sound is invalid, and playing invalid sound files will fail.
SoundSys | The sound system this sound is created in. |
Is3D_ | Whether this sound is created as an 3 dimensional sound or not. |
Shader_ | The sound shader used by this sound. |
Buffer_ | The buffer that contains the audio data played by this sound. |
SoundImplT::~SoundImplT | ( | ) |
The destructor. Deletes the sound by removing it from its current mixer track (if any) and buffer.
|
virtual |
Gets the angle of the inner sound cone.
Implements SoundI.
|
virtual |
Gets the volume.
Implements SoundI.
|
virtual |
Gets the maximal distance.
Implements SoundI.
|
virtual |
Gets the minimal distance.
Implements SoundI.
|
virtual |
Sets the angle of the outer sound cone.
Implements SoundI.
|
virtual |
Gets the volume inside the outer sound cone.
Implements SoundI.
|
virtual |
Gets the priority of this sound.
Implements SoundI.
|
virtual |
Checks if the sound is for 3D playback.
Implements SoundI.
|
virtual |
Checks if the sound is currently playing.
Implements SoundI.
|
virtual |
Pauses the sound.
Implements SoundI.
|
virtual |
Plays the sound using the current sound system.
Implements SoundI.
|
virtual |
Resets the sound properties to those of the shader it was created from.
Implements SoundI.
|
virtual |
Resumes a previously paused sound.
Implements SoundI.
|
virtual |
Sets the direction into which the sound source is moving.
Implements SoundI.
|
virtual |
Sets the angle of the inner sound cone.
Implements SoundI.
|
virtual |
Sets the volume.
Implements SoundI.
|
virtual |
Sets the maximal distance.
Implements SoundI.
|
virtual |
Sets the minimal distance.
Implements SoundI.
|
virtual |
Sets the angle of the outer sound cone.
Implements SoundI.
|
virtual |
Sets the volume inside the outer sound cone.
Implements SoundI.
|
virtual |
Set the position from which the sound is emanating.
Implements SoundI.
|
virtual |
Sets the priority of this sound.
Implements SoundI.
|
virtual |
Sets the velocity of the source that emits the sound.
Implements SoundI.
|
virtual |
Stops the sound.
Implements SoundI.
BufferT* SoundImplT::Buffer |
The buffer played by this sound.
Vector3dT SoundImplT::Direction |
Direction of the sound (only relevant if ConeAngle (defined in shader) is smaller than 360 degree and sound is 3D).
float SoundImplT::InnerConeAngle |
The inner angle of the cone in which the sound is emited at normal volume.
float SoundImplT::InnerVolume |
The volume of this sound (inside its sound cone/at minimal distance). 1.0 meaning 100% volume and 0.0 mute sound.
const bool SoundImplT::Is3DSound |
Whether the sound is 2D or 3D.
float SoundImplT::MaxDistance |
The maximum distance that the sound will cease to attenuate.
float SoundImplT::MinDistance |
The minimum distance that the sound will cease to continue growing louder at (stays at max. volume).
MixerTrackT* SoundImplT::MixerTrack |
The mixertrack on which this sound is played.
float SoundImplT::OuterConeAngle |
The outer angle of the cone outside which the sound is emited at outside volume.
float SoundImplT::OuterVolume |
The sounds volume if listener is outside the sound cone.
Vector3dT SoundImplT::Position |
Position of this sound in the world (only relevant if sound is 3D).
unsigned int SoundImplT::Priority |
Priority of the sound. Values <0 mean that the priority is not set and therefore obtained from the sound shader.
Vector3dT SoundImplT::Velocity |
Velocity of the the object that emits this sound (only relevant if sound is 3D).