diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-10-13 18:40:47 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-10-13 18:40:47 +0000 |
commit | a89572072e172d355fb3c96d088d57c276d96a9d (patch) | |
tree | d9ae162daedd88bd261d6a6e0743a65ac6dd72a3 | |
parent | 7cded3707fc76aa6d796cbc86b5fc60b3aa40a03 (diff) |
avoid listing duplicate LXVST plugins that are discovered along LXVST_PATH or otherwise (from linuxdsp)
git-svn-id: svn://localhost/ardour2/branches/3.0@10208 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | libs/ardour/plugin_manager.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc index 613fc85c6d..7072e073ba 100644 --- a/libs/ardour/plugin_manager.cc +++ b/libs/ardour/plugin_manager.cc @@ -719,6 +719,22 @@ PluginManager::lxvst_discover (string path) info->n_outputs.set_audio (finfo->numOutputs); info->n_inputs.set_midi (finfo->wantMidi ? 1 : 0); info->type = ARDOUR::LXVST; + + /* Make sure we don't find the same plugin in more than one place along + the LXVST_PATH We can't use a simple 'find' because the path is included + in the PluginInfo, and that is the one thing we can be sure MUST be + different if a duplicate instance is found. So we just compare the type + and unique ID (which for some VSTs isn't actually unique...) + */ + + if (!_lxvst_plugin_info->empty()) { + for (PluginInfoList::iterator i =_lxvst_plugin_info->begin(); i != _lxvst_plugin_info->end(); ++i) { + if ((info->type == (*i)->type)&&(info->unique_id == (*i)->unique_id)) { + vstfx_free_info(finfo); + return 0; + } + } + } _lxvst_plugin_info->push_back (info); vstfx_free_info (finfo); |