AudioEngineWwiseGemSystemComponent.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzCore/Component/Component.h>
  10. #include <IAudioSystem.h>
  11. #include <IAudioSystemImplementation.h>
  12. #if defined(AUDIO_ENGINE_WWISE_EDITOR)
  13. #include <AzCore/std/smart_ptr/unique_ptr.h>
  14. #include <IAudioSystemEditor.h>
  15. #endif // AUDIO_ENGINE_WWISE_EDITOR
  16. struct SSystemInitParams;
  17. namespace AudioEngineWwiseGem
  18. {
  19. class AudioEngineWwiseGemSystemComponent
  20. : public AZ::Component
  21. , protected Audio::Gem::EngineRequestBus::Handler
  22. #if defined(AUDIO_ENGINE_WWISE_EDITOR)
  23. , protected AudioControlsEditor::EditorImplPluginEventBus::Handler
  24. #endif // AUDIO_ENGINE_WWISE_EDITOR
  25. {
  26. public:
  27. AZ_COMPONENT(AudioEngineWwiseGemSystemComponent, "{521FA289-DC8B-4BC1-BBA0-A7D35EAC656E}", AZ::Component);
  28. static void Reflect(AZ::ReflectContext* context);
  29. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  30. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  31. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  32. static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
  33. protected:
  34. ////////////////////////////////////////////////////////////////////////
  35. // Audio::Gem::EngineRequestBus interface implementation
  36. bool Initialize() override;
  37. void Release() override;
  38. ////////////////////////////////////////////////////////////////////////
  39. #if defined(AUDIO_ENGINE_WWISE_EDITOR)
  40. ////////////////////////////////////////////////////////////////////////
  41. // AudioControlsEditor::EditorImplPluginEventBus interface implementation
  42. void InitializeEditorImplPlugin() override;
  43. void ReleaseEditorImplPlugin() override;
  44. AudioControls::IAudioSystemEditor* GetEditorImplPlugin() override;
  45. ////////////////////////////////////////////////////////////////////////
  46. #endif // AUDIO_ENGINE_WWISE_EDITOR
  47. ////////////////////////////////////////////////////////////////////////
  48. // AZ::Component interface implementation
  49. void Init() override;
  50. void Activate() override;
  51. void Deactivate() override;
  52. ////////////////////////////////////////////////////////////////////////
  53. private:
  54. AZStd::unique_ptr<Audio::AudioSystemImplementation> m_engineWwise;
  55. #if defined(AUDIO_ENGINE_WWISE_EDITOR)
  56. AZStd::unique_ptr<AudioControls::IAudioSystemEditor> m_editorImplPlugin;
  57. #endif // AUDIO_ENGINE_WWISE_EDITOR
  58. };
  59. } // namespace AudioEngineWwiseGem