1#ifndef MXMUSICMANAGER_H
2#define MXMUSICMANAGER_H
63 if (midiOutGetVolume((HMIDIOUT) m_midiStreamH, &p_volume)) {
64 p_volume = CalculateVolume(100);
117 void SetMIDIVolume();
128 static void CALLBACK MidiCallbackProc(HDRVR p_hdrvr, UINT p_uMsg,
DWORD p_dwUser,
DWORD p_dw1,
DWORD p_dw2);
130 HMIDISTRM m_midiStreamH;
133 MxU32 m_bufferCurrentSize;
134 MxU8* m_bufferOffset;
135 MxU8* m_bufferCurrentOffset;
[AI] Audio subsystem manager for the LEGO Island engine, responsible for managing audio playback and ...
MxResult Create() override
[AI] Initializes audio subsystem resources and registers an instance for global audio management.
Manages MIDI music playback with Win32 MIDI streaming for the LEGO Island engine.
void InitData()
Initializes and zeros all associated MIDI-related member data.
MxMusicManager()
Constructs an instance and initializes member data.
void Destroy() override
Releases all resources and stops streaming.
void DeinitializeMIDI()
Stops playback and releases all MIDI streaming resources.
void SetMultiplier(MxS32 p_multiplier)
Sets the volume multiplier for scaling volume output.
MxResult ResetStream()
Schedules and streams the next chunk of MIDI data; handles buffer looping and completion.
void Init()
Initializes multipliers and buffer with default values; called from constructor/Destroy.
MxResult InitializeMIDI(MxU8 *p_data, MxS32 p_loopCount)
Initializes streaming for a MIDI data buffer and begins playback.
MxBool GetMIDIInitialized()
Checks if the MIDI system is currently initialized and ready.
void GetMIDIVolume(DWORD &p_volume)
Retrieves the current hardware MIDI out volume.
void SetVolume(MxS32 p_volume) override
Sets the music playback volume, taking into account multiplier for overall gain adjustment.
void ResetBuffer()
Resets the MIDI buffer to the starting offset and sets the buffer size to the full stream.
~MxMusicManager() override
Destructor, ensures proper cleanup of resources and MIDI deinitialization.
typedef DWORD(FAR PASCAL *LPCLIPPERCALLBACK)(LPDIRECTDRAWCLIPPER lpDDClipper