Display unit-label of VST parameters -- #7938
This commit is contained in:
parent
8fe3c367cf
commit
eeb2e99a3b
@ -3037,10 +3037,10 @@ PluginInsert::PluginControl::get_user_string () const
|
|||||||
{
|
{
|
||||||
boost::shared_ptr<Plugin> plugin = _plugin->plugin (0);
|
boost::shared_ptr<Plugin> plugin = _plugin->plugin (0);
|
||||||
if (plugin) {
|
if (plugin) {
|
||||||
char buf[32];
|
char buf[64];
|
||||||
if (plugin->print_parameter (parameter().id(), buf, sizeof(buf))) {
|
if (plugin->print_parameter (parameter().id(), buf, sizeof(buf))) {
|
||||||
assert (strlen (buf) > 0);
|
assert (strlen (buf) > 0);
|
||||||
return std::string (buf) + " (" + AutomationControl::get_user_string () + ")";
|
return std::string (buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return AutomationControl::get_user_string ();
|
return AutomationControl::get_user_string ();
|
||||||
|
@ -406,13 +406,13 @@ VSTPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& desc)
|
|||||||
|
|
||||||
/* old style */
|
/* old style */
|
||||||
|
|
||||||
char label[VestigeMaxLabelLen];
|
char pname[VestigeMaxLabelLen];
|
||||||
/* some VST plugins expect this buffer to be zero-filled */
|
/* some VST plugins expect this buffer to be zero-filled */
|
||||||
memset (label, 0, sizeof (label));
|
memset (pname, 0, sizeof (pname));
|
||||||
|
|
||||||
_plugin->dispatcher (_plugin, effGetParamName, which, 0, label, 0);
|
_plugin->dispatcher (_plugin, effGetParamName, which, 0, pname, 0);
|
||||||
|
|
||||||
desc.label = Glib::locale_to_utf8 (label);
|
desc.label = Glib::locale_to_utf8 (pname);
|
||||||
desc.lower = 0.0f;
|
desc.lower = 0.0f;
|
||||||
desc.upper = 1.0f;
|
desc.upper = 1.0f;
|
||||||
desc.smallstep = desc.step = 1.f / 300.f;
|
desc.smallstep = desc.step = 1.f / 300.f;
|
||||||
@ -834,6 +834,17 @@ VSTPlugin::print_parameter (uint32_t param, char *buf, uint32_t len) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
memmove (buf, first_nonws, strlen (buf) - (first_nonws - buf) + 1);
|
memmove (buf, first_nonws, strlen (buf) - (first_nonws - buf) + 1);
|
||||||
|
|
||||||
|
/* optional Unit label */
|
||||||
|
char label[VestigeMaxNameLen];
|
||||||
|
memset (label, 0, sizeof (label));
|
||||||
|
_plugin->dispatcher (_plugin, 6 /* effGetParamLabel */, param, 0, label, 0);
|
||||||
|
|
||||||
|
if (strlen (label) > 0) {
|
||||||
|
std::string lbl = std::string (" ") + Glib::locale_to_utf8 (label);
|
||||||
|
strncat (buf, lbl.c_str(), strlen (buf) - 1);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user