Cafu Engine
SoundImplT Class Reference

OpenAL implementation of the SoundI interface. More...

#include "SoundImpl.hpp"

Inheritance diagram for SoundImplT:

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...
 
- Public Member Functions inherited from SoundI
virtual ~SoundI ()
 The virtual destructor makes sure that deleting derived classes via a SoundI pointer works properly. More...
 

Public Attributes

BufferTBuffer
 The buffer played by this sound. More...
 
MixerTrackTMixerTrack
 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...
 

Detailed Description

OpenAL implementation of the SoundI interface.

Constructor & Destructor Documentation

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.

Parameters
SoundSysThe 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.

Member Function Documentation

float SoundImplT::GetInnerConeAngle ( ) const
virtual

Gets the angle of the inner sound cone.

Implements SoundI.

float SoundImplT::GetInnerVolume ( ) const
virtual

Gets the volume.

Implements SoundI.

float SoundImplT::GetMaxDistance ( ) const
virtual

Gets the maximal distance.

Implements SoundI.

float SoundImplT::GetMinDistance ( ) const
virtual

Gets the minimal distance.

Implements SoundI.

float SoundImplT::GetOuterConeAngle ( ) const
virtual

Sets the angle of the outer sound cone.

Implements SoundI.

float SoundImplT::GetOuterVolume ( ) const
virtual

Gets the volume inside the outer sound cone.

Implements SoundI.

unsigned int SoundImplT::GetPriority ( ) const
virtual

Gets the priority of this sound.

Implements SoundI.

bool SoundImplT::Is3D ( ) const
virtual

Checks if the sound is for 3D playback.

Implements SoundI.

bool SoundImplT::IsPlaying ( ) const
virtual

Checks if the sound is currently playing.

Implements SoundI.

void SoundImplT::Pause ( )
virtual

Pauses the sound.

Implements SoundI.

bool SoundImplT::Play ( )
virtual

Plays the sound using the current sound system.

Implements SoundI.

void SoundImplT::ResetProperties ( )
virtual

Resets the sound properties to those of the shader it was created from.

Implements SoundI.

bool SoundImplT::Resume ( )
virtual

Resumes a previously paused sound.

Implements SoundI.

void SoundImplT::SetDirection ( const Vector3dT Direction_)
virtual

Sets the direction into which the sound source is moving.

Implements SoundI.

void SoundImplT::SetInnerConeAngle ( float  InnerConeAngle_)
virtual

Sets the angle of the inner sound cone.

Implements SoundI.

void SoundImplT::SetInnerVolume ( float  InnerVolume_)
virtual

Sets the volume.

Implements SoundI.

void SoundImplT::SetMaxDistance ( float  MaxDist_)
virtual

Sets the maximal distance.

Implements SoundI.

void SoundImplT::SetMinDistance ( float  MinDist_)
virtual

Sets the minimal distance.

Implements SoundI.

void SoundImplT::SetOuterConeAngle ( float  OuterConeAngle_)
virtual

Sets the angle of the outer sound cone.

Implements SoundI.

void SoundImplT::SetOuterVolume ( float  OuterVolume_)
virtual

Sets the volume inside the outer sound cone.

Implements SoundI.

void SoundImplT::SetPosition ( const Vector3dT Position_)
virtual

Set the position from which the sound is emanating.

Implements SoundI.

void SoundImplT::SetPriority ( unsigned int  Priority_)
virtual

Sets the priority of this sound.

Implements SoundI.

void SoundImplT::SetVelocity ( const Vector3dT Velocity_)
virtual

Sets the velocity of the source that emits the sound.

Implements SoundI.

void SoundImplT::Stop ( )
virtual

Stops the sound.

Implements SoundI.

Member Data Documentation

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).


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