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.

106 lines
3.8KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2013 - Raw Material Software 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 showPluginListEditor = 0x30100;
  28. static const int showAudioSettings = 0x30200;
  29. static const int aboutBox = 0x30300;
  30. }
  31. ApplicationCommandManager& getCommandManager();
  32. ApplicationProperties& getAppProperties();
  33. //==============================================================================
  34. /**
  35. */
  36. class MainHostWindow : public DocumentWindow,
  37. public MenuBarModel,
  38. public ApplicationCommandTarget,
  39. public ChangeListener,
  40. public FileDragAndDropTarget
  41. {
  42. public:
  43. //==============================================================================
  44. MainHostWindow();
  45. ~MainHostWindow();
  46. //==============================================================================
  47. void closeButtonPressed();
  48. void changeListenerCallback (ChangeBroadcaster*);
  49. bool isInterestedInFileDrag (const StringArray& files);
  50. void fileDragEnter (const StringArray& files, int, int);
  51. void fileDragMove (const StringArray& files, int, int);
  52. void fileDragExit (const StringArray& files);
  53. void filesDropped (const StringArray& files, int, int);
  54. StringArray getMenuBarNames();
  55. PopupMenu getMenuForIndex (int topLevelMenuIndex, const String& menuName);
  56. void menuItemSelected (int menuItemID, int topLevelMenuIndex);
  57. ApplicationCommandTarget* getNextCommandTarget();
  58. void getAllCommands (Array <CommandID>& commands);
  59. void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result);
  60. bool perform (const InvocationInfo& info);
  61. bool tryToQuitApplication();
  62. void createPlugin (const PluginDescription* desc, int x, int y);
  63. void addPluginsToMenu (PopupMenu& m) const;
  64. const PluginDescription* getChosenType (const int menuID) const;
  65. GraphDocumentComponent* getGraphEditor() const;
  66. private:
  67. //==============================================================================
  68. AudioDeviceManager deviceManager;
  69. AudioPluginFormatManager formatManager;
  70. OwnedArray <PluginDescription> internalTypes;
  71. KnownPluginList knownPluginList;
  72. KnownPluginList::SortMethod pluginSortMethod;
  73. class PluginListWindow;
  74. ScopedPointer <PluginListWindow> pluginListWindow;
  75. void showAudioSettings();
  76. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainHostWindow)
  77. };
  78. #endif // __MAINHOSTWINDOW_JUCEHEADER__