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.

114 lines
4.1KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #ifndef __MAINHOSTWINDOW_JUCEHEADER__
  18. #define __MAINHOSTWINDOW_JUCEHEADER__
  19. #include "FilterGraph.h"
  20. #include "GraphEditorPanel.h"
  21. //==============================================================================
  22. namespace CommandIDs
  23. {
  24. static const int open = 0x30000;
  25. static const int save = 0x30001;
  26. static const int saveAs = 0x30002;
  27. static const int newFile = 0x30003;
  28. static const int showPluginListEditor = 0x30100;
  29. static const int showAudioSettings = 0x30200;
  30. static const int aboutBox = 0x30300;
  31. static const int allWindowsForward = 0x30400;
  32. static const int toggleDoublePrecision = 0x30500;
  33. }
  34. ApplicationCommandManager& getCommandManager();
  35. ApplicationProperties& getAppProperties();
  36. //==============================================================================
  37. /**
  38. */
  39. class MainHostWindow : public DocumentWindow,
  40. public MenuBarModel,
  41. public ApplicationCommandTarget,
  42. public ChangeListener,
  43. public FileDragAndDropTarget
  44. {
  45. public:
  46. //==============================================================================
  47. MainHostWindow();
  48. ~MainHostWindow();
  49. //==============================================================================
  50. void closeButtonPressed();
  51. void changeListenerCallback (ChangeBroadcaster*);
  52. bool isInterestedInFileDrag (const StringArray& files);
  53. void fileDragEnter (const StringArray& files, int, int);
  54. void fileDragMove (const StringArray& files, int, int);
  55. void fileDragExit (const StringArray& files);
  56. void filesDropped (const StringArray& files, int, int);
  57. void menuBarActivated (bool isActive);
  58. StringArray getMenuBarNames();
  59. PopupMenu getMenuForIndex (int topLevelMenuIndex, const String& menuName);
  60. void menuItemSelected (int menuItemID, int topLevelMenuIndex);
  61. ApplicationCommandTarget* getNextCommandTarget();
  62. void getAllCommands (Array <CommandID>& commands);
  63. void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result);
  64. bool perform (const InvocationInfo& info);
  65. bool tryToQuitApplication();
  66. void createPlugin (const PluginDescription* desc, int x, int y);
  67. void addPluginsToMenu (PopupMenu& m) const;
  68. const PluginDescription* getChosenType (const int menuID) const;
  69. GraphDocumentComponent* getGraphEditor() const;
  70. bool isDoublePrecisionProcessing();
  71. void updatePrecisionMenuItem (ApplicationCommandInfo& info);
  72. private:
  73. //==============================================================================
  74. AudioDeviceManager deviceManager;
  75. AudioPluginFormatManager formatManager;
  76. OwnedArray <PluginDescription> internalTypes;
  77. KnownPluginList knownPluginList;
  78. KnownPluginList::SortMethod pluginSortMethod;
  79. class PluginListWindow;
  80. ScopedPointer<PluginListWindow> pluginListWindow;
  81. void showAudioSettings();
  82. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainHostWindow)
  83. };
  84. #endif // __MAINHOSTWINDOW_JUCEHEADER__