Cafu Engine
SoundSysImplT Class Reference

OpenAL implementation of the sound system. More...

#include "SoundSysImpl.hpp"

Inheritance diagram for SoundSysImplT:

Public Member Functions

bool Initialize ()
 Initializes the sound system. More...
 
void Release ()
 Releases the sound system and removes all sound data from memory. More...
 
bool IsSupported ()
 Determine if the sound system is supported on this platform. More...
 
int GetPreferenceNr ()
 Returns the preference number for this sound system, so calling code can decide which sound system to use. More...
 
SoundICreateSound2D (const SoundShaderT *SoundShader)
 Creates a 2 dimensional sound object using the properties of the passed sound shader. More...
 
SoundICreateSound3D (const SoundShaderT *SoundShader)
 Creates a 3 dimensional sound object using the properties of the passed sound shader. More...
 
void DeleteSound (SoundI *Sound)
 Deletes a previously created sound object. More...
 
bool PlaySound (const SoundI *Sound)
 Plays a sound on a channel. More...
 
void SetMasterVolume (float Volume)
 Sets the master volume for this sound system. More...
 
float GetMasterVolume ()
 Gets the master volume currently set for this sound system. More...
 
void Update ()
 Upates all channels that are currently being played according to the properties of their sound object. More...
 
void UpdateListener (const Vector3dT &Position, const Vector3dT &Velocity, const Vector3fT &OrientationForward, const Vector3fT &OrientationUp)
 Updates the position, velocity and orientation of the listener. More...
 
- Public Member Functions inherited from SoundSysI
virtual ~SoundSysI ()
 The virtual destructor makes sure that deleting derived classes via a SoundSysI pointer works properly. More...
 

Static Public Member Functions

static SoundSysImplTGetInstance ()
 Creates an instance of the OpenAL sound system. More...
 

Detailed Description

OpenAL implementation of the sound system.

Member Function Documentation

SoundI * SoundSysImplT::CreateSound2D ( const SoundShaderT SoundShader)
virtual

Creates a 2 dimensional sound object using the properties of the passed sound shader.

Parameters
SoundShaderSound shader to use with this sound object.

Implements SoundSysI.

SoundI * SoundSysImplT::CreateSound3D ( const SoundShaderT SoundShader)
virtual

Creates a 3 dimensional sound object using the properties of the passed sound shader.

Parameters
SoundShaderSound shader to use with this sound object.

Implements SoundSysI.

void SoundSysImplT::DeleteSound ( SoundI Sound)
virtual

Deletes a previously created sound object.

Parameters
SoundThe sound object to delete.

Implements SoundSysI.

SoundSysImplT & SoundSysImplT::GetInstance ( )
static

Creates an instance of the OpenAL sound system.

float SoundSysImplT::GetMasterVolume ( )
virtual

Gets the master volume currently set for this sound system.

Returns
The current master volume [0, 1].

Implements SoundSysI.

int SoundSysImplT::GetPreferenceNr ( )
virtual

Returns the preference number for this sound system, so calling code can decide which sound system to use.

Returns
Preference number.

Implements SoundSysI.

bool SoundSysImplT::Initialize ( )
virtual

Initializes the sound system.

Implements SoundSysI.

bool SoundSysImplT::IsSupported ( )
virtual

Determine if the sound system is supported on this platform.

Returns
Whether or not the sound system is supported.

Implements SoundSysI.

bool SoundSysImplT::PlaySound ( const SoundI Sound)
virtual

Plays a sound on a channel.

Parameters
SoundThe sound object that should be played.
Returns
true if sound is played on a channel, false if no channel was free (and playing sound have all greater priority than this sound).

Implements SoundSysI.

void SoundSysImplT::Release ( )
virtual

Releases the sound system and removes all sound data from memory.

Implements SoundSysI.

void SoundSysImplT::SetMasterVolume ( float  Volume)
virtual

Sets the master volume for this sound system.

Parameters
VolumeThe new master volume. Value has to be 0, 1.

Implements SoundSysI.

void SoundSysImplT::Update ( )
virtual

Upates all channels that are currently being played according to the properties of their sound object.

Implements SoundSysI.

void SoundSysImplT::UpdateListener ( const Vector3dT Position,
const Vector3dT Velocity,
const Vector3fT OrientationForward,
const Vector3fT OrientationUp 
)
virtual

Updates the position, velocity and orientation of the listener.

Parameters
PositionPosition of the listener in the 3D Space.
VelocityVelocity of the listener.
OrientationForwardForward orientation of the listener (unit length vector).
OrientationUpUpwards orientation of the listener (unit length vector).

Implements SoundSysI.


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