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.

97 lines
3.0KB

  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 "../JuceLibraryCode/JuceHeader.h"
  18. #include <array>
  19. struct MPETestClasses
  20. {
  21. #include "MPESetupComponent.h"
  22. #include "ZoneColourPicker.h"
  23. #include "ZoneLayoutComponent.h"
  24. #include "MPEDemoSynthVoice.h"
  25. #include "Visualiser.h"
  26. #include "MainComponent.h"
  27. };
  28. //==============================================================================
  29. class MPETestApplication : public JUCEApplication
  30. {
  31. public:
  32. //==============================================================================
  33. MPETestApplication() {}
  34. const String getApplicationName() override { return ProjectInfo::projectName; }
  35. const String getApplicationVersion() override { return ProjectInfo::versionString; }
  36. bool moreThanOneInstanceAllowed() override { return true; }
  37. //==============================================================================
  38. void initialise (const String&) override
  39. {
  40. mainWindow = new MainWindow (getApplicationName());
  41. }
  42. void shutdown() override
  43. {
  44. mainWindow = nullptr;
  45. }
  46. void systemRequestedQuit() override
  47. {
  48. quit();
  49. }
  50. //==============================================================================
  51. class MainWindow : public DocumentWindow
  52. {
  53. public:
  54. MainWindow (String name)
  55. : DocumentWindow (name, Colours::lightgrey, DocumentWindow::allButtons)
  56. {
  57. setUsingNativeTitleBar (true);
  58. setContentOwned (new MPETestClasses::MainComponent(), true);
  59. centreWithSize (getWidth(), getHeight());
  60. setVisible (true);
  61. }
  62. void closeButtonPressed() override
  63. {
  64. JUCEApplication::getInstance()->systemRequestedQuit();
  65. }
  66. private:
  67. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainWindow)
  68. };
  69. private:
  70. //==============================================================================
  71. ScopedPointer<MainWindow> mainWindow;
  72. };
  73. //==============================================================================
  74. START_JUCE_APPLICATION (MPETestApplication)