Isle
Loading...
Searching...
No Matches
mxloopingmidipresenter.cpp
Go to the documentation of this file.
2
3#include "decomp.h"
4#include "mxdssound.h"
5#include "mxmisc.h"
6#include "mxmusicmanager.h"
7
9
10// FUNCTION: LEGO1 0x100c2a80
12{
13 if (m_action->GetLoopCount()) {
15 return;
16 }
17
18 if (!m_chunk) {
20 return;
21 }
22
25 }
26}
27
28// FUNCTION: LEGO1 0x100c2ae0
30{
31 if (m_action->GetLoopCount()) {
33 }
34 else {
35 EndAction();
36 }
37}
38
39// FUNCTION: LEGO1 0x100c2b00
41{
43
44 if (m_currentTickleState == e_streaming && m_chunk && !MusicManager()->GetMIDIInitialized()) {
47 }
48
50 return SUCCESS;
51}
virtual MxS32 GetVolume()
[AI] Returns the current runtime audio volume for this presenter (0-100).
void Enter()
[AI] Acquires/gains entry to the critical section or mutex, blocking if not available.
void Leave()
[AI] Releases/leaves the critical section or mutex.
MxS32 GetLoopCount()
[AI] Returns the loop count for this action.
Definition: mxdsaction.h:203
virtual MxLong GetDuration()
[AI] Gets the duration for which this action is intended to run.
Definition: mxdsaction.cpp:39
virtual MxLong GetElapsedTime()
[AI] Gets elapsed time for this action since the last time field 0x90 was set.
Definition: mxdsaction.cpp:159
MxLong GetTime()
[AI] Returns the time (timestamp or tick) associated with this chunk. [AI]
Definition: mxdschunk.h:102
MxU8 * GetData()
[AI] Returns a pointer to the start of the data payload. [AI]
Definition: mxdschunk.h:108
[AI] Represents a sound action extracted from an SI script and used in the data-driven action system.
Definition: mxdssound.h:14
[AI] Handles playback and management of looping MIDI actions, extending MIDI presentation functionali...
void StreamingTickle() override
[AI] Called every game tick while in streaming state, manages progression and looping for MIDI playba...
MxResult PutData() override
[AI] Initializes MIDI playback, setting volume and ensuring looping properties are applied.
void DoneTickle() override
[AI] Called every game tick in the "done" state, finalizes action and increments loop if required.
void DoneTickle() override
Tickle state signaling that playback is done.
void EndAction() override
Called when playback/action is finished or needs to be ended.
void SetVolume(MxS32 p_volume) override
Sets the playback volume for MIDI music.
MxStreamChunk * m_chunk
Current MIDI data chunk being streamed/played.
void StreamingTickle() override
Tickle state for streaming (playing) the MIDI chunk.
MxStreamChunk * NextChunk()
[AI] Returns the next data chunk in the stream, removing it from the stream queue.
MxResult InitializeMIDI(MxU8 *p_data, MxS32 p_loopCount)
Initializes streaming for a MIDI data buffer and begins playback.
void ProgressTickleState(TickleState p_tickleState)
[AI] Helper for advancing the presenter's tickle state and updating transition history.
Definition: mxpresenter.h:72
MxDSAction * m_action
[AI] The associated action currently being presented by this presenter.
Definition: mxpresenter.h:211
TickleState m_currentTickleState
[AI] Current state in the tickle lifecycle.
Definition: mxpresenter.h:199
@ e_done
[AI] Completed processing the current action.
Definition: mxpresenter.h:30
@ e_streaming
[AI] Streaming or rendering actively.
Definition: mxpresenter.h:27
MxCriticalSection m_criticalSection
[AI] Thread synchronization for presenter state and data.
Definition: mxpresenter.h:214
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
Definition: legotypes.h:30
MxMusicManager * MusicManager()
[AI] Returns the music manager, controlling playback of background music tracks.
Definition: mxmisc.cpp:81
MxLong MxResult
[AI]
Definition: mxtypes.h:106