41 MxResult result = OpenMusic(p_script);
69void MxBackgroundAudioManager::DestroyMusic()
84 switch (m_tickleState) {
101 if (m_unk0xa0 && m_unk0xa0->
GetAction()) {
106 m_unk0xa0 = m_unk0x138;
107 m_action1 = m_action2;
118 MxS32 compare, volume;
120 if (m_unk0xa0 ==
NULL) {
122 if (m_unk0x148 != 0) {
126 compare = m_targetVolume;
130 if (volume < compare) {
131 if (m_speed + m_unk0x138->
GetVolume() <= compare) {
132 compare = m_speed + m_unk0x138->
GetVolume();
139 m_unk0xa0 = m_unk0x138;
140 m_action1 = m_action2;
153 if (m_unk0xa0->
GetVolume() - m_speed > 0) {
154 volume = m_unk0xa0->
GetVolume() - m_speed;
169 MxS32 volume, compare;
171 if (m_unk0xa0 !=
NULL) {
174 if (m_unk0x148 != 0) {
178 compare = m_targetVolume;
181 if (volume < compare) {
182 m_unk0xa0->
SetVolume(volume + m_speed < compare ? volume + m_speed : compare);
184 else if (compare < volume) {
185 m_unk0xa0->
SetVolume(volume - m_speed > compare ? volume - m_speed : compare);
274 m_tickleState = p_tickleState;
311 if (m_unk0x148 == 0) {
312 if (m_tickleState == 0) {
324 if (m_unk0x148 != 0) {
326 if (m_unk0x148 == 0) {
327 if (m_tickleState == 0) {
338 if (this->m_enabled != p_enable) {
339 this->m_enabled = p_enable;
362 m_tickleState = p_tickleState;
[AI] Atomized (unique) string identifier, managed by reference counting.
const char * GetInternal() const
[AI] Returns a pointer to the internal string, or nullptr if not set.
[AI] Presents (plays/streams) audio (WAV, MID, etc.) as part of the Omni engine's media handler syste...
virtual MxS32 GetVolume()
[AI] Returns the current runtime audio volume for this presenter (0-100).
virtual void SetVolume(MxS32 p_volume)
[AI] Sets the presentation volume for playback (0-100).
[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...
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...
void RaiseVolume()
[AI] Requests that the background music volume is raised (decrements suppression counter); triggers f...
~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.
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] Composite presenter that manages a collection of child presenters, orchestrating their actions a...
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
void SetOrigin(MxCore *p_origin)
[AI] Sets the origin core pointer for this action, if spatially transforming/localizing this action.
void SetUnknown84(MxCore *p_unk0x84)
[AI] Sets the auxiliary core pointer for this action.
const MxAtomId & GetAtomId()
[AI] Returns a const-reference to the object's atom identifier.
virtual void SetAtomId(MxAtomId p_atomId)
[AI] Sets the atom id for this object instance, used for indexing or lookup.
void SetUnknown24(MxS16 p_unk0x24)
[AI] Sets the unknown field at 0x24 (possibly version/state).
MxS16 GetUnknown24()
[AI] Returns the unknown 0x24 value (may be data version or usage state). [AI]
void SetObjectId(MxU32 p_objectId)
[AI] Sets the object id (for serialization or lookup).
MxU32 GetObjectId()
[AI] Returns the object id numeric value.
[AI] Represents a sound action extracted from an SI script and used in the data-driven action system.
void Unregister(MxCore *p_listener)
[AI] Removes a previously registered listener and flushes any pending notifications for it.
void Register(MxCore *p_listener)
[AI] Registers a listener object to receive notifications.
[AI] Parameter object representing a single notification or event, carrying an identifier and sender ...
NotificationId GetNotification() const
[AI] Retrieves the current notification type of this parameter.
MxLong HandleEndAction(MxParam &p_param)
[AI] Handles the engine's response to action end notifications (c_notificationEndAction),...
[AI] MxParam serves as a polymorphic base class for parameter passing in event and notification syste...
[AI] Abstract base class for all presenter types in the LEGO Island engine, responsible for managing ...
TickleState
[AI] Represents the state of the presenter's tickle (update) lifecycle.
@ e_repeating
[AI] Presentation is repeating (e.g., looping media).
@ e_idle
[AI] Not processing an action.
@ e_starting
[AI] In the process of starting playback/presentation.
@ e_streaming
[AI] Streaming or rendering actively.
MxDSAction * GetAction() const
[AI] Returns the current action being presented.
MxLong Close(const char *p_name)
Close a named stream and remove its controller from the open list [AI].
virtual void UnregisterClient(MxCore *p_client)
[AI] Unregisters (marks for destruction) a previously registered client.
virtual void RegisterClient(MxCore *p_client, MxTime p_interval)
[AI] Registers an MxCore object to receive periodic tickles.
#define DECOMP_SIZE_ASSERT(T, S)
#define NULL
[AI] Null pointer value (C/C++ semantics).
#define FAILURE
[AI] Used to indicate a failed operation in result codes.
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
MxDSAction & GetCurrentAction()
[AI] Accessor for the currently running MxDSAction (e.g.
LegoOmni * Lego()
[AI] Retrieves the global LegoOmni singleton instance, providing access to core subsystems.
MxResult Start(MxDSAction *p_dsAction)
[AI] Schedules and initiates execution of a script action.
MxStreamer * Streamer()
[AI] Returns the global streamer used for all chunked media streaming (SI file, audio,...
void DeleteObject(MxDSAction &p_dsAction)
[AI] Deletes the specified action object, removing it from the global action list.
MxNotificationManager * NotificationManager()
[AI] Returns the notification manager for system-wide state/update notifications.
MxTickleManager * TickleManager()
[AI] Provides access to the global tickle manager.
@ c_notificationStartAction
[AI] Indicates the start of an action [AI]
@ c_notificationEndAction
[AI] Indicates the end of an action [AI]