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.

59 lines
1.8KB

  1. /*
  2. ==============================================================================
  3. This file was auto-generated by the Jucer!
  4. It contains the basic startup code for a Juce application.
  5. ==============================================================================
  6. */
  7. #include "PluginProcessor.h"
  8. #include "PluginEditor.h"
  9. //==============================================================================
  10. JuceDemoHostAudioProcessorEditor::JuceDemoHostAudioProcessorEditor (JuceDemoHostAudioProcessor& owner)
  11. : AudioProcessorEditor (owner)
  12. {
  13. addAndMakeVisible (window = new MainHostWindow (owner.formatManager, owner.graph, *owner.appProperties));
  14. addAndMakeVisible (menu = new MenuBarComponent (window));
  15. addAndMakeVisible (resizer = new ResizableCornerComponent (this, &resizeLimits));
  16. resizeLimits.setSizeLimits (500, 400, 10000, 10000);
  17. {
  18. const ScopedLock csl(owner.midiKeyMutex);
  19. owner.midiKeyState = window->getMidiState();
  20. }
  21. setSize (800, 600);
  22. }
  23. JuceDemoHostAudioProcessorEditor::~JuceDemoHostAudioProcessorEditor()
  24. {
  25. JuceDemoHostAudioProcessor& owner(getProcessor());
  26. {
  27. const ScopedLock csl(owner.midiKeyMutex);
  28. owner.midiKeyState = nullptr;
  29. }
  30. menu->setModel (nullptr);
  31. }
  32. //==============================================================================
  33. void JuceDemoHostAudioProcessorEditor::paint (Graphics& g)
  34. {
  35. g.setGradientFill (ColourGradient (Colours::white, 0, 0,
  36. Colours::grey, 0, (float) getHeight(), false));
  37. g.fillAll();
  38. }
  39. void JuceDemoHostAudioProcessorEditor::resized()
  40. {
  41. menu->setBounds (0, 0, getWidth(), 24);
  42. window->setBounds (0, 24, getWidth(), getHeight()-24);
  43. resizer->setBounds (getWidth() - 16, getHeight() - 16, 16, 16);
  44. }