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.1KB

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