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.

111 lines
3.3KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-7 by Raw Material Software ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the
  7. GNU General Public License, as published by the Free Software Foundation;
  8. either version 2 of the License, or (at your option) any later version.
  9. JUCE is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with JUCE; if not, visit www.gnu.org/licenses or write to the
  15. Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  16. Boston, MA 02111-1307 USA
  17. ------------------------------------------------------------------------------
  18. If you'd like to release a closed-source product which uses JUCE, commercial
  19. licenses are also available: visit www.rawmaterialsoftware.com/juce for
  20. more information.
  21. ==============================================================================
  22. */
  23. #include "../../../juce.h"
  24. #include "host/MainHostWindow.h"
  25. #include "host/InternalFilters.h"
  26. ApplicationCommandManager* commandManager = 0;
  27. //==============================================================================
  28. class PluginHostApp : public JUCEApplication
  29. {
  30. MainHostWindow* mainWindow;
  31. public:
  32. //==============================================================================
  33. PluginHostApp()
  34. : mainWindow (0)
  35. {
  36. }
  37. ~PluginHostApp()
  38. {
  39. }
  40. void initialise (const String& /*commandLine*/)
  41. {
  42. // initialise our settings file..
  43. ApplicationProperties::getInstance()
  44. ->setStorageParameters (T("Juce Audio Plugin Host"),
  45. T("settings"), String::empty, 1000,
  46. PropertiesFile::storeAsXML);
  47. commandManager = new ApplicationCommandManager();
  48. AudioPluginFormatManager::getInstance()->addDefaultFormats();
  49. AudioPluginFormatManager::getInstance()->addFormat (new InternalPluginFormat());
  50. mainWindow = new MainHostWindow();
  51. commandManager->registerAllCommandsForTarget (this);
  52. commandManager->registerAllCommandsForTarget (mainWindow);
  53. }
  54. void shutdown()
  55. {
  56. deleteAndZero (mainWindow);
  57. ApplicationProperties::getInstance()->closeFiles();
  58. deleteAndZero (commandManager);
  59. }
  60. const String getApplicationName()
  61. {
  62. return T("Juce Plug-In Host");
  63. }
  64. const String getApplicationVersion()
  65. {
  66. return T("0.9");
  67. }
  68. void systemRequestedQuit()
  69. {
  70. if (mainWindow->isValidComponent())
  71. mainWindow->tryToQuitApplication();
  72. else
  73. JUCEApplication::quit();
  74. }
  75. bool moreThanOneInstanceAllowed()
  76. {
  77. return true;
  78. }
  79. };
  80. // This kicks the whole thing off..
  81. START_JUCE_APPLICATION (PluginHostApp)