X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fplugin_manager.cc;h=36cc80a660fccfdc4675f7b45090901059dcc7b0;hb=069d54a008c736dc865a22dbb4cc1117f9db481e;hp=e214e56ebc8068ff4e22645d6286c52281b2671b;hpb=8af0757b61990767f2a85e68f535a5af9976fd79;p=ardour.git diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc index e214e56ebc..36cc80a660 100644 --- a/libs/ardour/plugin_manager.cc +++ b/libs/ardour/plugin_manager.cc @@ -183,14 +183,14 @@ PluginManager::add_presets(string domain) return; } - string path = compose("%1/.%2/rdf", envvar, domain); + string path = string_compose("%1/.%2/rdf", envvar, domain); presets = scanner (path, rdf_filter, 0, true, true); if (presets) { for (x = presets->begin(); x != presets->end (); ++x) { string file = "file:" + **x; if (lrdf_read_file(file.c_str())) { - warning << compose(_("Could not parse rdf file: %1"), *x) << endmsg; + warning << string_compose(_("Could not parse rdf file: %1"), *x) << endmsg; } } } @@ -232,14 +232,14 @@ PluginManager::ladspa_discover (string path) const char *errstr; if ((module = dlopen (path.c_str(), RTLD_NOW)) == 0) { - error << compose(_("LADSPA: cannot load module \"%1\" (%2)"), path, dlerror()) << endmsg; + error << string_compose(_("LADSPA: cannot load module \"%1\" (%2)"), path, dlerror()) << endmsg; return -1; } dfunc = (LADSPA_Descriptor_Function) dlsym (module, "ladspa_descriptor"); if ((errstr = dlerror()) != 0) { - error << compose(_("LADSPA: module \"%1\" has no descriptor function."), path) << endmsg; + error << string_compose(_("LADSPA: module \"%1\" has no descriptor function."), path) << endmsg; error << errstr << endmsg; dlclose (module); return -1; @@ -258,6 +258,7 @@ PluginManager::ladspa_discover (string path) info->n_inputs = 0; info->n_outputs = 0; info->type = PluginInfo::LADSPA; + info->unique_id = descriptor->UniqueID; for (uint32_t n=0; n < descriptor->PortCount; ++n) { if ( LADSPA_IS_PORT_AUDIO (descriptor->PortDescriptors[n]) ) { @@ -293,7 +294,7 @@ PluginManager::load (Session& session, PluginInfo *info) FSTHandle* handle; if ((handle = fst_load (info->path.c_str())) == 0) { - error << compose(_("VST: cannot load module from \"%1\""), info->path) << endmsg; + error << string_compose(_("VST: cannot load module from \"%1\""), info->path) << endmsg; } else { plugin = new VSTPlugin (_engine, session, handle); } @@ -308,7 +309,7 @@ PluginManager::load (Session& session, PluginInfo *info) } else { if ((module = dlopen (info->path.c_str(), RTLD_NOW)) == 0) { - error << compose(_("LADSPA: cannot load module from \"%1\""), info->path) << endmsg; + error << string_compose(_("LADSPA: cannot load module from \"%1\""), info->path) << endmsg; error << dlerror() << endmsg; } else { plugin = new LadspaPlugin (module, _engine, session, info->index, session.frame_rate()); @@ -326,7 +327,7 @@ PluginManager::load (Session& session, PluginInfo *info) } Plugin * -ARDOUR::find_plugin(Session& session, string name, PluginInfo::Type type) +ARDOUR::find_plugin(Session& session, string name, long unique_id, PluginInfo::Type type) { PluginManager *mgr = PluginManager::the_manager(); list::iterator i; @@ -338,11 +339,13 @@ ARDOUR::find_plugin(Session& session, string name, PluginInfo::Type type) break; case PluginInfo::VST: plugs = &mgr->vst_plugin_info(); + unique_id = 0; // VST plugins don't have a unique id. break; } for (i = plugs->begin(); i != plugs->end(); ++i) { - if ((*i)->name == name) { + if ((name == "" || (*i)->name == name) && + (unique_id == 0 || (*i)->unique_id == unique_id)) { return mgr->load (session, *i); } } @@ -455,7 +458,7 @@ PluginManager::vst_discover (string path) } if (!finfo->canProcessReplacing) { - warning << compose (_("VST plugin %1 does not support processReplacing, and so cannot be used in ardour at this time"), + warning << string_compose (_("VST plugin %1 does not support processReplacing, and so cannot be used in ardour at this time"), finfo->name) << endl; }