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) 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. #pragma once
  18. #include "FilterGraph.h"
  19. #include "GraphEditorPanel.h"
  20. //==============================================================================
  21. namespace CommandIDs
  22. {
  23. static const int open = 0x30000;
  24. static const int save = 0x30001;
  25. static const int saveAs = 0x30002;
  26. static const int newFile = 0x30003;
  27. static const int showPluginListEditor = 0x30100;
  28. static const int showAudioSettings = 0x30200;
  29. static const int aboutBox = 0x30300;
  30. static const int allWindowsForward = 0x30400;
  31. static const int toggleDoublePrecision = 0x30500;
  32. }
  33. ApplicationCommandManager& getCommandManager();
  34. ApplicationProperties& getAppProperties();
  35. //==============================================================================
  36. /**
  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();
  50. void changeListenerCallback (ChangeBroadcaster*);
  51. bool isInterestedInFileDrag (const StringArray& files);
  52. void fileDragEnter (const StringArray& files, int, int);
  53. void fileDragMove (const StringArray& files, int, int);
  54. void fileDragExit (const StringArray& files);
  55. void filesDropped (const StringArray& files, int, int);
  56. void menuBarActivated (bool isActive);
  57. StringArray getMenuBarNames();
  58. PopupMenu getMenuForIndex (int topLevelMenuIndex, const String& menuName);
  59. void menuItemSelected (int menuItemID, int topLevelMenuIndex);
  60. ApplicationCommandTarget* getNextCommandTarget();
  61. void getAllCommands (Array <CommandID>& commands);
  62. void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result);
  63. bool perform (const InvocationInfo& info);
  64. bool tryToQuitApplication();
  65. void createPlugin (const PluginDescription* desc, int x, int y);
  66. void addPluginsToMenu (PopupMenu& m) const;
  67. const PluginDescription* getChosenType (const int menuID) const;
  68. GraphDocumentComponent* getGraphEditor() const;
  69. bool isDoublePrecisionProcessing();
  70. void updatePrecisionMenuItem (ApplicationCommandInfo& info);
  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. };