VR-Engage  2.2
Loading...
Searching...
No Matches
audioUpdater.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file audioUpdater.h
7//! \brief Defines the audio updater component for the spectator role
8//! \ingroup vreSpectatorFrontend
9
10#pragma once
11
13
15
16//! \brief Forward declaration of the sound player class
17class DtSoundPlayer;
18
19//! \brief Forward declaration of the looping sound source class
20class DtLoopingSource;
21
22//! \brief Forward declaration of the transient sound source class
23class DtTransientSource;
24
25namespace makVrv
26{
27//! \brief Forward declaration of the display element class
28class DtDe;
29} // namespace makVrv
30
31namespace makVre
32{
33
34//! \brief Type identifier constant for DtSpectatorAudioUpdater components
35//!
36//! This constant defines the string identifier used to identify DtSpectatorAudioUpdater
37//! component types within the VR-Engage framework. It is used for component
38//! registration, type checking, and serialization operations.
39constexpr const char* DtSpectatorAudioUpdaterType = "DtSpectatorAudioUpdater";
40
41//! \brief Audio management component for the spectator role
42//!
43//! This component manages audio feedback for the spectator role,
44//! including handling sound effects, ambient audio, and event-based
45//! audio cues. It responds to simulation events and updates audio
46//! sources accordingly.
48{
49public:
50 //! \brief Default constructor
52
53 //! \brief Virtual destructor
54 virtual ~DtSpectatorAudioUpdater() override;
55
56 //! \brief Initializes the audio updater component
57 //! \param player Pointer to the player station
58 //! \param config Reference to the initialization configuration
59 //! \return True if initialization was successful, false otherwise
60 //!
61 //! Sets up audio sources and registers message handlers for audio events
63
64 //! \brief Updates audio state each frame
65 //! \param dt Delta time since the last update in seconds
66 //!
67 //! Updates audio sources and manages sound playback based on simulation state
68 virtual void tick(double dt) override;
69
70 //! \brief Performs cleanup when the component is shut down
71 //!
72 //! Releases audio resources and unregisters message handlers
73 virtual void shutdown() override;
74
75 //! \brief Returns the component type identifier
76 //! \return String identifier for this component type
77 //!
78 //! Returns the type identifier string for this component, which is used
79 //! by the VR-Engage framework for component identification and management.
80 //! The returned value matches DtSpectatorAudioUpdaterType.
81 virtual const char* type() const override;
82
83protected:
84};
85} // namespace makVre
Table-based access to Lua state for configuration data.
Definition initializer.h:38
Base class for all role components in VR-Engage.
Definition playerComponent.h:78
virtual DtPlayerStation & player()
Gets the player station.
Class for managing the user interface for engaged roles.
Definition playerStation.h:51
virtual bool initialize(makVre::DtPlayerStation *player, makVre::DtInitTable &config) override
Initializes the audio updater component.
virtual void shutdown() override
Performs cleanup when the component is shut down.
virtual void tick(double dt) override
Updates audio state each frame.
virtual ~DtSpectatorAudioUpdater() override
Virtual destructor.
DtSpectatorAudioUpdater()
Default constructor.
virtual const char * type() const override
Returns the component type identifier.
Defines export macros for the Spectator Frontend library.
#define SPECTATOR_DLL
Export/import macro for non-Windows platforms (empty)
Definition export.h:25
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
constexpr const char * DtSpectatorAudioUpdaterType
Type identifier constant for DtSpectatorAudioUpdater components.
Definition audioUpdater.h:39
Definition appLauncherComponent.h:28
Defines the DtPlayerComponent base class for VR-Engage role components.