X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fpanner_manager.cc;h=c3601d41de46b21b94d30a03e54c561cd8e16f8a;hb=78c6c9c04a35caf96b2b4c5755668f9d3b91c912;hp=fa500ea85ee3794221d17cc108ab42c5a624e513;hpb=98c7200f160c7586f2213681edaf076226528c51;p=ardour.git diff --git a/libs/ardour/panner_manager.cc b/libs/ardour/panner_manager.cc index fa500ea85e..c3601d41de 100644 --- a/libs/ardour/panner_manager.cc +++ b/libs/ardour/panner_manager.cc @@ -1,9 +1,32 @@ +/* + Copyright (C) 2011 Paul Davis + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include + #include +#include #include "pbd/error.h" #include "pbd/compose.h" #include "pbd/file_utils.h" +#include "ardour/debug.h" #include "ardour/panner_manager.h" #include "ardour/panner_search_path.h" @@ -39,7 +62,7 @@ PannerManager::instance () void PannerManager::discover_panners () { - vector panner_modules; + vector panner_modules; Glib::PatternSpec so_extension_pattern("*.so"); Glib::PatternSpec dylib_extension_pattern("*.dylib"); @@ -50,10 +73,10 @@ PannerManager::discover_panners () find_matching_files_in_search_path (panner_search_path (), dylib_extension_pattern, panner_modules); - info << string_compose (_("looking for panners in %1"), panner_search_path().to_string()) << endmsg; + DEBUG_TRACE (DEBUG::Panning, string_compose (_("looking for panners in %1"), panner_search_path().to_string())); - for (vector::iterator i = panner_modules.begin(); i != panner_modules.end(); ++i) { - panner_discover ((*i).to_string()); + for (vector::iterator i = panner_modules.begin(); i != panner_modules.end(); ++i) { + panner_discover (*i); } } int @@ -62,8 +85,19 @@ PannerManager::panner_discover (string path) PannerInfo* pinfo; if ((pinfo = get_descriptor (path)) != 0) { - panner_info.push_back (pinfo); - info << string_compose(_("Panner discovered: \"%1\""), pinfo->descriptor.name) << endmsg; + + list::iterator i; + + for (i = panner_info.begin(); i != panner_info.end(); ++i) { + if (pinfo->descriptor.name == (*i)->descriptor.name) { + break; + } + } + + if (i == panner_info.end()) { + panner_info.push_back (pinfo); + DEBUG_TRACE (DEBUG::Panning, string_compose(_("Panner discovered: \"%1\" in %2"), pinfo->descriptor.name, path)); + } } return 0;