Isle
Loading...
Searching...
No Matches
LegoSoundManager Class Reference

[AI] Manages 3D sound effects and music playback for LEGO Island, integrating with DirectSound and providing caching. More...

#include <legosoundmanager.h>

Inheritance diagram for LegoSoundManager:
Collaboration diagram for LegoSoundManager:

Public Member Functions

 LegoSoundManager ()
 [AI] Constructs the LegoSoundManager and initializes its internal members. More...
 
 ~LegoSoundManager () override
 [AI] Destructor. Cleans up resources, optionally as part of destruction. More...
 
MxResult Tickle () override
 [AI] Performs periodic processing, such as updating the cache sound manager. More...
 
void Destroy () override
 [AI] Cleans up and releases all resources used by the sound manager and its cache. More...
 
MxResult Create (MxU32 p_frequencyMS, MxBool p_createThread) override
 [AI] Initializes the sound manager with a desired tick frequency and threading option. More...
 
void UpdateListener (const float *p_position, const float *p_direction, const float *p_up, const float *p_velocity)
 [AI] Updates the 3D sound listener properties in DirectSound, reflecting player/world changes. More...
 
LegoCacheSoundManagerGetCacheSoundManager ()
 [AI] Returns the cache sound manager used to cache and reuse sound effects. More...
 
- Public Member Functions inherited from MxSoundManager
 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...
 
MxPresenterFUN_100aebd0 (const MxAtomId &p_atomId, MxU32 p_objectId)
 [AI] Finds a presenter matching a specific atom ID and object ID. More...
 
- Public Member Functions inherited from MxAudioManager
 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...
 
- Public Member Functions inherited from MxMediaManager
 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...
 
- Public Member Functions inherited from MxCore
 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...
 

Additional Inherited Members

- Protected Member Functions inherited from MxSoundManager
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...
 
- Protected Member Functions inherited from MxAudioManager
void Init ()
 [AI] Initializes audio manager state, setting default volume and other relevant fields. More...
 
- Protected Attributes inherited from MxSoundManager
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...
 
- Protected Attributes inherited from MxAudioManager
MxS32 m_volume
 [AI] Holds the current global audio volume for the game. More...
 
- Protected Attributes inherited from MxMediaManager
MxPresenterListm_presenters
 [AI] Pointer to list of currently registered (active) presenters. More...
 
MxThreadm_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...
 

Detailed Description

[AI] Manages 3D sound effects and music playback for LEGO Island, integrating with DirectSound and providing caching.

[AI] This class extends MxSoundManager to add LEGO-specific sound management, including 3D audio listener control and caching of sound resources through LegoCacheSoundManager. It is responsible for initializing DirectSound interfaces, updating the listener's position/orientation for 3D sound, and coordinating sound resource caches. Size: 0x44 bytes. VTABLE: LEGO1 0x100d6b10 / BETA10 0x101bec30

Definition at line 14 of file legosoundmanager.h.

Constructor & Destructor Documentation

◆ LegoSoundManager()

LegoSoundManager::LegoSoundManager ( )

[AI] Constructs the LegoSoundManager and initializes its internal members.

Definition at line 12 of file legosoundmanager.cpp.

◆ ~LegoSoundManager()

LegoSoundManager::~LegoSoundManager ( )
override

[AI] Destructor. Cleans up resources, optionally as part of destruction.

Definition at line 18 of file legosoundmanager.cpp.

Member Function Documentation

◆ Create()

MxResult LegoSoundManager::Create ( MxU32  p_frequencyMS,
MxBool  p_createThread 
)
overridevirtual

[AI] Initializes the sound manager with a desired tick frequency and threading option.

Parameters
p_frequencyMS[AI] Desired tick/update interval, in milliseconds.
p_createThread[AI] If TRUE, creates a separate audio thread for updates.
Returns
[AI] Result of the create operation.

Reimplemented from MxSoundManager.

Definition at line 43 of file legosoundmanager.cpp.

◆ Destroy()

void LegoSoundManager::Destroy ( )
overridevirtual

[AI] Cleans up and releases all resources used by the sound manager and its cache.

Reimplemented from MxMediaManager.

Definition at line 91 of file legosoundmanager.cpp.

◆ GetCacheSoundManager()

LegoCacheSoundManager * LegoSoundManager::GetCacheSoundManager ( )
inline

[AI] Returns the cache sound manager used to cache and reuse sound effects.

Returns
[AI] Pointer to the LegoCacheSoundManager instance.

Definition at line 45 of file legosoundmanager.h.

◆ Tickle()

MxResult LegoSoundManager::Tickle ( )
overridevirtual

[AI] Performs periodic processing, such as updating the cache sound manager.

Called by the main tick loop.

Returns
[AI] Status of the tick operation (see underlying tickle logic).

Reimplemented from MxCore.

Definition at line 98 of file legosoundmanager.cpp.

◆ UpdateListener()

void LegoSoundManager::UpdateListener ( const float *  p_position,
const float *  p_direction,
const float *  p_up,
const float *  p_velocity 
)

[AI] Updates the 3D sound listener properties in DirectSound, reflecting player/world changes.

Parameters
p_position[AI] 3D position vector of the listener (array of 3 floats). Can be nullptr.
p_direction[AI] Forward direction vector of the listener (array of 3 floats). Can be nullptr.
p_up[AI] Up vector of the listener (array of 3 floats). Can be nullptr.
p_velocity[AI] Velocity vector of the listener (array of 3 floats). Can be nullptr.

[AI] If any vector is not nullptr, applies the change and updates the DirectSound listener object.

Definition at line 108 of file legosoundmanager.cpp.


The documentation for this class was generated from the following files: