ImplementationManager.cpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 <ImplementationManager.h>
  9. #include <ATLControlsModel.h>
  10. #include <AudioControlsEditorPlugin.h>
  11. #include <IAudioSystemEditor.h>
  12. //-----------------------------------------------------------------------------------------------//
  13. CImplementationManager::CImplementationManager()
  14. {
  15. }
  16. //-----------------------------------------------------------------------------------------------//
  17. bool CImplementationManager::LoadImplementation()
  18. {
  19. AudioControls::CATLControlsModel* pATLModel = CAudioControlsEditorPlugin::GetATLModel();
  20. if (pATLModel)
  21. {
  22. pATLModel->ClearAllConnections();
  23. // release the loaded implementation (if any)
  24. Release();
  25. AudioControlsEditor::EditorImplPluginEventBus::Broadcast(&AudioControlsEditor::EditorImplPluginEventBus::Events::InitializeEditorImplPlugin);
  26. }
  27. else
  28. {
  29. return false;
  30. }
  31. ImplementationChanged();
  32. return true;
  33. }
  34. //-----------------------------------------------------------------------------------------------//
  35. void CImplementationManager::Release()
  36. {
  37. AudioControlsEditor::EditorImplPluginEventBus::Broadcast(&AudioControlsEditor::EditorImplPluginEventBus::Events::ReleaseEditorImplPlugin);
  38. }
  39. //-----------------------------------------------------------------------------------------------//
  40. AudioControls::IAudioSystemEditor* CImplementationManager::GetImplementation()
  41. {
  42. AudioControls::IAudioSystemEditor* editor = nullptr;
  43. AudioControlsEditor::EditorImplPluginEventBus::BroadcastResult(editor, &AudioControlsEditor::EditorImplPluginEventBus::Events::GetEditorImplPlugin);
  44. return editor;
  45. }
  46. #include <Source/Editor/moc_ImplementationManager.cpp>