Also receive CC default value
This commit is contained in:
parent
2ede8fd710
commit
80eb73f4cb
3 changed files with 25 additions and 0 deletions
|
|
@ -156,6 +156,7 @@ struct Editor::Impl : EditorController::Receiver, IControlListener {
|
||||||
|
|
||||||
void updateCCUsed(unsigned cc, bool used);
|
void updateCCUsed(unsigned cc, bool used);
|
||||||
void updateCCValue(unsigned cc, float value);
|
void updateCCValue(unsigned cc, float value);
|
||||||
|
void updateCCDefaultValue(unsigned cc, float value);
|
||||||
void updateCCLabel(unsigned cc, const char* label);
|
void updateCCLabel(unsigned cc, const char* label);
|
||||||
|
|
||||||
// edition of CC by UI
|
// edition of CC by UI
|
||||||
|
|
@ -412,6 +413,8 @@ void Editor::Impl::uiReceiveMessage(const char* path, const char* sig, const sfi
|
||||||
char pathBuf[256];
|
char pathBuf[256];
|
||||||
sprintf(pathBuf, "/cc%u/value", cc);
|
sprintf(pathBuf, "/cc%u/value", cc);
|
||||||
sendQueuedOSC(pathBuf, "", nullptr);
|
sendQueuedOSC(pathBuf, "", nullptr);
|
||||||
|
sprintf(pathBuf, "/cc%u/default", cc);
|
||||||
|
sendQueuedOSC(pathBuf, "", nullptr);
|
||||||
sprintf(pathBuf, "/cc%u/label", cc);
|
sprintf(pathBuf, "/cc%u/label", cc);
|
||||||
sendQueuedOSC(pathBuf, "", nullptr);
|
sendQueuedOSC(pathBuf, "", nullptr);
|
||||||
}
|
}
|
||||||
|
|
@ -420,6 +423,9 @@ void Editor::Impl::uiReceiveMessage(const char* path, const char* sig, const sfi
|
||||||
else if (matchMessage("/cc&/value", path, indices) && !strcmp(sig, "f")) {
|
else if (matchMessage("/cc&/value", path, indices) && !strcmp(sig, "f")) {
|
||||||
updateCCValue(indices[0], args[0].f);
|
updateCCValue(indices[0], args[0].f);
|
||||||
}
|
}
|
||||||
|
else if (matchMessage("/cc&/default", path, indices) && !strcmp(sig, "f")) {
|
||||||
|
updateCCDefaultValue(indices[0], args[0].f);
|
||||||
|
}
|
||||||
else if (matchMessage("/cc&/label", path, indices) && !strcmp(sig, "s")) {
|
else if (matchMessage("/cc&/label", path, indices) && !strcmp(sig, "s")) {
|
||||||
updateCCLabel(indices[0], args[0].s);
|
updateCCLabel(indices[0], args[0].s);
|
||||||
}
|
}
|
||||||
|
|
@ -1203,6 +1209,12 @@ void Editor::Impl::updateCCValue(unsigned cc, float value)
|
||||||
panel->setControlValue(cc, value);
|
panel->setControlValue(cc, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Editor::Impl::updateCCDefaultValue(unsigned cc, float value)
|
||||||
|
{
|
||||||
|
if (SControlsPanel* panel = controlsPanel_)
|
||||||
|
panel->setControlDefaultValue(cc, value);
|
||||||
|
}
|
||||||
|
|
||||||
void Editor::Impl::updateCCLabel(unsigned cc, const char* label)
|
void Editor::Impl::updateCCLabel(unsigned cc, const char* label)
|
||||||
{
|
{
|
||||||
if (SControlsPanel* panel = controlsPanel_)
|
if (SControlsPanel* panel = controlsPanel_)
|
||||||
|
|
|
||||||
|
|
@ -603,6 +603,18 @@ void SControlsPanel::setControlValue(uint32_t index, float value)
|
||||||
slot->knob->setValue(value);
|
slot->knob->setValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SControlsPanel::setControlDefaultValue(uint32_t index, float value)
|
||||||
|
{
|
||||||
|
if (index >= slots_.size())
|
||||||
|
return;
|
||||||
|
|
||||||
|
ControlSlot* slot = slots_[index].get();
|
||||||
|
if (!slot)
|
||||||
|
return;
|
||||||
|
|
||||||
|
slot->knob->setDefaultValue(value);
|
||||||
|
}
|
||||||
|
|
||||||
void SControlsPanel::setControlLabelText(uint32_t index, UTF8StringPtr text)
|
void SControlsPanel::setControlLabelText(uint32_t index, UTF8StringPtr text)
|
||||||
{
|
{
|
||||||
if (index >= slots_.size())
|
if (index >= slots_.size())
|
||||||
|
|
|
||||||
|
|
@ -223,6 +223,7 @@ public:
|
||||||
|
|
||||||
void setControlUsed(uint32_t index, bool used);
|
void setControlUsed(uint32_t index, bool used);
|
||||||
void setControlValue(uint32_t index, float value);
|
void setControlValue(uint32_t index, float value);
|
||||||
|
void setControlDefaultValue(uint32_t index, float value);
|
||||||
void setControlLabelText(uint32_t index, UTF8StringPtr text);
|
void setControlLabelText(uint32_t index, UTF8StringPtr text);
|
||||||
|
|
||||||
std::function<void(uint32_t, float)> ValueChangeFunction;
|
std::function<void(uint32_t, float)> ValueChangeFunction;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue