Skip to content

Commit

Permalink
setModulatorValue: make "ui" flag working again, because MIDIbox pane…
Browse files Browse the repository at this point in the history
…ls rely on this to avoid feedback loops between LUA and (delayed) UI
  • Loading branch information
midibox committed Oct 19, 2023
1 parent 8aa00d8 commit 6e5a0b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Source/Core/CtrlrModulator/CtrlrModulatorProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void CtrlrModulatorProcessor::handleAsyncUpdate()
owner.setProperty (Ids::modulatorValue, currentValue.value);
}

if (valueChangedCbk.get() && !owner.getRestoreState())
if (valueChangedCbk.get() && !owner.getRestoreState() && currentValue.lastChangeSource != CtrlrModulatorValue::changedByProgram)
{
CtrlrPanel &ownerPanel = owner.getOwnerPanel();
if (!ownerPanel.getRestoreState() && !ownerPanel.getBootstrapState() && valueChangedCbk->isValid())
Expand Down
2 changes: 1 addition & 1 deletion Source/Lua/CtrlrLuaManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ void CtrlrModulator::setValueNonMapped (const int newValue, const bool force, co

void CtrlrModulator::setModulatorValue(const int newValue, bool vst, bool midi, bool ui)
{
processor.setValueGeneric (CtrlrModulatorValue (newValue, CtrlrModulatorValue::changedByLua), true, !midi);
processor.setValueGeneric (CtrlrModulatorValue (newValue, ui ? CtrlrModulatorValue::changedByProgram : CtrlrModulatorValue::changedByLua), true, !midi);
}

int CtrlrModulator::getValueMapped() const
Expand Down

1 comment on commit 6e5a0b2

@damiensellier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll implement it in CtrlrX v5.6.31

damiensellier#25

Please sign in to comment.