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.

100 lines
3.2KB

  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,
  56. LookAndFeel::getDefaultLookAndFeel()
  57. .findColour (ResizableWindow::backgroundColourId),
  58. DocumentWindow::allButtons)
  59. {
  60. setUsingNativeTitleBar (true);
  61. setContentOwned (new MPETestClasses::MainComponent(), true);
  62. centreWithSize (getWidth(), getHeight());
  63. setVisible (true);
  64. }
  65. void closeButtonPressed() override
  66. {
  67. JUCEApplication::getInstance()->systemRequestedQuit();
  68. }
  69. private:
  70. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainWindow)
  71. };
  72. private:
  73. //==============================================================================
  74. ScopedPointer<MainWindow> mainWindow;
  75. };
  76. //==============================================================================
  77. START_JUCE_APPLICATION (MPETestApplication)