Handle description data in editor

This commit is contained in:
Jean Pierre Cimalando 2021-04-02 18:50:58 +02:00
parent 5e06aba595
commit 39c6df0719

View file

@ -200,6 +200,7 @@ struct Editor::Impl : EditorController::Receiver, IControlListener {
void updateKeyswitchNameLabel();
void updateKeyUsed(unsigned key, bool used);
void updateKeyLabel(unsigned key, const char* label);
void updateKeyswitchUsed(unsigned key, bool used);
void updateCCUsed(unsigned cc, bool used);
void updateCCValue(unsigned cc, float value);
@ -461,6 +462,27 @@ void Editor::Impl::uiReceiveValue(EditId id, const EditValue& v)
if (SPiano* piano = piano_)
piano->setKeyValue(key, value);
}
else if (editIdIsKeyUsed(id)) {
updateKeyUsed(keyUsedForEditId(id), v.to_float() != 0);
}
else if (editIdIsKeyLabel(id)) {
updateKeyLabel(keyLabelForEditId(id), v.to_string().c_str());
}
else if (editIdIsKeyswitchUsed(id)) {
updateKeyswitchUsed(keyswitchUsedForEditId(id), v.to_float() != 0);
}
else if (editIdIsKeyswitchLabel(id)) {
updateSWLastLabel(keyswitchLabelForEditId(id), v.to_string().c_str());
}
else if (editIdIsCCUsed(id)) {
updateCCUsed(ccUsedForEditId(id), v.to_float() != 0);
}
else if (editIdIsCCDefault(id)) {
updateCCDefaultValue(ccDefaultForEditId(id), v.to_float());
}
else if (editIdIsCCLabel(id)) {
updateCCLabel(ccLabelForEditId(id), v.to_string().c_str());
}
break;
}
}
@ -1519,6 +1541,13 @@ void Editor::Impl::updateKeyUsed(unsigned key, bool used)
piano->setKeyUsed(key, used);
}
void Editor::Impl::updateKeyLabel(unsigned key, const char* label)
{
// TODO nothing done with this info currently
(void)key;
(void)label;
}
void Editor::Impl::updateKeyswitchUsed(unsigned key, bool used)
{
if (SPiano* piano = piano_)