Skip to content

Commit

Permalink
Undo on TypeIn and Mod TypeIn (surge-synthesizer#7435)
Browse files Browse the repository at this point in the history
Amazingly, we didn't push an undo on param set via typein
or param mod set via typein. How did we not find this for so
long!

Closes surge-synthesizer#7433
  • Loading branch information
baconpaul authored Jan 12, 2024
1 parent 459f8c0 commit 29bf1fe
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/surge-xt/gui/SurgeGUIEditorValueCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4100,8 +4100,16 @@ bool SurgeGUIEditor::setParameterFromString(Parameter *p, const std::string &s,
{
auto v = p->get_value_f01();

if (p && p->set_value_from_string(s, errMsg))
if (p)
{
undoManager()->pushParameterChange(p->id, p, p->val);
auto res = p->set_value_from_string(s, errMsg);

if (!res)
{
return false;
}

if (v != p->get_value_f01())
synth->storage.getPatch().isDirty = true;
repushAutomationFor(p);
Expand All @@ -4127,6 +4135,10 @@ bool SurgeGUIEditor::setParameterModulationFromString(Parameter *p, modsources m
}
else
{
undoManager()->pushModulationChange(
p->id, p, ms, modsourceScene, modidx,
synth->getModDepth01(p->id, ms, modsourceScene, modidx),
synth->isModulationMuted(p->id, ms, modsourceScene, modidx));
synth->setModDepth01(p->id, ms, modsourceScene, modidx, mv);
synth->refresh_editor = true;
synth->storage.getPatch().isDirty = true;
Expand Down

0 comments on commit 29bf1fe

Please sign in to comment.