From c8d8201abaed4507d717bb76a41a09d0af5bd830 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 9 Jul 2019 18:32:54 +0100 Subject: [PATCH] Use a GenericAudioProcessorEditor in the standalone wrapper if no editor is provided --- .../Standalone/juce_StandaloneFilterWindow.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h index 1c3522dddd..5ff726a7e7 100644 --- a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h +++ b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h @@ -730,7 +730,8 @@ private: public: MainContentComponent (StandaloneFilterWindow& filterWindow) : owner (filterWindow), notification (this), - editor (owner.getAudioProcessor()->createEditorIfNeeded()) + editor (owner.getAudioProcessor()->hasEditor() ? owner.getAudioProcessor()->createEditorIfNeeded() + : new GenericAudioProcessorEditor (*owner.getAudioProcessor())) { Value& inputMutedValue = owner.pluginHolder->getMuteInputValue(); @@ -770,7 +771,8 @@ private: if (shouldShowNotification) notification.setBounds (r.removeFromTop (NotificationArea::height)); - editor->setBounds (r); + if (editor != nullptr) + editor->setBounds (r); } private: @@ -830,9 +832,10 @@ private: #if JUCE_IOS || JUCE_ANDROID resized(); #else - setSize (editor->getWidth(), - editor->getHeight() - + (shouldShowNotification ? NotificationArea::height : 0)); + if (editor != nullptr) + setSize (editor->getWidth(), + editor->getHeight() + + (shouldShowNotification ? NotificationArea::height : 0)); #endif }