AudioControlsEditorWindow.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. #if !defined(Q_MOC_RUN)
  10. #include <ATLControlsModel.h>
  11. #include <AzCore/std/string/string_view.h>
  12. #include <IEditor.h>
  13. #include <QMainWindow>
  14. #include <QFileSystemWatcher>
  15. #include <Source/Editor/ui_AudioControlsEditorMainWindow.h>
  16. #endif
  17. namespace AudioControls
  18. {
  19. class CATLControlsModel;
  20. class CATLControlsPanel;
  21. class CInspectorPanel;
  22. class CAudioSystemPanel;
  23. class CATLControl;
  24. //-------------------------------------------------------------------------------------------//
  25. class CAudioControlsEditorWindow
  26. : public QMainWindow
  27. , public Ui::MainWindow
  28. , public IEditorNotifyListener
  29. {
  30. Q_OBJECT
  31. public:
  32. explicit CAudioControlsEditorWindow(QWidget* parent = nullptr);
  33. ~CAudioControlsEditorWindow();
  34. void OnEditorNotifyEvent(EEditorNotifyEvent event) override;
  35. // you are required to implement this to satisfy the unregister/registerclass requirements on "RegisterQtViewPane"
  36. // make sure you pick a unique GUID
  37. static const GUID& GetClassID()
  38. {
  39. // {5793D22F-3740-43FF-8474-5F4769E6E54F}
  40. static const GUID guid =
  41. {
  42. 0x5793d22f, 0x3740, 0x43ff, { 0x84, 0x74, 0x5f, 0x47, 0x69, 0xe6, 0xe5, 0x4f }
  43. };
  44. return guid;
  45. }
  46. private slots:
  47. void Reload();
  48. void ReloadMiddlewareData();
  49. void Save();
  50. void UpdateFilterFromSelection();
  51. void UpdateInspector();
  52. void FilterControlType(EACEControlType type, bool bShow);
  53. void Update();
  54. void RefreshAudioSystem();
  55. protected:
  56. void closeEvent(QCloseEvent* pEvent) override;
  57. private:
  58. void UpdateAudioSystemData();
  59. void StartWatchingFolder(const AZStd::string_view folder);
  60. CATLControlsModel* m_pATLModel = nullptr;
  61. CATLControlsPanel* m_pATLControlsPanel = nullptr; // Left ATL panel
  62. CInspectorPanel* m_pInspectorPanel = nullptr; // Center Connection Editing panel
  63. CAudioSystemPanel* m_pAudioSystemPanel = nullptr; // Right Middleware panel
  64. QFileSystemWatcher m_fileSystemWatcher;
  65. static bool m_wasClosed; // true indicates that the window was once open and closed, used for refreshing data
  66. };
  67. } // namespace AudioControls