diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-05-02 20:29:03 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-05-02 20:29:03 -0400 |
commit | 12d4c510232d2f37e8ab5897c2de7badc2b8fac8 (patch) | |
tree | 43e73cf8122b5fa2ca92217a1a4c49cef5407674 /libs/ardour/vst_plugin.cc | |
parent | 80d714a34f9efbb494d69cb9a88270cd5e251744 (diff) |
forward port VST parameter name fix from mixbus: some/many VST plugins expect the buffer passed to them to be zero-filled, not just null-at-start. without this they can return garbage strings for parameter names
Diffstat (limited to 'libs/ardour/vst_plugin.cc')
-rw-r--r-- | libs/ardour/vst_plugin.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc index 3885bc2a1c..c385e71a5a 100644 --- a/libs/ardour/vst_plugin.cc +++ b/libs/ardour/vst_plugin.cc @@ -295,10 +295,11 @@ VSTPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& desc) /* old style */ char label[64]; - label[0] = '\0'; + /* some VST plugins expect this buffer to be zero-filled */ + memset (label, sizeof (label), 0); _plugin->dispatcher (_plugin, effGetParamName, which, 0, label, 0); - + desc.label = label; desc.integer_step = false; desc.lower = 0.0f; @@ -482,8 +483,17 @@ VSTPlugin::do_remove_preset (string name) string VSTPlugin::describe_parameter (Evoral::Parameter param) { - char name[64] = "Unkown"; + char name[64]; + memset (name, sizeof (name), 0); + + /* some VST plugins expect this buffer to be zero-filled */ + _plugin->dispatcher (_plugin, effGetParamName, param.id(), 0, name, 0); + + if (name[0] == '\0') { + strcpy (name, _("Unknown")); + } + return name; } |