12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- /*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
- #pragma once
- #include <AzCore/Component/Component.h>
- #include <LmbrCentral/Audio/AudioSystemComponentBus.h>
- #include <AzFramework/API/ApplicationAPI.h>
- namespace LmbrCentral
- {
- /*!
- * AudioSystemComponent
- * Handles requests of a global context for the audio system.
- * The requests are not tied to an AZ::Entity.
- */
- class AudioSystemComponent
- : public AZ::Component
- , protected AudioSystemComponentRequestBus::Handler
- , protected AzFramework::LevelSystemLifecycleNotificationBus::Handler
- {
- public:
- AZ_COMPONENT(AudioSystemComponent, "{666E28D2-FC99-4D41-861D-3758C5070653}");
- static void Reflect(AZ::ReflectContext* context);
- static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
- static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
- AudioSystemComponent() = default;
- ~AudioSystemComponent() override = default;
- protected:
- ////////////////////////////////////////////////////////////////////////
- // AZ::Component interface implementation
- void Init() override;
- void Activate() override;
- void Deactivate() override;
- ////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////
- // AudioSystemComponentRequestBus::Handler interface implementation
- bool IsAudioSystemInitialized() override;
- void GlobalStopAllSounds() override;
- void GlobalMuteAudio() override;
- void GlobalUnmuteAudio() override;
- void GlobalRefreshAudio(AZStd::string_view levelName) override;
- void GlobalExecuteAudioTrigger(const char* triggerName, AZ::EntityId callbackOwnerEntityId) override;
- void GlobalKillAudioTrigger(const char* triggerName, AZ::EntityId callbackOwnerEntityId) override;
- void GlobalSetAudioRtpc(const char* rtpcName, float value) override;
- void GlobalResetAudioRtpcs() override;
- void GlobalSetAudioSwitchState(const char* switchName, const char* stateName) override;
- void LevelLoadAudio(AZStd::string_view levelName) override;
- void LevelUnloadAudio() override;
- ////////////////////////////////////////////////////////////////////////
- // AzFramework::LevelSystemLifecycleNotificationBus::Handler implementation
- void OnLoadingStart(const char* levelName) override;
- void OnUnloadComplete(const char* levelName) override;
- };
- } // namespace LmbrCentral
|