Isle
Loading...
Searching...
No Matches
mxwavepresenter.h
Go to the documentation of this file.
1#ifndef MXWAVEPRESENTER_H
2#define MXWAVEPRESENTER_H
3
4#include "decomp.h"
5#include "mxsoundpresenter.h"
6
7#include <dsound.h>
8
9// VTABLE: LEGO1 0x100d49a8
10// SIZE 0x6c
18public:
23
27 ~MxWavePresenter() override { Destroy(TRUE); } // vtable+0x00
28
33 void Destroy() override { Destroy(FALSE); } // vtable+0x38
34
39 virtual void Pause(); // vtable+0x64
40
45 virtual void Resume(); // vtable+0x68
46
51 virtual MxBool IsPaused() { return m_paused; } // vtable+0x6c
52
57 static const char* HandlerClassName()
58 {
59 // STRING: LEGO1 0x100f07b4
60 return "MxWavePresenter";
61 }
62
67 const char* ClassName() const override // vtable+0x0c
68 {
69 return HandlerClassName();
70 }
71
77 MxBool IsA(const char* p_name) const override // vtable+0x10
78 {
79 return !strcmp(p_name, MxWavePresenter::ClassName()) || MxSoundPresenter::IsA(p_name);
80 }
81
82 void ReadyTickle() override; // vtable+0x18
83 void StartingTickle() override; // vtable+0x1c
84 void StreamingTickle() override; // vtable+0x20
85 void DoneTickle() override; // vtable+0x2c
86 void ParseExtra() override; // vtable+0x30
87 MxResult AddToManager() override; // vtable+0x34
88 void EndAction() override; // vtable+0x40
89 MxResult PutData() override; // vtable+0x4c
90 void Enable(MxBool p_enable) override; // vtable+0x54
91 void LoopChunk(MxStreamChunk* p_chunk) override; // vtable+0x58
92 void SetVolume(MxS32 p_volume) override; // vtable+0x60
93
99 struct WaveFormat {
100 PCMWAVEFORMAT m_pcmWaveFormat;
103 };
104
105 // SYNTHETIC: LEGO1 0x1000d810
106 // MxWavePresenter::`scalar deleting destructor'
107
108protected:
112 void Init();
113
118 void Destroy(MxBool p_fromDestructor);
119
125
131
137 void WriteToSoundBuffer(void* p_audioPtr, MxU32 p_length);
138
148};
149
150#endif // MXWAVEPRESENTER_H
[AI] Concrete presenter for sound playback and control within the LEGO Island engine.
MxBool IsA(const char *p_name) const override
[AI] Tests if this instance is a MxSoundPresenter or derived type.
[AI] Represents a streamable chunk of data, typically sourced from a media buffer and designed for no...
Definition: mxstreamchunk.h:19
[AI] Presenter for streaming and managing PCM waveform audio via DirectSound buffer.
MxResult AddToManager() override
[AI] Registers this presenter with the global MxSoundManager.
virtual void Pause()
[AI] Pauses audio playback, halting sound buffer while keeping position for resume.
void Enable(MxBool p_enable) override
[AI] Enables or disables media stream playback and transitions state as needed.
static const char * HandlerClassName()
[AI] Returns the name identifying this presenter class.
MxU32 m_lockSize
[AI] Size in bytes for current buffer lock/write operation.
void ParseExtra() override
[AI] Parses additional data from the associated action for configuration or world interaction.
MxU8 m_writtenChunks
[AI] Number of chunks written into the DirectSound buffer.
MxS8 GetPlayedChunks()
[AI] Returns the index of the currently played chunk in the sound buffer.
void StartingTickle() override
[AI] Handles actions required when first starting presentation. Advances to streaming state.
void LoopChunk(MxStreamChunk *p_chunk) override
[AI] Adds a chunk to the looping chunk list, making it available for repeated playback.
void ReadyTickle() override
[AI] Handles the transition and setup for the Ready state. Parses extra action data and advances stat...
LPDIRECTSOUNDBUFFER m_dsBuffer
[AI] DirectSound buffer handling PCM sample playback.
void EndAction() override
[AI] Ends the media playback action, releasing all resources, notifying listeners if necessary.
MxWavePresenter()
[AI] Constructs MxWavePresenter and initializes all members.
virtual MxBool IsPaused()
[AI] Returns pause state of the current audio playback.
void Destroy() override
[AI] Explicit resource release.
MxS8 m_silenceData
[AI] Value written as silence into buffer when needed (format-dependent, e.g., 0 or 0x7F).
void StreamingTickle() override
[AI] Per-frame update when streaming the media stream.
virtual void Resume()
[AI] Resumes audio playback after a pause, restarting sound from the current buffer position.
MxBool IsA(const char *p_name) const override
[AI] Checks if this instance is of the given class or a parent class.
void SetVolume(MxS32 p_volume) override
[AI] Sets the presentation volume for playback (0-100).
void DoneTickle() override
[AI] Per-frame update for the "done" state; transitions this presenter to idle and ends the action.
void Init()
[AI] Initializes all member variables to safe/empty values.
MxBool FUN_100b1ba0()
[AI] Checks if more chunks can or should be streamed into buffer.
MxBool m_started
[AI] TRUE if audio playback has started on the buffer.
MxBool m_is3d
[AI] TRUE if buffer/audio is 3D spatialized.
MxResult PutData() override
[AI] Allows the presenter to submit pending results or output to the engine.
MxBool m_paused
[AI] TRUE if playback is currently paused.
~MxWavePresenter() override
[AI] Destroys the wave presenter and releases all associated resources, including sound buffers and m...
MxU32 m_chunkLength
[AI] Size in bytes for one audio streaming chunk.
const char * ClassName() const override
[AI] Returns the class name string at runtime.
void WriteToSoundBuffer(void *p_audioPtr, MxU32 p_length)
[AI] Writes a block of audio data to the DirectSound buffer at the correct chunk offset.
WaveFormat * m_waveFormat
[AI] Pointer to the wave format struct for buffer description/allocation.
#define override
Definition: compat.h:21
#define TRUE
Definition: d3drmdef.h:28
#define FALSE
Definition: d3drmdef.h:27
struct IDirectSoundBuffer * LPDIRECTSOUNDBUFFER
Definition: dsound.h:47
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
unsigned char MxU8
[AI]
Definition: mxtypes.h:8
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned int MxU32
[AI]
Definition: mxtypes.h:32
signed char MxS8
[AI]
Definition: mxtypes.h:14
[AI] Holds WAVE PCM format info for DirectSound buffer creation and streaming.
MxU32 m_dataSize
[AI] Size of data buffer for the wave data.
PCMWAVEFORMAT m_pcmWaveFormat
[AI] PCM format struct containing standard Windows WAVE format fields.
MxU32 m_flags
[AI] Custom format-related flags.