Isle
|
[AI] Manages caching, reuse, and playback of LegoCacheSound objects. More...
#include <legocachesoundmanager.h>
Public Member Functions | |
LegoCacheSoundManager () | |
[AI] Default constructor. [AI] More... | |
~LegoCacheSoundManager () | |
[AI] Destructor. Cleans up all cached sound entries in set and list, stops sounds and deletes sound objects. [AI] More... | |
virtual MxResult | Tickle () |
[AI] Advances or cleans up all managed sounds. More... | |
LegoCacheSound * | FindSoundByKey (const char *p_key) |
[AI] Attempts to find and return a cached sound by its key (case-insensitive). More... | |
LegoCacheSound * | ManageSoundEntry (LegoCacheSound *p_sound) |
[AI] Manages a sound entry. More... | |
LegoCacheSound * | Play (const char *p_key, const char *p_name, MxBool p_looping) |
[AI] Plays a sound identified by key, with the given playback name and looping flag. More... | |
LegoCacheSound * | Play (LegoCacheSound *p_sound, const char *p_name, MxBool p_looping) |
[AI] Plays a given sound object, with named playback and looping option. More... | |
void | Stop (LegoCacheSound *&p_sound) |
[AI] Stops playback of the specified sound object. More... | |
void | Destroy (LegoCacheSound *&p_sound) |
[AI] Destroys (deletes and removes) the specified sound object from all tracking. More... | |
[AI] Manages caching, reuse, and playback of LegoCacheSound objects.
Provides fast sound lookup by name/key, supports object reuse, sound playback, and sound destruction. [AI]
[AI] Holds two containers: a set for quick lookup (by name) and a list for managing sounds in use, properly cleaning up both on destruction. [AI] Size: 0x20 bytes.
Definition at line 81 of file legocachesoundmanager.h.
|
inline |
[AI] Default constructor. [AI]
Definition at line 84 of file legocachesoundmanager.h.
LegoCacheSoundManager::~LegoCacheSoundManager | ( | ) |
[AI] Destructor. Cleans up all cached sound entries in set and list, stops sounds and deletes sound objects. [AI]
Definition at line 10 of file legocachesoundmanager.cpp.
void LegoCacheSoundManager::Destroy | ( | LegoCacheSound *& | p_sound | ) |
[AI] Destroys (deletes and removes) the specified sound object from all tracking.
[AI]
p_sound | Reference to sound pointer to destroy. Removes, stops and deletes its memory. [AI] |
Definition at line 173 of file legocachesoundmanager.cpp.
LegoCacheSound * LegoCacheSoundManager::FindSoundByKey | ( | const char * | p_key | ) |
[AI] Attempts to find and return a cached sound by its key (case-insensitive).
If not present, returns NULL. [AI]
p_key | Name/key for the sound. [AI] |
Definition at line 65 of file legocachesoundmanager.cpp.
LegoCacheSound * LegoCacheSoundManager::ManageSoundEntry | ( | LegoCacheSound * | p_sound | ) |
[AI] Manages a sound entry.
Adds new one or returns existing one (by internal cache). [AI]
[AI] If a sound with the same data already exists, the new one may be destroyed. [AI]
p_sound | The sound object to manage. [AI] |
Definition at line 81 of file legocachesoundmanager.cpp.
LegoCacheSound * LegoCacheSoundManager::Play | ( | const char * | p_key, |
const char * | p_name, | ||
MxBool | p_looping | ||
) |
[AI] Plays a sound identified by key, with the given playback name and looping flag.
Will play a managed or cloned version. [AI]
p_key | Key identifying the sound to play. [AI] |
p_name | Name to use for playback. [AI] |
p_looping | Should the sound play looped. [AI] |
Definition at line 108 of file legocachesoundmanager.cpp.
LegoCacheSound * LegoCacheSoundManager::Play | ( | LegoCacheSound * | p_sound, |
const char * | p_name, | ||
MxBool | p_looping | ||
) |
[AI] Plays a given sound object, with named playback and looping option.
Handles cloning if required. [AI]
p_sound | Sound object to play. [AI] |
p_name | Playback label/name used in the sound engine. [AI] |
p_looping | Should the sound play looped. [AI] |
Definition at line 115 of file legocachesoundmanager.cpp.
void LegoCacheSoundManager::Stop | ( | LegoCacheSound *& | p_sound | ) |
[AI] Stops playback of the specified sound object.
[AI]
p_sound | Reference to pointer of sound; only matches by pointer. [AI] |
Definition at line 140 of file legocachesoundmanager.cpp.
|
virtual |
[AI] Advances or cleans up all managed sounds.
Invokes internal logic for cleanup and update of cached sounds. [AI]
Definition at line 31 of file legocachesoundmanager.cpp.