Skip to content

Commit

Permalink
Have editor only request value when CC is used
Browse files Browse the repository at this point in the history
  • Loading branch information
jpcima committed Apr 5, 2021
1 parent 68ee677 commit 4731bef
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions plugins/editor/src/editor/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,14 @@ void Editor::Impl::uiReceiveValue(EditId id, const EditValue& v)
updateCCValue(unsigned(ccForEditId(id)), v.to_float());
}
else if (editIdIsCCUsed(id)) {
updateCCUsed(ccUsedForEditId(id), v.to_float() != 0);
bool used = v.to_float() != 0;
updateCCUsed(ccUsedForEditId(id), used);
// TODO(jpc) remove value requests, when implementing CC automation
char pathBuf[256];
sprintf(pathBuf, "/cc%u/value", ccUsedForEditId(id));
sendQueuedOSC(pathBuf, "", nullptr);
if (used) {
char pathBuf[256];
sprintf(pathBuf, "/cc%u/value", ccUsedForEditId(id));
sendQueuedOSC(pathBuf, "", nullptr);
}
}
else if (editIdIsCCDefault(id)) {
updateCCDefaultValue(ccDefaultForEditId(id), v.to_float());
Expand Down

0 comments on commit 4731bef

Please sign in to comment.