VST: properly query name from plugin
authorRobin Gareus <robin@gareus.org>
Tue, 27 May 2014 23:59:19 +0000 (01:59 +0200)
committerRobin Gareus <robin@gareus.org>
Tue, 27 May 2014 23:59:19 +0000 (01:59 +0200)
libs/ardour/vst_info_file.cc

index f74bdca771fbedccc0442324849a0d0bf92c3cc4..693bb6ba9e41afbc8d3d785a07e4c5d758b40160 100644 (file)
@@ -611,10 +611,22 @@ vstfx_parse_vst_state (VSTState* vstfx)
          string with any name*/
 
        char creator[65] = "Unknown\0";
+       char name[65] = "Unknown\0";
 
        AEffect* plugin = vstfx->plugin;
 
-       info->name = strdup (vstfx->handle->name);
+
+       plugin->dispatcher (plugin, effGetEffectName, 0, 0, name, 0);
+
+       if (strlen(name) == 0) {
+               plugin->dispatcher (plugin, effGetProductString, 0, 0, name, 0);
+       }
+
+       if (strlen(name) == 0) {
+               info->name = strdup (vstfx->handle->name);
+       } else {
+               info->name = strdup (name);
+       }
 
        /*If the plugin doesn't bother to implement GetVendorString we will
          have pre-stuffed the string with 'Unkown' */