Skip to content

Commit

Permalink
VST2 Channel Split Selection Corrected (#1486)
Browse files Browse the repository at this point in the history
The VST2 when setting a parameter sends automation which loops back
into the ::idle once more than the VST3 and AU do (and I think
improperly) but this meant that the scenemode override for mapping
hack was not applied properly. Fix that with further hacks. But they
are hacks you know.

Closes #1485
  • Loading branch information
baconpaul authored Jan 16, 2020
1 parent aa92f27 commit 8b5116e
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/common/gui/SurgeGUIEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ void SurgeGUIEditor::idle()
.modsources[ms_ctrl1 + i])
->get_target01());
}
else if((j < n_total_params) && nonmod_param[j])
else if((j>=0) && (j < n_total_params) && nonmod_param[j])
{
/*
** What the heck is this NONMOD_PARAM thing?
Expand All @@ -534,7 +534,19 @@ void SurgeGUIEditor::idle()
** can actually get them redrawing when an external param set occurs.
*/
CControl *cc = nonmod_param[ j ];

#if TARGET_VST2
/*
** This is a gross hack. The right thing is to have a remapper lambda on the control.
** But for now we have this. The VST2 calls back into here when you setvalue to (basically)
** double set value. But for the scenemod this means that the transformation doesn't occur
** so you get a dance. Since we don't really care if scenemode is automatable for now we just do
*/
if( synth->storage.getPatch().param_ptr[j]->ctrltype != ct_scenemode )
cc->setValue(synth->getParameter01(j));
#else
cc->setValue(synth->getParameter01(j));
#endif
cc->setDirty();
cc->invalid();
}
Expand Down Expand Up @@ -2435,7 +2447,7 @@ void SurgeGUIEditor::valueChanged(CControl* control)
if (!editor_open)
return;
long tag = control->getTag();

if ((tag >= tag_mod_source0) && (tag < tag_mod_source_end))
{
if (((CModulationSourceButton*)control)->event_is_drag)
Expand Down Expand Up @@ -2727,6 +2739,7 @@ void SurgeGUIEditor::valueChanged(CControl* control)
auto val = control->getValue();
if( p->ctrltype == ct_scenemode )
{

/*
** See the comment in the constructor of ct_scenemode above
*/
Expand Down Expand Up @@ -2763,7 +2776,7 @@ void SurgeGUIEditor::valueChanged(CControl* control)

}
}
// synth->storage.getPatch().param_ptr[ptag]->set_value_f01(val);

bool force_integer = frame->getCurrentMouseButtons() & kControl;
if (synth->setParameter01(ptag, val, false, force_integer))
{
Expand Down

0 comments on commit 8b5116e

Please sign in to comment.