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.

94 lines
3.0KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2017 - ROLI Ltd.
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. By using JUCE, you agree to the terms of both the JUCE 5 End-User License
  8. Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
  9. 27th April 2017).
  10. End User License Agreement: www.juce.com/juce-5-licence
  11. Privacy Policy: www.juce.com/juce-5-privacy-policy
  12. Or: You may also use this code under the terms of the GPL v3 (see
  13. www.gnu.org/licenses).
  14. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  15. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  16. DISCLAIMED.
  17. ==============================================================================
  18. */
  19. #include "JuceDemoHeader.h"
  20. #include "MainWindow.h"
  21. bool invokeChildProcessDemo (const String& commandLine);
  22. //==============================================================================
  23. class JuceDemoApplication : public JUCEApplication
  24. {
  25. public:
  26. JuceDemoApplication() {}
  27. //==============================================================================
  28. void initialise (const String& commandLine) override
  29. {
  30. // (This function call is for one of the demos, which involves launching a child process)
  31. if (invokeChildProcessDemo (commandLine))
  32. return;
  33. Desktop::getInstance().setOrientationsEnabled (Desktop::allOrientations);
  34. // Do your application's initialisation code here..
  35. mainWindow = new MainAppWindow();
  36. }
  37. void shutdown() override
  38. {
  39. // Do your application's shutdown code here..
  40. mainWindow = nullptr;
  41. }
  42. //==============================================================================
  43. void systemRequestedQuit() override
  44. {
  45. // This gets called when the OS wants our app to quit. You may want to
  46. // ask the user to save documents, close windows, etc here, but in this
  47. // case we'll just call quit(), which tells the message loop to stop and
  48. // allows the app to (asynchronously) exit.
  49. quit();
  50. }
  51. //==============================================================================
  52. const String getApplicationName() override
  53. {
  54. return "JuceDemo";
  55. }
  56. const String getApplicationVersion() override
  57. {
  58. return ProjectInfo::versionString;
  59. }
  60. bool moreThanOneInstanceAllowed() override
  61. {
  62. return true;
  63. }
  64. void anotherInstanceStarted (const String& /*commandLine*/) override
  65. {
  66. }
  67. private:
  68. ScopedPointer<MainAppWindow> mainWindow;
  69. };
  70. //==============================================================================
  71. // This macro generates the main() routine that starts the app.
  72. START_JUCE_APPLICATION(JuceDemoApplication)