Audio plugin host https://kx.studio/carla
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.

100 lines
3.6KB

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