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.

107 lines
4.0KB

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