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.

92 lines
3.1KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-11 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. #include "JuceDemoHeader.h"
  19. #include "MainWindow.h"
  20. bool invokeChildProcessDemo (const String& commandLine);
  21. //==============================================================================
  22. class JuceDemoApplication : public JUCEApplication
  23. {
  24. public:
  25. JuceDemoApplication() {}
  26. //==============================================================================
  27. void initialise (const String& commandLine) override
  28. {
  29. if (invokeChildProcessDemo (commandLine))
  30. return;
  31. Desktop::getInstance().setOrientationsEnabled (Desktop::allOrientations);
  32. // Do your application's initialisation code here..
  33. mainWindow = new MainAppWindow();
  34. }
  35. void shutdown() override
  36. {
  37. // Do your application's shutdown code here..
  38. mainWindow = nullptr;
  39. }
  40. //==============================================================================
  41. void systemRequestedQuit() override
  42. {
  43. // This gets called when the OS wants our app to quit. You may want to
  44. // ask the user to save documents, close windows, etc here, but in this
  45. // case we'll just call quit(), which tells the message loop to stop and
  46. // allows the app to (asynchronously) exit.
  47. quit();
  48. }
  49. //==============================================================================
  50. const String getApplicationName() override
  51. {
  52. return "JuceDemo";
  53. }
  54. const String getApplicationVersion() override
  55. {
  56. return ProjectInfo::versionString;
  57. }
  58. bool moreThanOneInstanceAllowed() override
  59. {
  60. return true;
  61. }
  62. void anotherInstanceStarted (const String& /*commandLine*/) override
  63. {
  64. }
  65. private:
  66. ScopedPointer<MainAppWindow> mainWindow;
  67. };
  68. //==============================================================================
  69. // This macro generates the main() routine that starts the app.
  70. START_JUCE_APPLICATION(JuceDemoApplication)