hopefully fix the build, and actually use the options
[ardour.git] / libs / ardour / plugin_manager.cc
index c665c7212669eafbd11537f8e733bcd98ba8bd5d..87282037942d2db7ea253c5b13f4beae0f2a1efa 100644 (file)
 
 */
 
+#ifdef WAF_BUILD
+#include "libardour-config.h"
+#endif
+
 #define __STDC_FORMAT_MACROS 1
 #include <stdint.h>
 
@@ -364,7 +368,23 @@ PluginManager::ladspa_discover (string path)
                        }
                }
 
-               _ladspa_plugin_info.push_back (info);
+               if(_ladspa_plugin_info.empty()){
+                       _ladspa_plugin_info.push_back (info);
+               }
+
+               //Ensure that the plugin is not already in the plugin list.
+
+               bool found = false;
+
+               for (PluginInfoList::const_iterator i = _ladspa_plugin_info.begin(); i != _ladspa_plugin_info.end(); ++i) {
+                       if(0 == info->unique_id.compare((*i)->unique_id)){
+                             found = true;
+                       }
+               }
+
+               if(!found){
+                   _ladspa_plugin_info.push_back (info);
+               }
        }
 
 // GDB WILL NOT LIKE YOU IF YOU DO THIS
@@ -528,8 +548,8 @@ PluginManager::vst_discover (string path)
        info->path = path;
        info->creator = finfo->creator;
        info->index = 0;
-       info->n_inputs = finfo->numInputs;
-       info->n_outputs = finfo->numOutputs;
+       info->n_inputs.set_audio (finfo->numInputs);
+       info->n_outputs.set_audio (finfo->numOutputs);
        info->type = ARDOUR::VST;
        
        _vst_plugin_info.push_back (info);