1#ifndef LEGOCACHESOUNDMANAGER_H
2#define LEGOCACHESOUNDMANAGER_H
9#pragma warning(disable : 4237)
33 if (m_sound ==
NULL && m_name !=
NULL) {
34 delete[]
const_cast<char*
>(m_name);
48 const char*
GetName()
const {
return m_name; }
66 return strcmpi(p_a.m_name, p_b.m_name) > 0;
71typedef set<LegoCacheSoundEntry, Set100d6b4cComparator>
Set100d6b4c;
[AI] Manages caching, reuse, and playback of LegoCacheSound objects.
LegoCacheSoundManager()
[AI] Default constructor. [AI]
void Destroy(LegoCacheSound *&p_sound)
[AI] Destroys (deletes and removes) the specified sound object from all tracking.
LegoCacheSound * FindSoundByKey(const char *p_key)
[AI] Attempts to find and return a cached sound by its key (case-insensitive).
~LegoCacheSoundManager()
[AI] Destructor. Cleans up all cached sound entries in set and list, stops sounds and deletes sound o...
LegoCacheSound * ManageSoundEntry(LegoCacheSound *p_sound)
[AI] Manages a sound entry.
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.
void Stop(LegoCacheSound *&p_sound)
[AI] Stops playback of the specified sound object.
virtual MxResult Tickle()
[AI] Advances or cleans up all managed sounds.
Sound cache object managing DirectSound buffers and 3D positioning for preloaded sound data.
set< LegoCacheSoundEntry, Set100d6b4cComparator > Set100d6b4c
[AI] Set of LegoCacheSoundEntry, sorted by case-insensitive name for fast lookup. [AI]
list< LegoCacheSoundEntry > List100d6b4c
[AI] List of LegoCacheSoundEntry, used for maintaining order of managed/playing sounds....
#define NULL
[AI] Null pointer value (C/C++ semantics).
[AI] STL compatibility layer header to provide consistent STL (Standard Template Library) types and a...
[AI] Represents a single entry in the cached sound system, linking a sound pointer with its identifyi...
LegoCacheSoundEntry(LegoCacheSound *p_sound, const char *p_name)
[AI] Constructs a sound entry with a given sound and name string pointer.
LegoCacheSoundEntry(LegoCacheSound *p_sound)
[AI] Constructs a sound entry referencing a given sound, using its internal name data.
const char * GetName() const
[AI] Returns the name (string key) of this sound entry. [AI]
bool operator<(LegoCacheSoundEntry) const
[AI] Dummy less-than operator (always returns false).
~LegoCacheSoundEntry()
[AI] Destructor for LegoCacheSoundEntry. Deletes the name only if entry does NOT own a sound (m_sound...
LegoCacheSoundEntry()
[AI] Constructs an empty sound entry with null pointers. [AI]
bool operator==(LegoCacheSoundEntry) const
[AI] Dummy equality operator (always returns false).
LegoCacheSound * GetSound() const
[AI] Returns the pointer to the cached LegoCacheSound. [AI]
[AI] Comparator used in the sound cache sound entry set (Set100d6b4c).
bool operator()(const LegoCacheSoundEntry &p_a, const LegoCacheSoundEntry &p_b) const
[AI] Performs case-insensitive reverse-lexical comparison between sound names (for set order).