Bump VST param-name length limit to 128 bytes and centralize definition
authorRobin Gareus <robin@gareus.org>
Tue, 9 May 2017 19:58:50 +0000 (21:58 +0200)
committerRobin Gareus <robin@gareus.org>
Tue, 9 May 2017 22:26:02 +0000 (00:26 +0200)
The official VST spec says 8 bytes, JUCE uses 24 + 1, and there's
anecdotal evidence that some VSTs use up to 100 (which apparently works
in many hosts).

libs/ardour/ardour/vestige/aeffectx.h
libs/ardour/vst_info_file.cc
libs/ardour/vst_plugin.cc

index 25be89b09ae5a61846f82b09f39ab554fe9cd168..a9a168ed1db9f084903b6eb96b5dd83687a0397b 100644 (file)
@@ -204,7 +204,7 @@ struct _VstEvents
 enum Vestige2StringConstants
 {
        VestigeMaxNameLen       = 64,
-       VestigeMaxLabelLen      = 64,
+       VestigeMaxLabelLen      = 128,
        VestigeMaxShortLabelLen = 8,
        VestigeMaxCategLabelLen = 24,
        VestigeMaxFileNameLen   = 100
index 77be57e8d8caf7db26842fc056c9db8ba4b1f1f3..b076c422270556c957924b60ec78bfda458daac0 100644 (file)
@@ -682,8 +682,8 @@ vstfx_parse_vst_state (VSTState* vstfx)
 #endif
 
        for (int i = 0; i < info->numParams; ++i) {
-               char name[64];
-               char label[64];
+               char name[VestigeMaxLabelLen];
+               char label[VestigeMaxLabelLen];
 
                /* Not all plugins give parameters labels as well as names */
 
index 6b1f0b325441edd550b569aef03b0a36affd66d2..bf7637109d34ab3304b4612a7be098a994a14df3 100644 (file)
@@ -379,7 +379,7 @@ VSTPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& desc)
 
                /* old style */
 
-               char label[64];
+               char label[VestigeMaxLabelLen];
                /* some VST plugins expect this buffer to be zero-filled */
                memset (label, 0, sizeof (label));
 
@@ -593,7 +593,7 @@ VSTPlugin::do_remove_preset (string name)
 string
 VSTPlugin::describe_parameter (Evoral::Parameter param)
 {
-       char name[64];
+       char name[VestigeMaxLabelLen];
        if (param.id() == UINT32_MAX - 1) {
                strcpy (name, _("Plugin Enable"));
                return name;