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.

112 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. /**
  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();
  50. //==============================================================================
  51. void closeButtonPressed();
  52. void changeListenerCallback (ChangeBroadcaster*);
  53. bool isInterestedInFileDrag (const StringArray& files);
  54. void fileDragEnter (const StringArray& files, int, int);
  55. void fileDragMove (const StringArray& files, int, int);
  56. void fileDragExit (const StringArray& files);
  57. void filesDropped (const StringArray& files, int, int);
  58. void menuBarActivated (bool isActive);
  59. StringArray getMenuBarNames();
  60. PopupMenu getMenuForIndex (int topLevelMenuIndex, const String& menuName);
  61. void menuItemSelected (int menuItemID, int topLevelMenuIndex);
  62. ApplicationCommandTarget* getNextCommandTarget();
  63. void getAllCommands (Array<CommandID>& commands);
  64. void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result);
  65. bool perform (const InvocationInfo& info);
  66. void tryToQuitApplication();
  67. void createPlugin (const PluginDescription&, Point<int> pos);
  68. void addPluginsToMenu (PopupMenu&) const;
  69. const PluginDescription* getChosenType (int menuID) const;
  70. GraphDocumentComponent* getGraphEditor() const;
  71. bool isDoublePrecisionProcessing();
  72. void updatePrecisionMenuItem (ApplicationCommandInfo& info);
  73. private:
  74. //==============================================================================
  75. AudioDeviceManager deviceManager;
  76. AudioPluginFormatManager formatManager;
  77. OwnedArray<PluginDescription> internalTypes;
  78. KnownPluginList knownPluginList;
  79. KnownPluginList::SortMethod pluginSortMethod;
  80. class PluginListWindow;
  81. ScopedPointer<PluginListWindow> pluginListWindow;
  82. void showAudioSettings();
  83. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainHostWindow)
  84. };