SoundManager Class Reference
#include <SoundManager.h>
![](../class_sound_manager.png)
# 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 | |
![]() | |
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) |
![]() | |
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 |
Retrieve a previously allocated sound defined by the provided spec.
- Parameters
-
soundSpec Spec that defines the sound to play soundReleaseListener Callback method for when the sound is released scope Object that will be notified of communication events
Definition at line 79 of file SoundManager.c.
# getSound()
|
static |
Allocate sound defined by the provided spec.
- Parameters
-
soundSpec Spec that defines the sound to play soundReleaseListener Callback method for when the sound is released scope Object that will be notified of communication events
Definition at line 65 of file SoundManager.c.
# isPlayingSound()
Check if a sound with the provided spec is playing.
- Parameters
-
soundSpec Sound 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 |
Play a sound defined by the provided spec.
- Parameters
-
soundSpec Spec that defines the sound to play position Position for spatilly position sound playbackType How to play the sound scope Object 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
-
elapsedMicroseconds Elapsed time between call
Definition at line 168 of file SoundManager.c.
# print()
# printPlaybackTime()
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
-
pcmTargetPlaybackRefreshRate Target refresh rate for PCM playback
Definition at line 217 of file SoundManager.c.
# stopAllSounds()
Stop all playing sounds.
- Parameters
-
release If true, sounds are not only stopped but released excludedSounds Array 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
|
protected |
If raised, no petitions to play or allocate sounds are processed.
Definition at line 50 of file SoundManager.h.
# sounds
|
protected |
List of playing sounds.
Definition at line 44 of file SoundManager.h.
# 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:
- VUEngine-Core/source/Sound/SoundManager.h
- VUEngine-Core/source/Sound/SoundManager.c