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.

99 lines
3.1KB

  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.reset();
  41. }
  42. void backButtonPressed() override
  43. {
  44. MainAppWindow::getSharedSidePanel().showOrHide (false);
  45. }
  46. //==============================================================================
  47. void systemRequestedQuit() override
  48. {
  49. // This gets called when the OS wants our app to quit. You may want to
  50. // ask the user to save documents, close windows, etc here, but in this
  51. // case we'll just call quit(), which tells the message loop to stop and
  52. // allows the app to (asynchronously) exit.
  53. quit();
  54. }
  55. //==============================================================================
  56. const String getApplicationName() override
  57. {
  58. return "JuceDemo";
  59. }
  60. const String getApplicationVersion() override
  61. {
  62. return ProjectInfo::versionString;
  63. }
  64. bool moreThanOneInstanceAllowed() override
  65. {
  66. return true;
  67. }
  68. void anotherInstanceStarted (const String& /*commandLine*/) override
  69. {
  70. }
  71. private:
  72. ScopedPointer<MainAppWindow> mainWindow;
  73. };
  74. //==============================================================================
  75. // This macro generates the main() routine that starts the app.
  76. START_JUCE_APPLICATION(JuceDemoApplication)