Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSC and LFO redraw on midi-cc slider move #1237

Merged
merged 1 commit into from
Oct 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/common/gui/COscillatorDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
2 changes: 2 additions & 0 deletions src/common/gui/COscillatorDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
26 changes: 12 additions & 14 deletions src/common/gui/SurgeGUIEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

}
}
}
Expand All @@ -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 )
Expand Down