Merge pull request #880 from jpcima/vst-keyswitch-controller
Dynamic VST parameter titles
This commit is contained in:
commit
367b28d29e
1 changed files with 23 additions and 2 deletions
|
|
@ -349,11 +349,32 @@ tresult SfizzVstControllerNoUi::notify(Vst::IMessage* message)
|
|||
keyswitches_[idKeyswitch++] = info;
|
||||
}
|
||||
|
||||
Vst::IComponentHandler* componentHandler = getComponentHandler();
|
||||
if (componentHandler)
|
||||
if (Vst::IComponentHandler* componentHandler = getComponentHandler())
|
||||
// NOTE(jpc) I think that's the right one, but it needs confirmation
|
||||
componentHandler->restartComponent(Vst::kNoteExpressionChanged);
|
||||
|
||||
// update the parameter titles and notify
|
||||
for (uint32 cc = 0; cc < sfz::config::numCCs; ++cc) {
|
||||
Vst::ParamID pid = kPidCC0 + cc;
|
||||
Vst::Parameter* param = getParameterObject(pid);
|
||||
Vst::ParameterInfo& info = param->getInfo();
|
||||
Steinberg::String title;
|
||||
Steinberg::String shortTitle;
|
||||
if (!desc.ccLabel[cc].empty()) {
|
||||
title = desc.ccLabel[cc].c_str();
|
||||
shortTitle = title;
|
||||
}
|
||||
else {
|
||||
title.printf("Controller %u", cc);
|
||||
shortTitle.printf("CC%u", cc);
|
||||
}
|
||||
title.copyTo(info.title);
|
||||
shortTitle.copyTo(info.shortTitle);
|
||||
}
|
||||
|
||||
if (Vst::IComponentHandler* componentHandler = getComponentHandler())
|
||||
componentHandler->restartComponent(Vst::kParamTitlesChanged);
|
||||
|
||||
//
|
||||
sfzDescriptionUpdate_->deferUpdate();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue