Isle
|
Sound cache object managing DirectSound buffers and 3D positioning for preloaded sound data. More...
#include <legocachsound.h>
Public Member Functions | |
LegoCacheSound () | |
Constructs a new LegoCacheSound and initializes its members to default/empty state. More... | |
~LegoCacheSound () override | |
Destructor; releases owned sound resources and buffer, unmutes if needed. More... | |
const char * | ClassName () const override |
Returns class name (for run-time type checks); always "LegoCacheSound". More... | |
MxBool | IsA (const char *p_name) const override |
Checks if this object has a class name equal to p_name, traversing parents. More... | |
virtual MxResult | Create (LPPCMWAVEFORMAT p_pwfx, MxString p_mediaSrcPath, MxS32 p_volume, MxU8 *p_data, MxU32 p_dataSize) |
Creates the sound object with given audio format, source path, volume, and initializes DirectSound buffer with provided PCM data. More... | |
virtual void | Destroy () |
Releases allocated DirectSound buffer and internal data, resetting all fields. More... | |
virtual void | FUN_10006cd0 (undefined4 param1, undefined4 param2) |
Unknown legacy/function stub. More... | |
const MxString & | GetUnknown0x48 () const |
Getter for an unknown string field, likely the sound's base filename. More... | |
const MxBool | GetUnknown0x58 () const |
Returns whether this sound is currently playing or is flagged as 'active'. More... | |
LegoCacheSound * | Clone () |
Creates an identical copy of this LegoCacheSound, including memory buffers, properties, and audio state. More... | |
MxResult | Play (const char *p_name, MxBool p_looping) |
Starts playback of the cached sound in this buffer. More... | |
void | Stop () |
Immediately stops playback and resets buffer, clearing event tag and position cues. More... | |
void | FUN_10006be0 () |
Handles sound updates per tick; manages stopping, buffer state, and 3D-position refreshes if sound is looping/non-looping. More... | |
void | SetDistance (MxS32 p_min, MxS32 p_max) |
Sets minimum and maximum audible distances for 3D sound attenuation. More... | |
void | MuteSilence (MxBool p_muted) |
Mutes/unmutes by scaling volume to minimum (muted) or restoring original volume. More... | |
void | MuteStop (MxBool p_mute) |
Mutes/unmutes by stopping (mute) or resuming playback. More... | |
![]() | |
MxCore () | |
[AI] Constructs a new MxCore object and assigns it a unique id. More... | |
virtual | ~MxCore () |
[AI] Virtual destructor. Required for correct polymorphic cleanup in derived classes. More... | |
virtual MxLong | Notify (MxParam &p_param) |
[AI] Virtual callback notification mechanism. More... | |
virtual MxResult | Tickle () |
[AI] Called by tickle managers to allow the object to update itself. More... | |
virtual const char * | ClassName () const |
[AI] Returns the runtime class name of this object. More... | |
virtual MxBool | IsA (const char *p_name) const |
[AI] Checks whether this object's class type or parents match the given name. More... | |
MxU32 | GetId () |
[AI] Gets the unique (per-process) id assigned to this object instance. More... | |
Sound cache object managing DirectSound buffers and 3D positioning for preloaded sound data.
[AI]
Used to pre-load sound data into a DirectSound buffer, allowing efficient playback with 3D spatialization via Lego3DSound. Handles both sound data management (copy, free) and buffer control (volume, positional updates, muting, looping, stop/play). [AI]
Definition at line 17 of file legocachsound.h.
LegoCacheSound::LegoCacheSound | ( | ) |
Constructs a new LegoCacheSound and initializes its members to default/empty state.
[AI]
Definition at line 13 of file legocachsound.cpp.
|
override |
Destructor; releases owned sound resources and buffer, unmutes if needed.
[AI]
Definition at line 20 of file legocachsound.cpp.
|
inlineoverridevirtual |
Returns class name (for run-time type checks); always "LegoCacheSound".
[AI]
Reimplemented from MxCore.
Definition at line 32 of file legocachsound.h.
LegoCacheSound * LegoCacheSound::Clone | ( | ) |
Creates an identical copy of this LegoCacheSound, including memory buffers, properties, and audio state.
[AI]
Used when multiple independent instances of the same preloaded audio asset are desired, e.g. in overlapping sound effect playback. [AI]
Definition at line 130 of file legocachsound.cpp.
|
virtual |
Creates the sound object with given audio format, source path, volume, and initializes DirectSound buffer with provided PCM data.
[AI]
p_pwfx | Pointer to PCM audio format. [AI] |
p_mediaSrcPath | Source path, used for identifying/basename only. [AI] |
p_volume | Initial playback volume (0..100 range expected). [AI] |
p_data | PCM audio data (copied internally, may be nullptr). [AI] |
p_dataSize | Size of audio data buffer (must match buffer allocation if p_data provided). [AI] |
Definition at line 42 of file legocachsound.cpp.
|
virtual |
Releases allocated DirectSound buffer and internal data, resetting all fields.
[AI]
Definition at line 116 of file legocachsound.cpp.
void LegoCacheSound::FUN_10006be0 | ( | ) |
Handles sound updates per tick; manages stopping, buffer state, and 3D-position refreshes if sound is looping/non-looping.
[AI]
Called every tick to check playback status for looping sound, update position for 3D audio, mute, or stop when finished. [AI]
Definition at line 230 of file legocachsound.cpp.
|
virtual |
Unknown legacy/function stub.
Does nothing. [AI]
param1 | Unknown (possibly reserved/legacy). [AI] |
param2 | Unknown (possibly reserved/legacy). [AI] |
Definition at line 283 of file legocachsound.cpp.
|
inline |
Getter for an unknown string field, likely the sound's base filename.
[AI]
Definition at line 81 of file legocachsound.h.
|
inline |
Returns whether this sound is currently playing or is flagged as 'active'.
[AI]
Definition at line 87 of file legocachsound.h.
|
inlineoverridevirtual |
Checks if this object has a class name equal to p_name, traversing parents.
[AI]
p_name | Name to check against this class or its base classes. [AI] |
Reimplemented from MxCore.
Definition at line 44 of file legocachsound.h.
void LegoCacheSound::MuteSilence | ( | MxBool | p_muted | ) |
Mutes/unmutes by scaling volume to minimum (muted) or restoring original volume.
[AI]
p_muted | If TRUE, mute by reducing volume; if FALSE, restore volume. [AI] |
Definition at line 288 of file legocachsound.cpp.
void LegoCacheSound::MuteStop | ( | MxBool | p_mute | ) |
Mutes/unmutes by stopping (mute) or resuming playback.
[AI]
p_mute | If TRUE, mute by stopping playback; if FALSE, resume. [AI] |
Definition at line 306 of file legocachsound.cpp.
Starts playback of the cached sound in this buffer.
Sets loop mode, resets buffer, writes audio and starts play. [AI]
p_name | Optional: Tag/name representing playback event or context. [AI] |
p_looping | If TRUE, playback will loop; if FALSE, plays once. [AI] |
Definition at line 147 of file legocachsound.cpp.
Sets minimum and maximum audible distances for 3D sound attenuation.
[AI]
p_min | Minimum distance for unattenuated playback. [AI] |
p_max | Maximum distance at which sound will be silent. [AI] |
Definition at line 276 of file legocachsound.cpp.
void LegoCacheSound::Stop | ( | ) |
Immediately stops playback and resets buffer, clearing event tag and position cues.
[AI]
Definition at line 210 of file legocachsound.cpp.