Honor effFlagsIsSynth and always assume those VSTs are instruments
authorRobin Gareus <robin@gareus.org>
Wed, 7 Nov 2018 20:37:59 +0000 (21:37 +0100)
committerRobin Gareus <robin@gareus.org>
Wed, 7 Nov 2018 20:39:52 +0000 (21:39 +0100)
This will incorrectly list some vocders or reaktor and the likes of
plugins with audio + midi input as Instruments IFF they also announce
effFlagsIsSynth flag.

NB. this is a first step only. we still need to override PluginInfo

libs/ardour/vst_info_file.cc

index a978f4e7d33435fc96cd5708fda2b63986f30180..d6d946dee6a901e17645622fe13c54cc1f2e6004 100644 (file)
@@ -312,10 +312,11 @@ vstfx_load_info_block (FILE* fp, VSTInfo *info)
                info->wantMidi = 1;
        }
 
-       // TODO read isInstrument -- effFlagsIsSynth
-       info->isInstrument = info->numInputs == 0 && info->numOutputs > 0 && 1 == (info->wantMidi & 1);
+       info->isInstrument = (info->wantMidi & 4) ? 1 : 0;
+
+       info->isInstrument |= info->numInputs == 0 && info->numOutputs > 0 && 1 == (info->wantMidi & 1);
        if (!strcmp (info->Category, "Instrument")) {
-               info->isInstrument = true;
+               info->isInstrument = 1;
        }
 
        if ((info->numParams) == 0) {
@@ -396,10 +397,9 @@ vstfx_write_info_block (FILE* fp, VSTInfo *info)
        fprintf (fp, "%d\n", info->numInputs);
        fprintf (fp, "%d\n", info->numOutputs);
        fprintf (fp, "%d\n", info->numParams);
-       fprintf (fp, "%d\n", info->wantMidi);
+       fprintf (fp, "%d\n", info->wantMidi | (info->isInstrument ? 4 : 0));
        fprintf (fp, "%d\n", info->hasEditor);
        fprintf (fp, "%d\n", info->canProcessReplacing);
-       // TODO write isInstrument in a backwards compat way
 
        for (int i = 0; i < info->numParams; i++) {
                fprintf (fp, "%s\n", info->ParamNames[i]);