SoundManager Class Reference

#include <SoundManager.h>

Inheritance diagram for SoundManager:
ListenerObject

# Public Member Functions

void updateSounds ()
 Update the sounds lists.
void playSounds (uint32 elapsedMicroseconds)
void reset ()
 Reset the manager's state.
void setPCMTargetPlaybackRefreshRate (uint16 pcmTargetPlaybackRefreshRate)
bool isPlayingSound (const SoundSpec *soundSpec)
void muteAllSounds ()
 Mute all playing sounds.
void unmuteAllSounds ()
 Unmute all playing sounds.
void rewindAllSounds ()
 Rewind all playing sounds.
void stopAllSounds (bool release, SoundSpec **excludedSounds)
void lock ()
 Refuse petitions to play or allocate sounds are processed.
void unlock ()
 Allow petitions to play or allocate sounds are processed.
void print (int32 x, int32 y)
 Print the manager's status.
void printPlaybackTime (int32 x, int32 y)
 Print playback time of the playing sounds.

# Static Public Member Functions

static bool playSound (const SoundSpec *soundSpec, const Vector3D *position, uint32 playbackType, ListenerObject scope)
static Sound getSound (const SoundSpec *soundSpec, ListenerObject scope)
static Sound findSound (const SoundSpec *soundSpec, ListenerObject scope)

# Protected Attributes

VirtualList sounds
 List of playing sounds.
uint32 targetPCMUpdates
 Target PCM cycles per game cycle.
bool lock
 If raised, no petitions to play or allocate sounds are processed.

# Additional Inherited Members

- Private Member Functions inherited from ListenerObject
void constructor ()
 Class' constructor.
void destructor ()
 Class' destructor.
void addEventListener (ListenerObject listener, uint16 eventCode)
void removeEventListener (ListenerObject listener, uint16 eventCode)
void removeEventListeners (uint16 eventCode)
void removeAllEventListeners ()
 Remove all listener objects.
bool hasActiveEventListeners ()
void fireEvent (uint16 eventCode)
void sendMessageTo (ListenerObject receiver, uint32 message, uint32 delay, uint32 randomDelay)
void sendMessageToSelf (uint32 message, uint32 delay, uint32 randomDelay)
void discardAllMessages ()
 Discard all messages, both to be sent and to be received.
void discardMessages (uint32 message)
virtual bool onEvent (ListenerObject eventFirer, uint16 eventCode)
virtual bool handleMessage (Telegram telegram)
- Private Attributes inherited from ListenerObject
VirtualList events
 List of registered events.
int8 eventFirings
 Counter that keeps track of the number of fired events to prevent race conditions in nested firings.

# Detailed Description

Class SoundManager

Inherits from ListenerObject

Manages the Sound instances.

Definition at line 39 of file SoundManager.h.

# Member Function Documentation

# findSound()

static Sound SoundManager::findSound ( const SoundSpec * soundSpec,
ListenerObject scope )
static

Retrieve a previously allocated sound defined by the provided spec.

Parameters
soundSpecSpec that defines the sound to play
soundReleaseListenerCallback method for when the sound is released
scopeObject that will be notified of communication events

Definition at line 79 of file SoundManager.c.

# getSound()

static Sound SoundManager::getSound ( const SoundSpec * soundSpec,
ListenerObject scope )
static

Allocate sound defined by the provided spec.

Parameters
soundSpecSpec that defines the sound to play
soundReleaseListenerCallback method for when the sound is released
scopeObject that will be notified of communication events

Definition at line 65 of file SoundManager.c.

# isPlayingSound()

bool SoundManager::isPlayingSound ( const SoundSpec * soundSpec)

Check if a sound with the provided spec is playing.

Parameters
soundSpecSound spec to check for

Definition at line 231 of file SoundManager.c.

# lock()

void SoundManager::lock ( )

Refuse petitions to play or allocate sounds are processed.

# muteAllSounds()

void SoundManager::muteAllSounds ( )

Mute all playing sounds.

Definition at line 250 of file SoundManager.c.

# playSound()

static bool SoundManager::playSound ( const SoundSpec * soundSpec,
const Vector3D * position,
uint32 playbackType,
ListenerObject scope )
static

Play a sound defined by the provided spec.

Parameters
soundSpecSpec that defines the sound to play
positionPosition for spatilly position sound
playbackTypeHow to play the sound
scopeObject on which to perform the callback

Definition at line 38 of file SoundManager.c.

# playSounds()

secure void SoundManager::playSounds ( uint32 elapsedMicroseconds)

Play the allocated sounds.

Parameters
elapsedMicrosecondsElapsed time between call

Definition at line 168 of file SoundManager.c.

# print()

void SoundManager::print ( int32 x,
int32 y )

Print the manager's status.

# printPlaybackTime()

void SoundManager::printPlaybackTime ( int32 x,
int32 y )

Print playback time of the playing sounds.

# reset()

secure void SoundManager::reset ( )

Reset the manager's state.

Definition at line 195 of file SoundManager.c.

# rewindAllSounds()

void SoundManager::rewindAllSounds ( )

Rewind all playing sounds.

Definition at line 278 of file SoundManager.c.

# setPCMTargetPlaybackRefreshRate()

void SoundManager::setPCMTargetPlaybackRefreshRate ( uint16 pcmTargetPlaybackRefreshRate)

Set the target refresh rate for PCM playback.

Parameters
pcmTargetPlaybackRefreshRateTarget refresh rate for PCM playback

Definition at line 217 of file SoundManager.c.

# stopAllSounds()

void SoundManager::stopAllSounds ( bool release,
SoundSpec ** excludedSounds )

Stop all playing sounds.

Parameters
releaseIf true, sounds are not only stopped but released
excludedSoundsArray of sound specs to not stop

Definition at line 292 of file SoundManager.c.

# unlock()

void SoundManager::unlock ( )

Allow petitions to play or allocate sounds are processed.

Definition at line 351 of file SoundManager.c.

# unmuteAllSounds()

void SoundManager::unmuteAllSounds ( )

Unmute all playing sounds.

Definition at line 264 of file SoundManager.c.

# updateSounds()

secure void SoundManager::updateSounds ( )

Update the sounds lists.

Definition at line 144 of file SoundManager.c.

# Member Data Documentation

# lock

void SoundManager::lock
protected

If raised, no petitions to play or allocate sounds are processed.

Definition at line 50 of file SoundManager.h.

# sounds

VirtualList SoundManager::sounds
protected

List of playing sounds.

Definition at line 44 of file SoundManager.h.

# targetPCMUpdates

uint32 SoundManager::targetPCMUpdates
protected

Target PCM cycles per game cycle.

Definition at line 47 of file SoundManager.h.


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