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.8KB

  1. /*
  2. ==============================================================================
  3. This file was auto-generated by the Projucer!
  4. It contains the basic startup code for a Juce application.
  5. ==============================================================================
  6. */
  7. #include "../JuceLibraryCode/JuceHeader.h"
  8. Component* createMainContentComponent();
  9. //==============================================================================
  10. class WavetableBouncingEditorAppExampleApplication : public JUCEApplication
  11. {
  12. public:
  13. //==============================================================================
  14. WavetableBouncingEditorAppExampleApplication() {}
  15. const String getApplicationName() override { return ProjectInfo::projectName; }
  16. const String getApplicationVersion() override { return ProjectInfo::versionString; }
  17. bool moreThanOneInstanceAllowed() override { return true; }
  18. //==============================================================================
  19. void initialise (const String& /*commandLine*/) override
  20. {
  21. mainWindow = new MainWindow (getApplicationName());
  22. }
  23. void shutdown() override
  24. {
  25. mainWindow = nullptr; // (deletes our window)
  26. }
  27. //==============================================================================
  28. void systemRequestedQuit() override
  29. {
  30. // This is called when the app is being asked to quit: you can ignore this
  31. // request and let the app carry on running, or call quit() to allow the app to close.
  32. quit();
  33. }
  34. void anotherInstanceStarted (const String& /*commandLine*/) override
  35. {
  36. // When another instance of the app is launched while this one is running,
  37. // this method is invoked, and the commandLine parameter tells you what
  38. // the other instance's command-line arguments were.
  39. }
  40. //==============================================================================
  41. /*
  42. This class implements the desktop window that contains an instance of
  43. our MainContentComponent class.
  44. */
  45. class MainWindow : public DocumentWindow
  46. {
  47. public:
  48. MainWindow (const String& name)
  49. : DocumentWindow (name, Colours::lightgrey, DocumentWindow::allButtons)
  50. {
  51. setUsingNativeTitleBar (true);
  52. setContentOwned (createMainContentComponent(), true);
  53. setResizable (true, true);
  54. centreWithSize (getWidth(), getHeight());
  55. setVisible (true);
  56. }
  57. void closeButtonPressed() override
  58. {
  59. // This is called when the user tries to close this window. Here, we'll just
  60. // ask the app to quit when this happens, but you can change this to do
  61. // whatever you need.
  62. JUCEApplication::getInstance()->systemRequestedQuit();
  63. }
  64. /* Note: Be careful if you override any DocumentWindow methods - the base
  65. class uses a lot of them, so by overriding you might break its functionality.
  66. It's best to do all your work in your content component instead, but if
  67. you really have to override any DocumentWindow methods, make sure your
  68. subclass also calls the superclass's method.
  69. */
  70. private:
  71. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainWindow)
  72. };
  73. private:
  74. ScopedPointer<MainWindow> mainWindow;
  75. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WavetableBouncingEditorAppExampleApplication)
  76. };
  77. //==============================================================================
  78. // This macro generates the main() routine that launches the app.
  79. START_JUCE_APPLICATION (WavetableBouncingEditorAppExampleApplication)