diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-12-08 16:07:28 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-12-08 16:07:28 +0000 |
commit | 3be16e8afbd891c0bfe7227158384ed0d127597f (patch) | |
tree | 73a8f761fc13cbd0613d3923a34748bb9aa761d2 /libs/ardour/plugin_manager.cc | |
parent | a9bb336fc44ab4937978f5a0308e440ed632ea50 (diff) |
partial patch/partial by-hand merge of 2.X commits 3169&3170 to 3.X codebase
git-svn-id: svn://localhost/ardour2/branches/3.0@4300 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/plugin_manager.cc')
-rw-r--r-- | libs/ardour/plugin_manager.cc | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc index d4e995f0bf..0b5a14bf56 100644 --- a/libs/ardour/plugin_manager.cc +++ b/libs/ardour/plugin_manager.cc @@ -153,12 +153,45 @@ PluginManager::refresh () void PluginManager::ladspa_refresh () { - _ladspa_plugin_info.clear (); - - if (ladspa_path.length() == 0) { - ladspa_path = "/usr/local/lib64/ladspa:/usr/local/lib/ladspa:/usr/lib64/ladspa:/usr/lib/ladspa:/Library/Audio/Plug-Ins/LADSPA"; - } - + _ladspa_plugin_info.clear (); + + static const char *standard_paths[] = { + "/usr/local/lib64/ladspa", + "/usr/local/lib/ladspa", + "/usr/lib64/ladspa", + "/usr/lib/ladspa", + "/Library/Audio/Plug-Ins/LADSPA", + "" + }; + + /* allow LADSPA_PATH to augment, not override standard locations */ + + /* Only add standard locations to ladspa_path if it doesn't + * already contain them. Check for trailing '/'s too. + */ + + int i; + for (i = 0; standard_paths[i][0]; i++) { + size_t found = ladspa_path.find(standard_paths[i]); + if (found != ladspa_path.npos) { + switch (ladspa_path[found + strlen(standard_paths[i])]) { + case ':' : + case '\0': + continue; + case '/' : + if (ladspa_path[found + strlen(standard_paths[i]) + 1] == ':' || + ladspa_path[found + strlen(standard_paths[i]) + 1] == '\0') { + continue; + } + } + } + if (!ladspa_path.empty()) + ladspa_path += ":"; + + ladspa_path += standard_paths[i]; + + } + ladspa_discover_from_path (ladspa_path); } |