3
0

MiniAudioEditorModule.cpp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. #include <MiniAudioModuleInterface.h>
  9. namespace MiniAudio
  10. {
  11. extern AZ::TypeId MiniAudioEditorSystemComponent_GetTypeId();
  12. extern AZ::ComponentDescriptor* MiniAudioEditorSystemComponent_CreateDescriptor();
  13. extern AZ::ComponentDescriptor* EditorMiniAudioListenerComponent_CreateDescriptor();
  14. extern AZ::ComponentDescriptor* EditorMiniAudioPlaybackComponent_CreateDescriptor();
  15. class MiniAudioEditorModule : public MiniAudioModuleInterface
  16. {
  17. public:
  18. AZ_RTTI(MiniAudioEditorModule, "{501C94A1-993A-4203-9720-D43D6C1DDB7A}", MiniAudioModuleInterface);
  19. AZ_CLASS_ALLOCATOR(MiniAudioEditorModule, AZ::SystemAllocator, 0);
  20. MiniAudioEditorModule()
  21. {
  22. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  23. // Add ALL components descriptors associated with this gem to m_descriptors.
  24. // This will associate the AzTypeInfo information for the components with the the SerializeContext, BehaviorContext and
  25. // EditContext. This happens through the [MyComponent]::Reflect() function.
  26. m_descriptors.insert(
  27. m_descriptors.end(),
  28. {
  29. MiniAudioEditorSystemComponent_CreateDescriptor(),
  30. EditorMiniAudioListenerComponent_CreateDescriptor(),
  31. EditorMiniAudioPlaybackComponent_CreateDescriptor(),
  32. });
  33. }
  34. /**
  35. * Add required SystemComponents to the SystemEntity.
  36. * Non-SystemComponents should not be added here
  37. */
  38. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  39. {
  40. return AZ::ComponentTypeList{
  41. MiniAudioEditorSystemComponent_GetTypeId(),
  42. };
  43. }
  44. };
  45. } // namespace MiniAudio
  46. AZ_DECLARE_MODULE_CLASS(Gem_MiniAudio, MiniAudio::MiniAudioEditorModule)