Isle
Loading...
Searching...
No Matches
radio.h
Go to the documentation of this file.
1#ifndef RADIO_H
2#define RADIO_H
3
4#include "legostate.h"
5#include "mxcore.h"
6
8class MxAtomId;
10
15// VTABLE: LEGO1 0x100d6d28
16// VTABLE: BETA10 0x101bfb08
17// SIZE 0x30
18class RadioState : public LegoState {
19public:
21 RadioState(); // [AI]
22
25 MxBool IsSerializable() override { return FALSE; } // vtable+0x14 [AI]
26
28 const char* ClassName() const override // vtable+0x0c [AI]
29 {
30 // STRING: LEGO1 0x100f04f8
31 return "RadioState";
32 }
33
37 MxBool IsA(const char* p_name) const override // vtable+0x10 [AI]
38 {
39 return !strcmp(p_name, RadioState::ClassName()) || LegoState::IsA(p_name);
40 }
41
42 // SYNTHETIC: LEGO1 0x1002d020
43 // RadioState::`scalar deleting destructor'
44
46 MxBool IsActive() { return m_active; } // [AI]
47
50 void SetActive(MxBool p_active) { m_active = p_active; } // [AI]
51
54 undefined4 FUN_1002d090(); // [AI_SUGGESTED_NAME: GetNextPlaylistObjectId]
55
60 MxBool FUN_1002d0c0(const MxAtomId& p_atom, MxU32 p_objectId); // [AI_SUGGESTED_NAME: ContainsObjectId]
61
63 Playlist m_unk0x08[3]; // 0x08 [AI_SUGGESTED_NAME: m_playlists]
65 MxS16 m_unk0x2c; // 0x2c [AI_SUGGESTED_NAME: m_currentPlaylistIndex]
67 MxBool m_active; // 0x2e [AI]
68};
69
74// VTABLE: LEGO1 0x100d6d10
75// VTABLE: BETA10 0x101bfaf0
76// SIZE 0x10
77class Radio : public MxCore {
78public:
80 Radio(); // [AI]
82 ~Radio() override; // [AI]
83
87 MxLong Notify(MxParam& p_param) override; // vtable+0x04 [AI]
88
90 const char* ClassName() const override // vtable+0x0c [AI]
91 {
92 // STRING: LEGO1 0x100f328c
93 return "Radio";
94 }
95
98 MxBool IsA(const char* p_name) const override // vtable+0x10 [AI]
99 {
100 return !strcmp(p_name, Radio::ClassName()) || MxCore::IsA(p_name);
101 }
102
105 void Initialize(MxBool p_und); // [AI]
106
108 void CreateState(); // [AI]
109
111 void Play(); // [AI]
112
114 void Stop(); // [AI]
115
118 RadioState* GetState() { return m_state; } // [AI]
119
120 // SYNTHETIC: LEGO1 0x1002c970
121 // Radio::`scalar deleting destructor'
122
123private:
125 RadioState* m_state; // 0x08 [AI]
127 MxBool m_unk0x0c; // 0x0c [AI_SUGGESTED_NAME: m_enabled]
129 MxBool m_audioEnabled; // 0x0d [AI]
130
134 MxLong HandleEndAction(MxEndActionNotificationParam& p_param); // [AI]
135
139 MxLong HandleControl(LegoControlManagerNotificationParam& p_param); // [AI]
140};
141
142#endif // RADIO_H
[AI] Notification parameter for the LegoControlManager, used to propagate information about control e...
[AI] Base class for game state blocks which encapsulate serializable and/or resettable aspects of the...
Definition: legostate.h:17
MxBool IsA(const char *p_name) const override
[AI] Tests if this object is of a given class name, directly or through inheritance.
Definition: legostate.h:169
[AI] Atomized (unique) string identifier, managed by reference counting.
Definition: mxatom.h:124
[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
[AI] Notification parameter marking the end of an action, specialization of MxActionNotificationParam...
[AI] MxParam serves as a polymorphic base class for parameter passing in event and notification syste...
Definition: mxparam.h:7
[AI] Handles and stores state for the in-game radio, including track playlists, cycling,...
Definition: radio.h:18
MxBool FUN_1002d0c0(const MxAtomId &p_atom, MxU32 p_objectId)
[AI] Checks if the given atom/object ID matches one of the radio's playlists.
Definition: radio.cpp:247
undefined4 FUN_1002d090()
[AI] Cycles to the next playlist and returns the next object ID to play.
Definition: radio.cpp:234
MxBool IsA(const char *p_name) const override
[AI] Checks if the given type name matches this class or any parent class.
Definition: radio.h:37
MxS16 m_unk0x2c
[AI] Index for cycling among the three playlists (0-2).
Definition: radio.h:65
MxBool IsSerializable() override
[AI] Radio state is not serializable, i.e., not written to save files.
Definition: radio.h:25
MxBool m_active
[AI] If TRUE, the radio is playing; FALSE otherwise.
Definition: radio.h:67
const char * ClassName() const override
[AI] Returns the runtime class name for RadioState.
Definition: radio.h:28
MxBool IsActive()
[AI] Indicates whether the radio is currently playing.
Definition: radio.h:46
Playlist m_unk0x08[3]
[AI] Radio playlists. Each is a collection of track IDs used by the radio (effects,...
Definition: radio.h:63
RadioState()
[AI] Constructs a new RadioState, randomizing playlist indices and initial state.
Definition: radio.cpp:214
void SetActive(MxBool p_active)
[AI] Sets active status of the radio.
Definition: radio.h:50
[AI] High-level manager for the in-game radio, handling notifications, playing/stopping,...
Definition: radio.h:77
void Play()
[AI] Starts playing radio music if it is not already active.
Definition: radio.cpp:105
void Stop()
[AI] Stops radio playback if currently active and updates audio state.
Definition: radio.cpp:126
MxBool IsA(const char *p_name) const override
[AI] Type check for the Radio class and its ancestors.
Definition: radio.h:98
const char * ClassName() const override
[AI] Returns the runtime class name for Radio objects.
Definition: radio.h:90
~Radio() override
[AI] Destructor; shuts down radio playback and unregisters events.
Definition: radio.cpp:72
MxLong Notify(MxParam &p_param) override
[AI] Handles system notifications (end actions, control events) relevant to the radio.
Definition: radio.cpp:85
void CreateState()
[AI] Creates or retrieves a RadioState object in the game state manager.
Definition: radio.cpp:201
Radio()
[AI] Constructs a new Radio, registering for notifications and control events.
Definition: radio.cpp:62
void Initialize(MxBool p_und)
[AI] Sets radio system as enabled/disabled and resets state if changed.
Definition: radio.cpp:192
RadioState * GetState()
[AI] Returns the current RadioState for this radio.
Definition: radio.h:118
#define override
Definition: compat.h:21
#define FALSE
Definition: d3drmdef.h:27
unsigned int undefined4
Definition: decomp.h:28
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
int MxLong
[AI]
Definition: mxtypes.h:83
signed short MxS16
[AI]
Definition: mxtypes.h:26
unsigned int MxU32
[AI]
Definition: mxtypes.h:32
[AI] Playlist structure representing an indexed list of object IDs with next-item selection strategie...
Definition: legostate.h:36