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.

54 lines
1.9KB

  1. #include "../JuceLibraryCode/JuceHeader.h"
  2. #include "MainComponent.h"
  3. //==============================================================================
  4. class BlocksSynthApplication : public JUCEApplication
  5. {
  6. public:
  7. //==============================================================================
  8. BlocksSynthApplication() {}
  9. const String getApplicationName() override { return ProjectInfo::projectName; }
  10. const String getApplicationVersion() override { return ProjectInfo::versionString; }
  11. //==============================================================================
  12. void initialise (const String& /*commandLine*/) override { mainWindow = new MainWindow (getApplicationName()); }
  13. void shutdown() override { mainWindow = nullptr; }
  14. //==============================================================================
  15. struct MainWindow : public DocumentWindow
  16. {
  17. MainWindow (String name) : DocumentWindow (name,
  18. Colours::lightgrey,
  19. DocumentWindow::allButtons)
  20. {
  21. setUsingNativeTitleBar (true);
  22. setContentOwned (new MainComponent(), true);
  23. centreWithSize (getWidth(), getHeight());
  24. setResizable (true, true);
  25. setVisible (true);
  26. #if JUCE_IOS
  27. setFullScreen (true);
  28. #endif
  29. }
  30. void closeButtonPressed() override
  31. {
  32. JUCEApplication::getInstance()->systemRequestedQuit();
  33. }
  34. TooltipWindow tooltipWindow;
  35. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainWindow)
  36. };
  37. private:
  38. ScopedPointer<MainWindow> mainWindow;
  39. };
  40. //==============================================================================
  41. START_JUCE_APPLICATION (BlocksSynthApplication)