Revert "case insensitive ".dll" for VST plugins - fixes #6285"
[ardour.git] / libs / ardour / vst_info_file.cc
index 3cfbad1297efe868f3538ab8d9ab0d9bbc58c25b..2d68421103d0d14930f8ff9d5925ba333d39540f 100644 (file)
@@ -97,6 +97,7 @@ vstfx_cache_file (const char* dllpath, int personal, const char *ext)
        string dir;
        if (personal) {
                dir = get_personal_vst_info_cache_dir();
+               // TODO prefix path relative to scan-root to avoid duplicates
        } else {
                dir = Glib::path_get_dirname (std::string(dllpath));
        }
@@ -227,6 +228,12 @@ vstfx_load_info_block(FILE* fp, VSTInfo *info)
                info->wantMidi = 1;
        }
 
+       if ((info->numParams) == 0) {
+               info->ParamNames = NULL;
+               info->ParamLabels = NULL;
+               return true;
+       }
+
        if ((info->ParamNames = (char **) malloc(sizeof(char*)*info->numParams)) == 0) {
                return false;
        }
@@ -546,7 +553,7 @@ bool vstfx_midi_input (VSTState* vstfx)
        if (vst_version >= 2) {
                /* should we send it VST events (i.e. MIDI) */
 
-               if ((plugin->flags & effFlagsIsSynth) || (plugin->dispatcher (plugin, effCanDo, 0, 0,(void*) "receiveVstEvents", 0.0f) > 0)) {
+               if ((plugin->flags & effFlagsIsSynth) || (plugin->dispatcher (plugin, effCanDo, 0, 0, const_cast<char*> ("receiveVstEvents"), 0.0f) > 0)) {
                        return true;
                }
        }
@@ -564,8 +571,8 @@ bool vstfx_midi_output (VSTState* vstfx)
        if (vst_version >= 2) {
                /* should we send it VST events (i.e. MIDI) */
 
-               if (   (plugin->dispatcher (plugin, effCanDo, 0, 0,(void*) "sendVstEvents", 0.0f) > 0)
-                               || (plugin->dispatcher (plugin, effCanDo, 0, 0,(void*) "sendVstMidiEvent", 0.0f) > 0)
+               if (   (plugin->dispatcher (plugin, effCanDo, 0, 0, const_cast<char*> ("sendVstEvents"), 0.0f) > 0)
+                      || (plugin->dispatcher (plugin, effCanDo, 0, 0, const_cast<char*> ("sendVstMidiEvent"), 0.0f) > 0)
                         ) {
                        return true;
                }
@@ -730,7 +737,6 @@ vstfx_info_from_plugin (const char *dllpath, VSTState* vstfx, vector<VSTInfo *>
                int id;
                vector< pair<int, string> > ids;
                AEffect *plugin = vstfx->plugin;
-               string path = vstfx->handle->path;
 
                do {
                        char name[65] = "Unknown";