36 :
Component(
"Audio"), mAudioSettings(settings), mConfig(config) {
77 void OnInit(
const nlohmann::json& initArgs = nlohmann::json::object())
override;
90 std::shared_ptr<AudioPlayer> mAudioPlayer;
93 std::shared_ptr<std::vector<AudioBackend>> mAvailableAudioBackends;
94 std::shared_ptr<Config> mConfig;
97 std::shared_ptr<Config> GetConfig()
const;
AudioChannelsSetting
Selects the number and arrangement of output audio channels.
Definition AudioChannelsSetting.h:9
Manages audio playback through a platform-specific AudioPlayer.
Definition Audio.h:29
void OnInit(const nlohmann::json &initArgs=nlohmann::json::object()) override
Implements audio initialization. Called by Component::Init().
AudioBackend GetSavedAudioBackend()
Reads and validates the audio backend from the persisted config.
std::shared_ptr< AudioPlayer > GetAudioPlayer()
Returns the currently active AudioPlayer instance.
void SetAudioChannels(AudioChannelsSetting channels)
Changes the channel layout and reinitialises the audio player.
AudioBackend GetCurrentAudioBackend()
Returns the identifier of the currently active audio backend.
AudioChannelsSetting GetAudioChannels() const
Returns the current audio channel configuration.
std::shared_ptr< std::vector< AudioBackend > > GetAvailableAudioBackends()
Returns all audio backends available on the current platform.
Audio(AudioSettings settings, std::shared_ptr< Config > config=nullptr)
Constructs an Audio manager with the given initial settings.
Definition Audio.h:35
void InitAudioPlayer()
(Re)initialises the AudioPlayer for the current backend and channel settings.
void SetCurrentAudioBackend(AudioBackend backend)
Switches to a different audio backend, reinitialising the AudioPlayer.
AudioChannelsSetting GetSavedAudioChannelsSetting()
Reads and validates the audio channel layout from the persisted config.
A named Part with a parent/child hierarchy and optional thread safety.
Definition Component.h:34
Core namespace for the libultraship engine framework.
Definition gfx_direct3d_common.h:14
AudioBackend
Identifies the audio backend implementation in use.
Definition AudioBackend.h:5
Configuration parameters shared by all AudioPlayer backends.
Definition AudioPlayer.h:14