diff --git a/src/common/gui/COscillatorDisplay.cpp b/src/common/gui/COscillatorDisplay.cpp index 3ab67be32e6..fed5bb879b5 100644 --- a/src/common/gui/COscillatorDisplay.cpp +++ b/src/common/gui/COscillatorDisplay.cpp @@ -818,3 +818,21 @@ CMouseEventResult COscillatorDisplay::onMouseMoved(CPoint& where, const CButtonS } return kMouseEventHandled; } + +void COscillatorDisplay::invalidateIfIdIsInRange(int id) +{ + auto *currOsc = &oscdata->type; + auto *endOsc = &oscdata->retrigger; + bool oscInvalid = false; + while( currOsc <= endOsc && ! oscInvalid ) + { + if( currOsc->id == id ) + oscInvalid = true; + currOsc++; + } + + if( oscInvalid ) + { + invalid(); + } +} diff --git a/src/common/gui/COscillatorDisplay.h b/src/common/gui/COscillatorDisplay.h index d510dc5a832..b2e6146e391 100644 --- a/src/common/gui/COscillatorDisplay.h +++ b/src/common/gui/COscillatorDisplay.h @@ -99,6 +99,8 @@ class COscillatorDisplay : public VSTGUI::CControl, public VSTGUI::IDropTarget virtual VSTGUI::CMouseEventResult onMouseUp(VSTGUI::CPoint& where, const VSTGUI::CButtonState& buttons); virtual VSTGUI::CMouseEventResult onMouseMoved(VSTGUI::CPoint& where, const VSTGUI::CButtonState& buttons); + void invalidateIfIdIsInRange(int id); + #if OSC_MOD_ANIMATION void setIsMod(bool b) { diff --git a/src/common/gui/SurgeGUIEditor.cpp b/src/common/gui/SurgeGUIEditor.cpp index 057153074f0..904f35ed970 100644 --- a/src/common/gui/SurgeGUIEditor.cpp +++ b/src/common/gui/SurgeGUIEditor.cpp @@ -428,6 +428,17 @@ void SurgeGUIEditor::idle() param[j]->setValue(synth->refresh_ctrl_queue_value[i]); frame->invalidRect(param[j]->getViewSize()); // oscdisplay->invalid(); + + if( oscdisplay ) + { + ((COscillatorDisplay*)oscdisplay)->invalidateIfIdIsInRange(j); + } + + if( lfodisplay ) + { + ((CLFOGui*)lfodisplay)->invalidateIfIdIsInRange(j); + } + } } } @@ -441,23 +452,10 @@ void SurgeGUIEditor::idle() { param[j]->setValue(synth->getParameter01(j)); frame->invalidRect(param[j]->getViewSize()); - auto *currOsc = &synth->storage.getPatch().scene[current_scene].osc[current_osc].type; - auto *endOsc = &synth->storage.getPatch().scene[current_scene].osc[current_osc].retrigger; - bool oscInvalid = false, lfoInvalid = false; if( oscdisplay ) { - while( currOsc <= endOsc && ! oscInvalid ) - { - if( currOsc->id == j ) - oscInvalid = true; - currOsc++; - } - - if( oscInvalid ) - { - oscdisplay->invalid(); - } + ((COscillatorDisplay*)oscdisplay)->invalidateIfIdIsInRange(j); } if( lfodisplay )