Isle
|
[AI] Background music manager that handles playback, volume, state transitions, and notifications for background audio tracks in the game. More...
#include <mxbackgroundaudiomanager.h>
Public Member Functions | |
MxBackgroundAudioManager () | |
[AI] Constructs and registers the background audio manager, initializing internal state. More... | |
~MxBackgroundAudioManager () override | |
[AI] Destructor unregisters from notification and tickle managers and stops any playing music. More... | |
MxLong | Notify (MxParam &p_param) override |
[AI] Handles notification events such as start/stop actions relating to audio. More... | |
MxResult | Tickle () override |
[AI] Called periodically by the tickle manager. More... | |
const char * | ClassName () const override |
[AI] Returns the class name string literal. More... | |
MxBool | IsA (const char *p_name) const override |
[AI] Type-checks if the instance is, or inherits from, MxBackgroundAudioManager. More... | |
MxBool | GetEnabled () |
[AI] Returns whether background audio management is currently enabled. More... | |
void | StartAction (MxParam &p_param) |
[AI] Handles incoming start action notification, sets up pending audio presenter and prepares (but does not play) a new track for fading in. More... | |
void | StopAction (MxParam &p_param) |
[AI] Handles incoming end action notification, resets state and clears finished presenters/actions; notifies game logic via Lego()->HandleEndAction(). More... | |
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 if possible (e.g., old music not in process). More... | |
void | FUN_1007ee70 () |
[AI] Implements state update for e_streaming tickle state. Handles music track transition (fade out previous, apply new track to active slot). More... | |
void | FUN_1007ef40 () |
[AI] Handles music volume raising/lowering and track transitions in the e_repeating tickle state, implementing fade out for current and fade in for next track. More... | |
void | FadeInOrFadeOut () |
[AI] Performs volume fade in/fade out logic, adjusting music volume towards target; sets tickle state to idle when target volume is reached. More... | |
void | Enable (MxBool p_enable) |
[AI] Enables or disables the background audio manager. More... | |
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 tickle client; used during game/scene transitions. More... | |
void | Init () |
[AI] Reinitializes manager's active presenter and tickle state; typically called at the start of a scene or audio context. More... | |
void | Stop () |
[AI] Immediately stops all background music, clears all actions and presenters, and resets tickle state. More... | |
void | LowerVolume () |
[AI] Requests a reduction in current background music volume, queuing for fade out (increments suppression counter). Initiates fade if not already started. More... | |
void | RaiseVolume () |
[AI] Requests that the background music volume is raised (decrements suppression counter); triggers fade-in if suppression goes to zero. More... | |
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 speed and tickle state. 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... | |
[AI] Background music manager that handles playback, volume, state transitions, and notifications for background audio tracks in the game.
Registers itself to the NotificationManager and TickleManager for event and periodic updates.
[AI] Responsible for handling the life cycle of background music tracks (open, play, fade, stop, destroy), performing volume fades (in/out) and transitioning between background tracks as needed. Operates through MxAudioPresenter objects related to current and pending audio actions.
Definition at line 17 of file mxbackgroundaudiomanager.h.
MxBackgroundAudioManager::MxBackgroundAudioManager | ( | ) |
[AI] Constructs and registers the background audio manager, initializing internal state.
Definition at line 18 of file mxbackgroundaudiomanager.cpp.
|
override |
[AI] Destructor unregisters from notification and tickle managers and stops any playing music.
Definition at line 31 of file mxbackgroundaudiomanager.cpp.
|
inlineoverridevirtual |
[AI] Returns the class name string literal.
Reimplemented from MxCore.
Definition at line 35 of file mxbackgroundaudiomanager.h.
[AI] Opens the music script (SI file) for streaming and registers this background audio manager as a tickle client; used during game/scene transitions.
p_script | AtomId representing the music script to load [AI] |
p_frequencyMS | Update tickle interval in milliseconds (used for registration) [AI] |
Definition at line 39 of file mxbackgroundaudiomanager.cpp.
void MxBackgroundAudioManager::Enable | ( | MxBool | p_enable | ) |
[AI] Enables or disables the background audio manager.
Stops music when disabling.
p_enable | True to enable, False to disable [AI] |
Definition at line 336 of file mxbackgroundaudiomanager.cpp.
void MxBackgroundAudioManager::FadeInOrFadeOut | ( | ) |
[AI] Performs volume fade in/fade out logic, adjusting music volume towards target; sets tickle state to idle when target volume is reached.
Definition at line 167 of file mxbackgroundaudiomanager.cpp.
void MxBackgroundAudioManager::FUN_1007ee70 | ( | ) |
[AI] Implements state update for e_streaming tickle state. Handles music track transition (fade out previous, apply new track to active slot).
Definition at line 99 of file mxbackgroundaudiomanager.cpp.
void MxBackgroundAudioManager::FUN_1007ef40 | ( | ) |
[AI] Handles music volume raising/lowering and track transitions in the e_repeating tickle state, implementing fade out for current and fade in for next track.
Definition at line 116 of file mxbackgroundaudiomanager.cpp.
undefined4 MxBackgroundAudioManager::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 speed and tickle state.
p_unk0x138 | Presenter pending activation [AI_SUGGESTED_NAME: p_audioPresenter] |
p_speed | Speed for fade in/out [AI] |
p_tickleState | Tickle state for the transition [AI] |
Definition at line 349 of file mxbackgroundaudiomanager.cpp.
|
inline |
[AI] Returns whether background audio management is currently enabled.
Definition at line 51 of file mxbackgroundaudiomanager.h.
void MxBackgroundAudioManager::Init | ( | ) |
[AI] Reinitializes manager's active presenter and tickle state; typically called at the start of a scene or audio context.
Definition at line 368 of file mxbackgroundaudiomanager.cpp.
|
inlineoverridevirtual |
[AI] Type-checks if the instance is, or inherits from, MxBackgroundAudioManager.
p_name | Name of class to check [AI] |
Reimplemented from MxCore.
Definition at line 44 of file mxbackgroundaudiomanager.h.
void MxBackgroundAudioManager::LowerVolume | ( | ) |
[AI] Requests a reduction in current background music volume, queuing for fade out (increments suppression counter). Initiates fade if not already started.
Definition at line 309 of file mxbackgroundaudiomanager.cpp.
[AI] Handles notification events such as start/stop actions relating to audio.
p_param | Notification parameter; expected to be a MxNotificationParam [AI] |
Reimplemented from MxCore.
Definition at line 199 of file mxbackgroundaudiomanager.cpp.
MxResult MxBackgroundAudioManager::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 if possible (e.g., old music not in process).
p_action | New DS action (music track) to play [AI] |
p_speed | Volume fade-in/fade-out speed [AI] |
p_tickleState | Target tickle state after transition (e.g., e_streaming, e_repeating) [AI] |
SUCCESS | If the music is started [AI] |
FAILURE | Otherwise [AI] |
Definition at line 244 of file mxbackgroundaudiomanager.cpp.
void MxBackgroundAudioManager::RaiseVolume | ( | ) |
[AI] Requests that the background music volume is raised (decrements suppression counter); triggers fade-in if suppression goes to zero.
Definition at line 322 of file mxbackgroundaudiomanager.cpp.
void MxBackgroundAudioManager::StartAction | ( | MxParam & | p_param | ) |
[AI] Handles incoming start action notification, sets up pending audio presenter and prepares (but does not play) a new track for fading in.
p_param | Notification parameter (MxNotificationParam expected) [AI] |
Definition at line 215 of file mxbackgroundaudiomanager.cpp.
void MxBackgroundAudioManager::Stop | ( | ) |
[AI] Immediately stops all background music, clears all actions and presenters, and resets tickle state.
Definition at line 286 of file mxbackgroundaudiomanager.cpp.
void MxBackgroundAudioManager::StopAction | ( | MxParam & | p_param | ) |
[AI] Handles incoming end action notification, resets state and clears finished presenters/actions; notifies game logic via Lego()->HandleEndAction().
p_param | Notification parameter [AI] |
Definition at line 226 of file mxbackgroundaudiomanager.cpp.
|
overridevirtual |
[AI] Called periodically by the tickle manager.
Updates audio manager state based on current tickle state (e.g., fade in/out, streaming/repeating logic).
Reimplemented from MxCore.
Definition at line 82 of file mxbackgroundaudiomanager.cpp.