+/*
+ 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 <unistd.h>
+
Glib::PatternSpec dylib_extension_pattern("*.dylib");
find_matching_files_in_search_path (panner_search_path (),
Glib::PatternSpec dylib_extension_pattern("*.dylib");
find_matching_files_in_search_path (panner_search_path (),
- panner_info.push_back (pinfo);
- info << string_compose(_("Panner discovered: \"%1\""), pinfo->descriptor.name) << endmsg;
- }
+
+ list<PannerInfo*>::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);
+ info << string_compose(_("Panner discovered: \"%1\" in %2"), pinfo->descriptor.name, path) << endmsg;
+ }
+ }
- PanPluginDescriptor* d;
- int32_t nin = in.n_audio();
- int32_t nout = out.n_audio();
-
- /* look for exact match first */
-
- for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
- d = &(*p)->descriptor;
-
- if (d->in == nin && d->out == nout) {
- return *p;
- }
- }
-
- /* no exact match, look for good fit on inputs and variable on outputs */
-
- for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
- d = &(*p)->descriptor;
-
- if (d->in == nin && d->out == -1) {
- return *p;
- }
- }
-
- /* no exact match, look for good fit on outputs and variable on inputs */
-
- for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
- d = &(*p)->descriptor;
-
- if (d->in == -1 && d->out == nout) {
- return *p;
- }
- }
-
- /* no exact match, look for variable fit on inputs and outputs */
-
- for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
- d = &(*p)->descriptor;
-
- if (d->in == -1 && d->out == -1) {
- return *p;
- }
- }
-
- warning << string_compose (_("no panner discovered for in/out = %1/%2"), nin, nout) << endmsg;
-
- return 0;
+ PanPluginDescriptor* d;
+ int32_t nin = in.n_audio();
+ int32_t nout = out.n_audio();
+
+ /* look for exact match first */
+
+ for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
+ d = &(*p)->descriptor;
+
+ if (d->in == nin && d->out == nout) {
+ return *p;
+ }
+ }
+
+ /* no exact match, look for good fit on inputs and variable on outputs */
+
+ for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
+ d = &(*p)->descriptor;
+
+ if (d->in == nin && d->out == -1) {
+ return *p;
+ }
+ }
+
+ /* no exact match, look for good fit on outputs and variable on inputs */
+
+ for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
+ d = &(*p)->descriptor;
+
+ if (d->in == -1 && d->out == nout) {
+ return *p;
+ }
+ }
+
+ /* no exact match, look for variable fit on inputs and outputs */
+
+ for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
+ d = &(*p)->descriptor;
+
+ if (d->in == -1 && d->out == -1) {
+ return *p;
+ }
+ }
+
+ warning << string_compose (_("no panner discovered for in/out = %1/%2"), nin, nout) << endmsg;
+
+ return 0;