Isle
Loading...
Searching...
No Matches
mxbackgroundaudiomanager.h
Go to the documentation of this file.
1#ifndef MXBACKGROUNDAUDIOMANAGER_H
2#define MXBACKGROUNDAUDIOMANAGER_H
3
4#include "mxcore.h"
5#include "mxdsaction.h"
6#include "mxpresenter.h"
7#include "mxtypes.h"
8
10
18public:
21
24
28 MxLong Notify(MxParam& p_param) override; // vtable+0x04
29
32 MxResult Tickle() override; // vtable+0x08
33
35 const char* ClassName() const override // vtable+0x0c
36 {
37 // STRING: LEGO1 0x100f7ac4
38 return "MxBackgroundAudioManager";
39 }
40
44 MxBool IsA(const char* p_name) const override // vtable+0x10
45 {
46 return !strcmp(p_name, MxBackgroundAudioManager::ClassName()) || MxCore::IsA(p_name);
47 }
48
51 MxBool GetEnabled() { return m_enabled; }
52
55 void StartAction(MxParam& p_param);
56
59 void StopAction(MxParam& p_param);
60
67 MxResult PlayMusic(MxDSAction& p_action, undefined4 p_speed, MxPresenter::TickleState p_tickleState);
68
70 void FUN_1007ee70();
71
73 void FUN_1007ef40();
74
76 void FadeInOrFadeOut();
77
80 void Enable(MxBool p_enable);
81
86 virtual MxResult Create(MxAtomId& p_script, MxU32 p_frequencyMS);
87
89 void Init();
90
92 void Stop();
93
95 void LowerVolume();
96
98 void RaiseVolume();
99
105 undefined4 FUN_1007f610(MxPresenter* p_unk0x138, MxS32 p_speed, MxPresenter::TickleState p_tickleState);
106
107 // SYNTHETIC: LEGO1 0x1007ec00
108 // MxBackgroundAudioManager::`scalar deleting destructor'
109
110private:
114 MxResult OpenMusic(MxAtomId& p_script);
115
117 void DestroyMusic();
118
120 MxBool m_enabled; // 0x08
121
123 MxDSAction m_action1; // 0x0c
124
126 MxAudioPresenter* m_unk0xa0; // 0xa0 [AI_SUGGESTED_NAME: m_activePresenter]
127
129 MxDSAction m_action2; // 0xa4
130
132 MxAudioPresenter* m_unk0x138; // 0x138 [AI_SUGGESTED_NAME: m_pendingPresenter]
133
135 MxPresenter::TickleState m_tickleState; // 0x13c
136
138 MxS32 m_speed; // 0x140
139
141 MxS32 m_targetVolume; // 0x144
142
144 MxS16 m_unk0x148; // 0x148 [AI_SUGGESTED_NAME: m_volumeSuppressCount]
145
147 MxAtomId m_script; // 0x14c
148};
149
150#endif // MXBACKGROUNDAUDIOMANAGER_H
[AI] Atomized (unique) string identifier, managed by reference counting.
Definition: mxatom.h:124
[AI] Presents (plays/streams) audio (WAV, MID, etc.) as part of the Omni engine's media handler syste...
[AI] Background music manager that handles playback, volume, state transitions, and notifications for...
void Init()
[AI] Reinitializes manager's active presenter and tickle state; typically called at the start of a sc...
undefined4 FUN_1007f610(MxPresenter *p_unk0x138, MxS32 p_speed, MxPresenter::TickleState p_tickleState)
[AI] Helper for queued volume changing: Sets up a coming presenter/action for activation with given s...
MxBackgroundAudioManager()
[AI] Constructs and registers the background audio manager, initializing internal state.
void FUN_1007ef40()
[AI] Handles music volume raising/lowering and track transitions in the e_repeating tickle state,...
void Enable(MxBool p_enable)
[AI] Enables or disables the background audio manager.
void StopAction(MxParam &p_param)
[AI] Handles incoming end action notification, resets state and clears finished presenters/actions; n...
MxBool GetEnabled()
[AI] Returns whether background audio management is currently enabled.
void RaiseVolume()
[AI] Requests that the background music volume is raised (decrements suppression counter); triggers f...
const char * ClassName() const override
[AI] Returns the class name string literal.
~MxBackgroundAudioManager() override
[AI] Destructor unregisters from notification and tickle managers and stops any playing music.
void LowerVolume()
[AI] Requests a reduction in current background music volume, queuing for fade out (increments suppre...
MxLong Notify(MxParam &p_param) override
[AI] Handles notification events such as start/stop actions relating to audio.
MxBool IsA(const char *p_name) const override
[AI] Type-checks if the instance is, or inherits from, MxBackgroundAudioManager.
void StartAction(MxParam &p_param)
[AI] Handles incoming start action notification, sets up pending audio presenter and prepares (but do...
MxResult PlayMusic(MxDSAction &p_action, undefined4 p_speed, MxPresenter::TickleState p_tickleState)
[AI] Initiates playback of a new background music action with specified speed and target tickle state...
void Stop()
[AI] Immediately stops all background music, clears all actions and presenters, and resets tickle sta...
void FadeInOrFadeOut()
[AI] Performs volume fade in/fade out logic, adjusting music volume towards target; sets tickle state...
void FUN_1007ee70()
[AI] Implements state update for e_streaming tickle state. Handles music track transition (fade out p...
MxResult Tickle() override
[AI] Called periodically by the tickle manager.
virtual MxResult Create(MxAtomId &p_script, MxU32 p_frequencyMS)
[AI] Opens the music script (SI file) for streaming and registers this background audio manager as a ...
[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] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
Definition: mxdsaction.h:17
[AI] MxParam serves as a polymorphic base class for parameter passing in event and notification syste...
Definition: mxparam.h:7
[AI] Abstract base class for all presenter types in the LEGO Island engine, responsible for managing ...
Definition: mxpresenter.h:20
TickleState
[AI] Represents the state of the presenter's tickle (update) lifecycle.
Definition: mxpresenter.h:23
#define override
Definition: compat.h:21
unsigned int undefined4
Definition: decomp.h:28
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
int MxLong
[AI]
Definition: mxtypes.h:83
signed short MxS16
[AI]
Definition: mxtypes.h:26
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned int MxU32
[AI]
Definition: mxtypes.h:32