EditorMiniAudioPlaybackComponent.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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/Asset/AssetCommon.h>
  10. #include <AzCore/Component/Component.h>
  11. #include <AzCore/Component/TickBus.h>
  12. #include <AzToolsFramework/ToolsComponents/EditorComponentBase.h>
  13. #include <Clients/MiniAudioPlaybackComponent.h>
  14. #include <Clients/MiniAudioPlaybackComponentController.h>
  15. #include <ToolsComponents/EditorComponentAdapter.h>
  16. namespace MiniAudio
  17. {
  18. class EditorMiniAudioPlaybackComponent
  19. : public AzToolsFramework::Components::EditorComponentAdapter<MiniAudioPlaybackComponentController,
  20. MiniAudioPlaybackComponent, MiniAudioPlaybackComponentConfig>
  21. {
  22. public:
  23. using BaseClass = AzToolsFramework::Components::EditorComponentAdapter<MiniAudioPlaybackComponentController, MiniAudioPlaybackComponent, MiniAudioPlaybackComponentConfig>;
  24. AZ_EDITOR_COMPONENT(EditorMiniAudioPlaybackComponent, EditorMiniAudioPlaybackComponentTypeId, BaseClass);
  25. static void Reflect(AZ::ReflectContext* context);
  26. EditorMiniAudioPlaybackComponent() = default;
  27. explicit EditorMiniAudioPlaybackComponent(const MiniAudioPlaybackComponentConfig& config);
  28. void Activate() override;
  29. void Deactivate() override;
  30. AZ::u32 OnConfigurationChanged() override;
  31. AZ::Crc32 PlaySoundInEditor();
  32. AZ::Crc32 StopSoundInEditor();
  33. AZ::Crc32 PauseSoundInEditor();
  34. AZ::Crc32 OnVolumeChanged();
  35. };
  36. } // namespace MiniAudio