From 7c0c5ae32559f12afa9ea7a1f2ad048a287ef845 Mon Sep 17 00:00:00 2001 From: xenakios Date: Tue, 13 Nov 2018 23:03:18 +0200 Subject: [PATCH] The separate callback class wasn't needed... --- Source/PluginEditor.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index e510c9c..bf0baac 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -21,18 +21,10 @@ www.gnu.org/licenses #include #include "RenderSettingsComponent.h" -class MyPopmenuCallback : public ModalComponentManager::Callback +static void handleSettingsMenuModalCallback(int choice, PaulstretchpluginAudioProcessorEditor* ed) { -public: - MyPopmenuCallback(PaulstretchpluginAudioProcessorEditor* owner) : m_owner(owner) {} - void modalStateFinished(int returnValue) override - { - jassert(m_owner != nullptr); - m_owner->executeModalMenuAction(0, returnValue); - } - PaulstretchpluginAudioProcessorEditor* m_owner = nullptr; -}; - + ed->executeModalMenuAction(0,choice); +} //============================================================================== PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(PaulstretchpluginAudioProcessor& p) @@ -580,7 +572,8 @@ void PaulstretchpluginAudioProcessorEditor::showSettingsMenu() m_settings_menu.addItem(6, "Dump preset to clipboard", true, false); #endif m_settings_menu.addItem(7, "Show technical info", true, processor.m_show_technical_info); - m_settings_menu.showMenuAsync(PopupMenu::Options(), new MyPopmenuCallback(this)); + m_settings_menu.showMenuAsync(PopupMenu::Options(), + ModalCallbackFunction::forComponent(handleSettingsMenuModalCallback, this)); } void PaulstretchpluginAudioProcessorEditor::showAbout()