The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
3.9KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 6 technical preview.
  4. Copyright (c) 2020 - Raw Material Software Limited
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For this technical preview, this file is not subject to commercial licensing.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. #pragma once
  14. #include "../Plugins/PluginGraph.h"
  15. #include "GraphEditorPanel.h"
  16. //==============================================================================
  17. namespace CommandIDs
  18. {
  19. #if ! (JUCE_IOS || JUCE_ANDROID)
  20. static const int open = 0x30000;
  21. static const int save = 0x30001;
  22. static const int saveAs = 0x30002;
  23. static const int newFile = 0x30003;
  24. #endif
  25. static const int showPluginListEditor = 0x30100;
  26. static const int showAudioSettings = 0x30200;
  27. static const int aboutBox = 0x30300;
  28. static const int allWindowsForward = 0x30400;
  29. static const int toggleDoublePrecision = 0x30500;
  30. }
  31. ApplicationCommandManager& getCommandManager();
  32. ApplicationProperties& getAppProperties();
  33. bool isOnTouchDevice();
  34. //==============================================================================
  35. class MainHostWindow : public DocumentWindow,
  36. public MenuBarModel,
  37. public ApplicationCommandTarget,
  38. public ChangeListener,
  39. public FileDragAndDropTarget
  40. {
  41. public:
  42. //==============================================================================
  43. MainHostWindow();
  44. ~MainHostWindow() override;
  45. //==============================================================================
  46. void closeButtonPressed() override;
  47. void changeListenerCallback (ChangeBroadcaster*) override;
  48. bool isInterestedInFileDrag (const StringArray& files) override;
  49. void fileDragEnter (const StringArray& files, int, int) override;
  50. void fileDragMove (const StringArray& files, int, int) override;
  51. void fileDragExit (const StringArray& files) override;
  52. void filesDropped (const StringArray& files, int, int) override;
  53. void menuBarActivated (bool isActive) override;
  54. StringArray getMenuBarNames() override;
  55. PopupMenu getMenuForIndex (int topLevelMenuIndex, const String& menuName) override;
  56. void menuItemSelected (int menuItemID, int topLevelMenuIndex) override;
  57. ApplicationCommandTarget* getNextCommandTarget() override;
  58. void getAllCommands (Array<CommandID>&) override;
  59. void getCommandInfo (CommandID, ApplicationCommandInfo&) override;
  60. bool perform (const InvocationInfo&) override;
  61. void tryToQuitApplication();
  62. void createPlugin (const PluginDescription&, Point<int> pos);
  63. void addPluginsToMenu (PopupMenu&);
  64. PluginDescription getChosenType (int menuID) const;
  65. bool isDoublePrecisionProcessing();
  66. void updatePrecisionMenuItem (ApplicationCommandInfo& info);
  67. std::unique_ptr<GraphDocumentComponent> graphHolder;
  68. private:
  69. //==============================================================================
  70. AudioDeviceManager deviceManager;
  71. AudioPluginFormatManager formatManager;
  72. std::vector<PluginDescription> internalTypes;
  73. KnownPluginList knownPluginList;
  74. KnownPluginList::SortMethod pluginSortMethod;
  75. Array<PluginDescription> pluginDescriptions;
  76. class PluginListWindow;
  77. std::unique_ptr<PluginListWindow> pluginListWindow;
  78. void showAudioSettings();
  79. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainHostWindow)
  80. };