Browse Source

AUv3 Wrapper: use view callbacks to show and hide editor

tags/2021-05-28
Dimitri Sudell hogliux 8 years ago
parent
commit
a15209b45f
1 changed files with 17 additions and 1 deletions
  1. +17
    -1
      modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm

+ 17
- 1
modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm View File

@@ -1670,7 +1670,7 @@ public:
JUCE_IOS_MAC_VIEW* view = [[[JUCE_IOS_MAC_VIEW alloc] initWithFrame: convertToCGRect (editor->getBounds())] autorelease];
[myself setView: view];
editor->setVisible (true);
editor->setVisible (false);
editor->addToDesktop (0, view);
}
}
@@ -1707,6 +1707,20 @@ public:
processor->memoryWarningReceived();
}
void viewDidAppear (bool)
{
if (processorHolder != nullptr)
if (AudioProcessorEditor* editor = getAudioProcessor().getActiveEditor())
editor->setVisible (true);
}
void viewDidDisappear (bool)
{
if (processorHolder != nullptr)
if (AudioProcessorEditor* editor = getAudioProcessor().getActiveEditor())
editor->setVisible (false);
}
CGSize getPreferredContentSize() const
{
return CGSizeMake (static_cast<float> (preferredSize.getWidth()),
@@ -1793,6 +1807,8 @@ private:
- (CGSize) preferredContentSize { return cpp->getPreferredContentSize(); }
- (void) viewDidLayoutSubviews { cpp->viewDidLayoutSubviews(); }
- (void) didReceiveMemoryWarning { cpp->didReceiveMemoryWarning(); }
- (void) viewDidAppear: (BOOL) animated { cpp->viewDidAppear (animated); [super viewDidAppear:animated]; }
- (void) viewDidDisappear: (BOOL) animated { cpp->viewDidDisappear (animated); [super viewDidDisappear:animated]; }
@end
//==============================================================================


Loading…
Cancel
Save