3
0

MiniAudioEditorModule.cpp 2.0 KB

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