Explicitly list opcodes that should return strings

The automatic detection works fine in every case I've tested other than
Fabfilter plugins, but this is probably for the best.
This commit is contained in:
Robbert van der Helm
2020-04-30 20:55:49 +02:00
parent 4f2058da7d
commit 6266072641
3 changed files with 26 additions and 8 deletions
+15
View File
@@ -241,6 +241,21 @@ class DispatchDataConverter : DefaultDataConverter {
break;
case effGetMidiKeyName:
return *static_cast<const VstMidiKeyName*>(data);
// Any VST host I've encountered has properly zeroed out these their
// string buffers, but we'll add a list of opcodes that should
// return a string just in case `DefaultDataConverter::read()` can't
// figure it out.
case effGetProgramName:
case effGetParamLabel:
case effGetParamDisplay:
case effGetParamName:
case effGetProgramNameIndexed:
case effGetEffectName:
case effGetVendorString:
case effGetProductString:
case effShellGetNextPlugin:
return WantsString{};
break;
default:
return DefaultDataConverter::read(opcode, index, value, data);
break;