Isle
|
[AI] Manages DirectSound-based sound playback, implementing volume, resource, and device management. More...
#include <mxsoundmanager.h>
Public Member Functions | |
MxSoundManager () | |
[AI] Constructs a new MxSoundManager instance. More... | |
~MxSoundManager () override | |
[AI] Destructor for MxSoundManager. More... | |
void | Destroy () override |
[AI] Releases sound resources and unregisters from tickle system. More... | |
void | SetVolume (MxS32 p_volume) override |
[AI] Sets the global audio output volume for all managed sound presenters. More... | |
virtual MxResult | Create (MxU32 p_frequencyMS, MxBool p_createThread) |
[AI] Initializes and sets up the DirectSound environment. More... | |
virtual void | Pause () |
[AI] Pauses all currently playing wave presenters. More... | |
virtual void | Resume () |
[AI] Resumes all previously paused wave presenters. More... | |
LPDIRECTSOUND | GetDirectSound () |
[AI] Gets pointer to internal DirectSound interface. More... | |
MxS32 | GetAttenuation (MxU32 p_volume) |
[AI] Maps a percentage volume (1-100) to a DirectSound-specific attenuation value. More... | |
MxPresenter * | FUN_100aebd0 (const MxAtomId &p_atomId, MxU32 p_objectId) |
[AI] Finds a presenter matching a specific atom ID and object ID. More... | |
![]() | |
MxAudioManager () | |
[AI] Constructs the audio manager and initializes default volume. More... | |
~MxAudioManager () override | |
[AI] Destructs the audio manager and handles cleanup of resources. More... | |
MxResult | Create () override |
[AI] Initializes audio subsystem resources and registers an instance for global audio management. More... | |
void | Destroy () override |
[AI] Tears down the audio subsystem instance and unregisters it from global management. More... | |
virtual MxS32 | GetVolume () |
[AI] Gets the current global audio volume. More... | |
virtual void | SetVolume (MxS32 p_volume) |
[AI] Sets the current global audio volume. More... | |
![]() | |
MxMediaManager () | |
[AI] Constructor. More... | |
~MxMediaManager () override | |
[AI] Destructor. More... | |
MxResult | Tickle () override |
[AI] Called by the tickle manager to step through and update all presenters, and process their output data. More... | |
virtual MxResult | Create () |
[AI] Allocates and initializes the internal presenter list for this manager, ensuring thread safety. More... | |
virtual void | Destroy () |
[AI] Destroys all registered presenters and resets the internal state, ensuring safe resource disposal. More... | |
virtual void | RegisterPresenter (MxPresenter &p_presenter) |
[AI] Register a new presenter for tickle management and playback coordination. More... | |
virtual void | UnregisterPresenter (MxPresenter &p_presenter) |
[AI] Remove a presenter from tickle and managed output lists. More... | |
virtual void | StopPresenters () |
[AI] Stops/ends the action on all registered presenters, typically halting all playback and output. More... | |
MxResult | Init () |
[AI] Initializes all internal members to their default values. 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... | |
Protected Member Functions | |
void | Init () |
[AI] Internal initialization routine for member variables and DirectSound pointers. More... | |
void | Destroy (MxBool p_fromDestructor) |
[AI] Internal destroy logic for use both in destructor and standard resource reset. More... | |
![]() | |
void | Init () |
[AI] Initializes audio manager state, setting default volume and other relevant fields. More... | |
Protected Attributes | |
LPDIRECTSOUND | m_directSound |
[AI] Pointer to main DirectSound interface. Needed for all DirectSound operations. More... | |
LPDIRECTSOUNDBUFFER | m_dsBuffer |
[AI] Primary DirectSound buffer interface for setting output format/volume. More... | |
undefined | m_unk0x38 [4] |
[AI] Unknown, reserved/unused memory or opaque data per binary compatibility. [AI_SUGGESTED_NAME: reserved] [AI] More... | |
![]() | |
MxS32 | m_volume |
[AI] Holds the current global audio volume for the game. More... | |
![]() | |
MxPresenterList * | m_presenters |
[AI] Pointer to list of currently registered (active) presenters. More... | |
MxThread * | m_thread |
[AI] Optional pointer to a worker thread used for media dispatch/IO (if multi-threaded operation is used, otherwise NULL). More... | |
MxCriticalSection | m_criticalSection |
[AI] Critical section object used for guarding access to the presenter list and internal members for thread safety. More... | |
[AI] Manages DirectSound-based sound playback, implementing volume, resource, and device management.
[AI] Forward declaration for the global DirectSound or software-mixer manager for sound FX and voice.
[AI] MxSoundManager provides sound output by controlling DirectSound device and primary buffer. It creates, manages, and destroys relevant resources, integrating with the main tickle/timer system for updating sound playback, volume, and pausing/resuming playback, including compatibility with both standard and 3D audio. It is thread-safe for sound playback through critical section management.
Definition at line 18 of file mxsoundmanager.h.
MxSoundManager::MxSoundManager | ( | ) |
[AI] Constructs a new MxSoundManager instance.
[AI] Initializes all DirectSound pointers and internal state to a safe default.
Definition at line 26 of file mxsoundmanager.cpp.
|
override |
[AI] Destructor for MxSoundManager.
[AI] Releases all DirectSound resources and unregisters from tickle managers if necessary.
Definition at line 32 of file mxsoundmanager.cpp.
[AI] Initializes and sets up the DirectSound environment.
p_frequencyMS | Tickle/update frequency in milliseconds for updating sound playback. [AI] |
p_createThread | If true, runs the tickle loop in a dedicated thread, otherwise uses the tickle manager. [AI] |
[AI] Creates the DirectSound interface, sets the cooperative level, and configures the primary buffer (for 3D or regular sound according to the application's setting). Registers for tickle updates either via a thread or the global tickle manager.
Reimplemented in LegoSoundManager.
Definition at line 71 of file mxsoundmanager.cpp.
|
overridevirtual |
[AI] Releases sound resources and unregisters from tickle system.
[AI] Used to safely clean up all managed resources, either explicitly or from destruction.
Reimplemented from MxAudioManager.
Definition at line 159 of file mxsoundmanager.cpp.
|
protected |
[AI] Internal destroy logic for use both in destructor and standard resource reset.
p_fromDestructor | Set true if called from destructor to avoid recursive destruction of base classes. [AI] |
[AI] Releases DirectSound resources, primary buffer, and manages tickle registration/threads as appropriate. Optionally cascades to parent class destroy.
Definition at line 45 of file mxsoundmanager.cpp.
MxPresenter * MxSoundManager::FUN_100aebd0 | ( | const MxAtomId & | p_atomId, |
MxU32 | p_objectId | ||
) |
[AI] Finds a presenter matching a specific atom ID and object ID.
p_atomId | The atom ID corresponding to a resource (audio object identifier). [AI] |
p_objectId | Unique object instance identifier used to distinguish between multiple sounds of the same type. [AI] |
[AI] Used to locate a currently-active sound presenter for a given asset/object pair.
Definition at line 182 of file mxsoundmanager.cpp.
[AI] Maps a percentage volume (1-100) to a DirectSound-specific attenuation value.
p_volume | The desired volume as a percentage, 1 (min, not zero) to 100 (max). [AI] |
[AI] Returns a lookup from a static table for DirectSound volume attenuation.
Definition at line 200 of file mxsoundmanager.cpp.
|
inline |
[AI] Gets pointer to internal DirectSound interface.
Definition at line 70 of file mxsoundmanager.h.
|
protected |
[AI] Internal initialization routine for member variables and DirectSound pointers.
[AI] Sets all internal pointers to NULL, called during construction and resource resets.
Definition at line 38 of file mxsoundmanager.cpp.
|
virtual |
[AI] Pauses all currently playing wave presenters.
[AI] Iterates through all managed presenters and pauses those that are MxWavePresenter. Used for suspending sound playback (e.g., when the game is minimized).
Definition at line 212 of file mxsoundmanager.cpp.
|
virtual |
[AI] Resumes all previously paused wave presenters.
[AI] Iterates through all managed presenters and resumes those that are MxWavePresenter. Used for continuing sound playback after a pause.
Definition at line 227 of file mxsoundmanager.cpp.
|
overridevirtual |
[AI] Sets the global audio output volume for all managed sound presenters.
p_volume | Volume level as an integer percentage (0-100). [AI] |
[AI] Iterates through all managed sound presenters and sets their individual volumes to match the manager's global volume.
Reimplemented from MxAudioManager.
Definition at line 165 of file mxsoundmanager.cpp.
|
protected |
[AI] Pointer to main DirectSound interface. Needed for all DirectSound operations.
Definition at line 103 of file mxsoundmanager.h.
|
protected |
[AI] Primary DirectSound buffer interface for setting output format/volume.
Definition at line 104 of file mxsoundmanager.h.
|
protected |
[AI] Unknown, reserved/unused memory or opaque data per binary compatibility. [AI_SUGGESTED_NAME: reserved] [AI]
Definition at line 105 of file mxsoundmanager.h.