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));
}
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;
}
static bool
vstfx_blacklist_stat (const char *dllpath, int personal)
{
- if (strstr (dllpath, ".so" ) == 0 && strstr(dllpath, ".dll") == 0) {
+ const size_t slen = strlen (dllpath);
+ if (
+ (slen <= 3 || g_ascii_strcasecmp (&dllpath[slen-3], ".so"))
+ &&
+ (slen <= 4 || g_ascii_strcasecmp (&dllpath[slen-4], ".dll"))
+ ) {
return true;
}
+
string const path = vstfx_blacklist_path (dllpath, personal);
if (Glib::file_test (path, Glib::FileTest (Glib::FILE_TEST_EXISTS | Glib::FILE_TEST_IS_REGULAR))) {
{
FILE *f;
if ((f = fopen (vstfx_blacklist_path (dllpath, 0).c_str(), "wb"))) {
+#ifndef NDEBUG
+ PBD::info << "Blacklisted VST: '" << vstfx_blacklist_path (dllpath, 0) << "'" << endmsg;
+#endif
return f;
}
+#ifndef NDEBUG
+ PBD::info << "Blacklisted VST: '" << vstfx_blacklist_path (dllpath, 1) << "'" << endmsg;
+#endif
return fopen (vstfx_blacklist_path (dllpath, 1).c_str(), "wb");
}
static char *
vstfx_infofile_stat (const char *dllpath, struct stat* statbuf, int personal)
{
- if (strstr (dllpath, ".so" ) == 0 && strstr(dllpath, ".dll") == 0) {
+ const size_t slen = strlen (dllpath);
+ if (
+ (slen <= 3 || g_ascii_strcasecmp (&dllpath[slen-3], ".so"))
+ &&
+ (slen <= 4 || g_ascii_strcasecmp (&dllpath[slen-4], ".dll"))
+ ) {
return 0;
}
static FILE *
vstfx_infofile_create (const char* dllpath, int personal)
{
- if (strstr (dllpath, ".so" ) == 0 && strstr(dllpath, ".dll") == 0) {
- return 0;
+ const size_t slen = strlen (dllpath);
+ if (
+ (slen <= 3 || g_ascii_strcasecmp (&dllpath[slen-3], ".so"))
+ &&
+ (slen <= 4 || g_ascii_strcasecmp (&dllpath[slen-4], ".dll"))
+ ) {
+ return NULL;
}
string const path = vstfx_infofile_path (dllpath, personal);
+#ifndef NDEBUG
+ PBD::info << "Creating VST cache file " << path << endmsg;
+#endif
return fopen (path.c_str(), "wb");
}
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;
}
}
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;
}
int id;
vector< pair<int, string> > ids;
AEffect *plugin = vstfx->plugin;
- string path = vstfx->handle->path;
do {
char name[65] = "Unknown";