Skip to content

Commit

Permalink
Fix double-click reset mapping in release mode
Browse files Browse the repository at this point in the history
In Release Mode the double-click mapping for resetting a modulation
vecoted to Velocity still. Use the 'thisms' trick to look up the
alternate from my gui element.

Closes surge-synthesizer#1272
  • Loading branch information
baconpaul committed Nov 3, 2019
1 parent a667ba1 commit 1b2ebb3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/common/gui/SurgeGUIEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2157,10 +2157,15 @@ int32_t SurgeGUIEditor::controlModifierClicked(CControl* control, CButtonState b
{
if (synth->isValidModulation(ptag, modsource) && mod_editor)
{
synth->clearModulation(ptag, modsource);
((CSurgeSlider*)control)->setModValue(synth->getModulation(p->id, modsource));
CModulationSourceButton *cms = (CModulationSourceButton *)gui_modsrc[modsource];
auto thisms = modsource;
if( cms && cms->hasAlternate && cms->useAlternate )
thisms = (modsources)cms->alternateId;

synth->clearModulation(ptag, thisms);
((CSurgeSlider*)control)->setModValue(synth->getModulation(p->id, thisms));
((CSurgeSlider*)control)->setModPresent(synth->isModDestUsed(p->id));
((CSurgeSlider*)control)->setModCurrent(synth->isActiveModulation(p->id, modsource));
((CSurgeSlider*)control)->setModCurrent(synth->isActiveModulation(p->id, thisms));
// control->setGhostValue(p->get_value_f01());
oscdisplay->invalid();
return 1;
Expand Down

0 comments on commit 1b2ebb3

Please sign in to comment.