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.

91 lines
2.9KB

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