Isle
Loading...
Searching...
No Matches
legocachsound.h
Go to the documentation of this file.
1#ifndef LEGOCACHSOUND_H
2#define LEGOCACHSOUND_H
3
4#include "decomp.h"
5#include "lego3dsound.h"
6#include "mxcore.h"
7#include "mxstring.h"
8
9// VTABLE: LEGO1 0x100d4718
10// VTABLE: BETA10 0x101bb6f0
11// SIZE 0x88
12
17class LegoCacheSound : public MxCore {
18public:
26 ~LegoCacheSound() override; // vtable+0x00
27
32 const char* ClassName() const override // vtable+0x0c
33 {
34 // not in BETA10
35 // STRING: LEGO1 0x100f01c4
36 return "LegoCacheSound";
37 }
38
44 MxBool IsA(const char* p_name) const override // vtable+0x10
45 {
46 return !strcmp(p_name, LegoCacheSound::ClassName()) || MxCore::IsA(p_name);
47 }
48
58 virtual MxResult Create(
59 LPPCMWAVEFORMAT p_pwfx,
60 MxString p_mediaSrcPath,
61 MxS32 p_volume,
62 MxU8* p_data,
63 MxU32 p_dataSize
64 ); // vtable+0x14
65
69 virtual void Destroy(); // vtable+0x18
75 virtual void FUN_10006cd0(undefined4 param1, undefined4 param2); // vtable+0x1c
76
81 const MxString& GetUnknown0x48() const { return m_unk0x48; }
82
87 const MxBool GetUnknown0x58() const { return m_unk0x58; }
88
95
102 MxResult Play(const char* p_name, MxBool p_looping);
103
107 void Stop();
108
113 void FUN_10006be0();
114
120 void SetDistance(MxS32 p_min, MxS32 p_max);
121
126 void MuteSilence(MxBool p_muted);
127
132 void MuteStop(MxBool p_mute);
133
134 // SYNTHETIC: LEGO1 0x10006610
135 // SYNTHETIC: BETA10 0x100675b0
136 // LegoCacheSound::`scalar deleting destructor'
137
138private:
142 void Init();
143
149 void CopyData(MxU8* p_data, MxU32 p_dataSize);
150
157 MxString GetBaseFilename(MxString& p_path);
158
159 LPDIRECTSOUNDBUFFER m_dsBuffer;
160 undefined m_unk0x0c[4];
161 Lego3DSound m_sound;
162 MxU8* m_data;
163 MxU32 m_dataSize;
164 MxString m_unk0x48;
165 MxBool m_unk0x58;
166 PCMWAVEFORMAT m_wfx;
167 MxBool m_looping;
168 MxBool m_unk0x6a;
169 MxS32 m_volume;
170 MxBool m_unk0x70;
171 MxString m_unk0x74;
172 MxBool m_muted;
173};
174
175#endif // LEGOCACHSOUND_H
[AI] Implements 3D positional sound logic for LEGO Island using DirectSound 3D buffers.
Definition: lego3dsound.h:19
Sound cache object managing DirectSound buffers and 3D positioning for preloaded sound data.
Definition: legocachsound.h:17
void SetDistance(MxS32 p_min, MxS32 p_max)
Sets minimum and maximum audible distances for 3D sound attenuation.
LegoCacheSound * Clone()
Creates an identical copy of this LegoCacheSound, including memory buffers, properties,...
MxResult Play(const char *p_name, MxBool p_looping)
Starts playback of the cached sound in this buffer.
void FUN_10006be0()
Handles sound updates per tick; manages stopping, buffer state, and 3D-position refreshes if sound is...
const MxString & GetUnknown0x48() const
Getter for an unknown string field, likely the sound's base filename.
Definition: legocachsound.h:81
const MxBool GetUnknown0x58() const
Returns whether this sound is currently playing or is flagged as 'active'.
Definition: legocachsound.h:87
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 bu...
virtual void FUN_10006cd0(undefined4 param1, undefined4 param2)
Unknown legacy/function stub.
~LegoCacheSound() override
Destructor; releases owned sound resources and buffer, unmutes if needed.
void MuteStop(MxBool p_mute)
Mutes/unmutes by stopping (mute) or resuming playback.
void Stop()
Immediately stops playback and resets buffer, clearing event tag and position cues.
LegoCacheSound()
Constructs a new LegoCacheSound and initializes its members to default/empty state.
virtual void Destroy()
Releases allocated DirectSound buffer and internal data, resetting all fields.
void MuteSilence(MxBool p_muted)
Mutes/unmutes by scaling volume to minimum (muted) or restoring original volume.
MxBool IsA(const char *p_name) const override
Checks if this object has a class name equal to p_name, traversing parents.
Definition: legocachsound.h:44
const char * ClassName() const override
Returns class name (for run-time type checks); always "LegoCacheSound".
Definition: legocachsound.h:32
[AI] Base virtual class for all Mindscape engine (Mx) objects.
Definition: mxcore.h:15
virtual MxBool IsA(const char *p_name) const
[AI] Checks whether this object's class type or parents match the given name.
Definition: mxcore.h:46
Mindscape custom string class for managing dynamic C-strings within the game engine.
Definition: mxstring.h:14
#define override
Definition: compat.h:21
unsigned int undefined4
Definition: decomp.h:28
unsigned char undefined
Definition: decomp.h:26
struct IDirectSoundBuffer * LPDIRECTSOUNDBUFFER
Definition: dsound.h:47
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
unsigned char MxU8
[AI]
Definition: mxtypes.h:8
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned int MxU32
[AI]
Definition: mxtypes.h:32