AudioControlsLoader.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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/std/containers/set.h>
  10. #include <AzCore/XML/rapidxml.h>
  11. #include <ACETypes.h>
  12. #include <AudioControl.h>
  13. #include <QString>
  14. class QStandardItemModel;
  15. class QStandardItem;
  16. namespace AudioControls
  17. {
  18. class CATLControlsModel;
  19. class IAudioSystemEditor;
  20. //-------------------------------------------------------------------------------------------//
  21. class CAudioControlsLoader
  22. {
  23. public:
  24. CAudioControlsLoader(CATLControlsModel* atlControlsModel, QStandardItemModel* layoutModel, IAudioSystemEditor* audioSystemImpl);
  25. const FilepathSet& GetLoadedFilenamesList();
  26. void LoadAll();
  27. void LoadControls();
  28. void LoadScopes();
  29. private:
  30. void LoadAllLibrariesInFolder(const AZStd::string_view folderPath, const AZStd::string_view level);
  31. void LoadControlsLibrary(const AZ::rapidxml::xml_node<char>* rootNode, const AZStd::string_view filePath, const AZStd::string_view level, const AZStd::string_view fileName);
  32. CATLControl* LoadControl(AZ::rapidxml::xml_node<char>* node, QStandardItem* folderItem, const AZStd::string_view scope);
  33. void LoadPreloadConnections(AZ::rapidxml::xml_node<char>* node, CATLControl* control);
  34. void LoadConnections(AZ::rapidxml::xml_node<char>* rootNode, CATLControl* control);
  35. void CreateDefaultControls();
  36. QStandardItem* AddControl(CATLControl* control, QStandardItem* folderItem);
  37. void LoadScopesImpl(const AZStd::string_view levelsFolder);
  38. QStandardItem* AddUniqueFolderPath(QStandardItem* parentItem, const QString& path);
  39. QStandardItem* AddFolder(QStandardItem* parentItem, const QString& name);
  40. CATLControl* CreateInternalSwitchState(CATLControl* parentControl, const AZStd::string& switchName, const AZStd::string& stateName);
  41. CATLControlsModel* m_atlControlsModel;
  42. QStandardItemModel* m_layoutModel;
  43. IAudioSystemEditor* m_audioSystemImpl;
  44. FilepathSet m_loadedFilenames;
  45. };
  46. } // namespace AudioControls