15MxS32 g_volumeAttenuation[100] = {-6643, -5643, -5058, -4643, -4321, -4058, -3836, -3643, -3473, -3321, -3184, -3058,
16 -2943, -2836, -2736, -2643, -2556, -2473, -2395, -2321, -2251, -2184, -2120, -2058,
17 -2000, -1943, -1888, -1836, -1785, -1736, -1689, -1643, -1599, -1556, -1514, -1473,
18 -1434, -1395, -1358, -1321, -1286, -1251, -1217, -1184, -1152, -1120, -1089, -1058,
19 -1029, -1000, -971, -943, -915, -888, -862, -836, -810, -785, -761, -736,
20 -713, -689, -666, -643, -621, -599, -577, -556, -535, -514, -494, -473,
21 -454, -434, -415, -395, -377, -358, -340, -321, -304, -286, -268, -251,
22 -234, -217, -200, -184, -168, -152, -136, -120, -104, -89, -74, -58,
64 if (!p_fromDestructor) {
92 memset(&desc, 0,
sizeof(desc));
93 desc.
dwSize =
sizeof(desc);
117 format.wFormatTag = WAVE_FORMAT_PCM;
120 format.nChannels = 2;
123 format.nChannels = 1;
126 format.nSamplesPerSec = 11025;
127 format.wBitsPerSample = 16;
128 format.nBlockAlign = format.nChannels * 2;
129 format.nAvgBytesPerSec = format.nBlockAlign * 11025;
134 if (p_createThread) {
174 while (cursor.
Next(presenter)) {
189 while (cursor.
Next(presenter)) {
219 while (cursor.
Next(presenter)) {
220 if (presenter->
IsA(
"MxWavePresenter")) {
234 while (cursor.
Next(presenter)) {
235 if (presenter->
IsA(
"MxWavePresenter")) {
[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.
MxResult Create() override
[AI] Initializes audio subsystem resources and registers an instance for global audio management.
virtual MxS32 GetVolume()
[AI] Gets the current global audio volume.
virtual void SetVolume(MxS32 p_volume)
[AI] Sets the current global audio volume.
void Destroy() override
[AI] Tears down the audio subsystem instance and unregisters it from global management.
[AI] Presents (plays/streams) audio (WAV, MID, etc.) as part of the Omni engine's media handler syste...
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.
const MxAtomId & GetAtomId()
[AI] Returns a const-reference to the object's atom identifier.
MxU32 GetObjectId()
[AI] Returns the object id numeric value.
static MxOmni * GetInstance()
[AI] Returns the singleton instance of the MxOmni subsystem coordinator.
static MxBool IsSound3D()
[AI] Returns current state of 3D sound configuration.
static void SetSound3D(MxBool p_use3dSound)
[AI] Enables or disables use of 3D sound processing.
HWND GetWindowHandle() const
[AI] Gets the window handle (HWND) associated with the engine (ownership not transferred).
[AI] Cursor/iterator for traversing an MxPresenterList.
[AI] Abstract base class for all presenter types in the LEGO Island engine, responsible for managing ...
MxBool IsA(const char *p_name) const override
[AI] Determines if this object is of (or inherits) the specified named class.
MxDSAction * GetAction() const
[AI] Returns the current action being presented.
[AI] Manages DirectSound-based sound playback, implementing volume, resource, and device management.
LPDIRECTSOUND m_directSound
[AI] Pointer to main DirectSound interface. Needed for all DirectSound operations.
void Init()
[AI] Internal initialization routine for member variables and DirectSound pointers.
MxSoundManager()
[AI] Constructs a new MxSoundManager instance.
MxS32 GetAttenuation(MxU32 p_volume)
[AI] Maps a percentage volume (1-100) to a DirectSound-specific attenuation value.
virtual void Pause()
[AI] Pauses all currently playing wave presenters.
MxPresenter * FUN_100aebd0(const MxAtomId &p_atomId, MxU32 p_objectId)
[AI] Finds a presenter matching a specific atom ID and object ID.
void Destroy() override
[AI] Releases sound resources and unregisters from tickle system.
void SetVolume(MxS32 p_volume) override
[AI] Sets the global audio output volume for all managed sound presenters.
LPDIRECTSOUNDBUFFER m_dsBuffer
[AI] Primary DirectSound buffer interface for setting output format/volume.
virtual void Resume()
[AI] Resumes all previously paused wave presenters.
~MxSoundManager() override
[AI] Destructor for MxSoundManager.
void Terminate()
[AI] Signals the thread to terminate.
MxResult Start(MxS32 p_stackSize, MxS32 p_flag)
[AI] Starts the thread with a given stack size and creation flags.
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.
MxTickleThread periodically calls Tickle() on a target MxCore object in a separate thread.
[AI] Presenter for streaming and managing PCM waveform audio via DirectSound buffer.
#define DECOMP_SIZE_ASSERT(T, S)
#define DSBCAPS_CTRLVOLUME
HRESULT WINAPI DirectSoundCreate(LPGUID, LPDIRECTSOUND *, LPUNKNOWN)
#define DSBCAPS_PRIMARYBUFFER
#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.
#define AUTOLOCK(CS)
[AI] Macro for automatic locking using the MxAutoLock class. This macro instantiates an MxAutoLock ob...
MxTickleManager * TickleManager()
[AI] Provides access to the global tickle manager.
MxS32 g_volumeAttenuation[100]