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.

110 lines
4.0KB

  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 "FilterGraph.h"
  21. #include "GraphEditorPanel.h"
  22. //==============================================================================
  23. namespace CommandIDs
  24. {
  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. static const int showPluginListEditor = 0x30100;
  30. static const int showAudioSettings = 0x30200;
  31. static const int aboutBox = 0x30300;
  32. static const int allWindowsForward = 0x30400;
  33. static const int toggleDoublePrecision = 0x30500;
  34. }
  35. ApplicationCommandManager& getCommandManager();
  36. ApplicationProperties& getAppProperties();
  37. //==============================================================================
  38. class MainHostWindow : public DocumentWindow,
  39. public MenuBarModel,
  40. public ApplicationCommandTarget,
  41. public ChangeListener,
  42. public FileDragAndDropTarget
  43. {
  44. public:
  45. //==============================================================================
  46. MainHostWindow();
  47. ~MainHostWindow();
  48. //==============================================================================
  49. void closeButtonPressed() override;
  50. void changeListenerCallback (ChangeBroadcaster*) override;
  51. bool isInterestedInFileDrag (const StringArray& files) override;
  52. void fileDragEnter (const StringArray& files, int, int) override;
  53. void fileDragMove (const StringArray& files, int, int) override;
  54. void fileDragExit (const StringArray& files) override;
  55. void filesDropped (const StringArray& files, int, int) override;
  56. void menuBarActivated (bool isActive) override;
  57. StringArray getMenuBarNames() override;
  58. PopupMenu getMenuForIndex (int topLevelMenuIndex, const String& menuName) override;
  59. void menuItemSelected (int menuItemID, int topLevelMenuIndex) override;
  60. ApplicationCommandTarget* getNextCommandTarget() override;
  61. void getAllCommands (Array<CommandID>&) override;
  62. void getCommandInfo (CommandID, ApplicationCommandInfo&) override;
  63. bool perform (const InvocationInfo&) override;
  64. void tryToQuitApplication();
  65. void createPlugin (const PluginDescription&, Point<int> pos);
  66. void addPluginsToMenu (PopupMenu&) const;
  67. const PluginDescription* getChosenType (int menuID) const;
  68. bool isDoublePrecisionProcessing();
  69. void updatePrecisionMenuItem (ApplicationCommandInfo& info);
  70. ScopedPointer<GraphDocumentComponent> graphHolder;
  71. private:
  72. //==============================================================================
  73. AudioDeviceManager deviceManager;
  74. AudioPluginFormatManager formatManager;
  75. OwnedArray<PluginDescription> internalTypes;
  76. KnownPluginList knownPluginList;
  77. KnownPluginList::SortMethod pluginSortMethod;
  78. class PluginListWindow;
  79. ScopedPointer<PluginListWindow> pluginListWindow;
  80. void showAudioSettings();
  81. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainHostWindow)
  82. };