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.

103 lines
3.8KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-9 by Raw Material Software Ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the GNU General
  7. Public License (Version 2), as published by the Free Software Foundation.
  8. A copy of the license is included in the JUCE distribution, or can be found
  9. online at www.gnu.org/licenses.
  10. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  13. ------------------------------------------------------------------------------
  14. To release a closed-source product which uses JUCE, commercial licenses are
  15. available: visit www.rawmaterialsoftware.com/juce for more information.
  16. ==============================================================================
  17. */
  18. #ifndef __JUCE_MAINHOSTWINDOW_JUCEHEADER__
  19. #define __JUCE_MAINHOSTWINDOW_JUCEHEADER__
  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 showPluginListEditor = 0x30100;
  29. static const int showAudioSettings = 0x30200;
  30. static const int aboutBox = 0x30300;
  31. }
  32. extern ApplicationCommandManager* commandManager;
  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. const StringArray getMenuBarNames();
  55. const 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. OwnedArray <PluginDescription> internalTypes;
  70. KnownPluginList knownPluginList;
  71. KnownPluginList::SortMethod pluginSortMethod;
  72. void showAudioSettings();
  73. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainHostWindow);
  74. };
  75. #endif