From d396a29c0695114580190910589df58a874f4437 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Thu, 2 Sep 2010 17:19:52 +0200 Subject: [PATCH] ZynAddSubFX: only re-instantiate ZASF if m_hasGUI has changed Do not re-instantiate ZynAddSubFX if m_hasGUI is different from the value of the according push button. (cherry picked from commit f05c510f4d61494f309edaf8f93dd373bb2ab9cd) --- plugins/zynaddsubfx/ZynAddSubFx.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/plugins/zynaddsubfx/ZynAddSubFx.cpp b/plugins/zynaddsubfx/ZynAddSubFx.cpp index 200a202ff..c11300fd5 100644 --- a/plugins/zynaddsubfx/ZynAddSubFx.cpp +++ b/plugins/zynaddsubfx/ZynAddSubFx.cpp @@ -601,7 +601,7 @@ void ZynAddSubFxView::modelChanged() m_forwardMidiCC->setModel( &m->m_forwardMidiCcModel ); - toggleUI(); + m_toggleUIButton->setChecked( m->m_hasGUI ); } @@ -610,13 +610,16 @@ void ZynAddSubFxView::modelChanged() void ZynAddSubFxView::toggleUI() { ZynAddSubFxInstrument * model = castModel(); - model->m_hasGUI = m_toggleUIButton->isChecked(); - model->reloadPlugin(); - - if( model->m_remotePlugin ) + if( model->m_hasGUI != m_toggleUIButton->isChecked() ) { - connect( model->m_remotePlugin, SIGNAL( clickedCloseButton() ), - m_toggleUIButton, SLOT( toggle() ) ); + model->m_hasGUI = m_toggleUIButton->isChecked(); + model->reloadPlugin(); + + if( model->m_remotePlugin ) + { + connect( model->m_remotePlugin, SIGNAL( clickedCloseButton() ), + m_toggleUIButton, SLOT( toggle() ) ); + } } }