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.

113 lines
4.2KB

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