+
+PluginPtr
+ARDOUR::find_plugin(Session& session, string identifier, PluginType type)
+{
+ PluginManager *mgr = PluginManager::the_manager();
+ PluginInfoList plugs;
+
+ switch (type) {
+ case ARDOUR::LADSPA:
+ plugs = mgr->ladspa_plugin_info();
+ break;
+
+#ifdef HAVE_SLV2
+ case ARDOUR::LV2:
+ plugs = mgr->lv2_plugin_info();
+ break;
+#endif
+
+#ifdef VST_SUPPORT
+ case ARDOUR::VST:
+ plugs = mgr->vst_plugin_info();
+ break;
+#endif
+
+#ifdef HAVE_AUDIOUNITS
+ case ARDOUR::AudioUnit:
+ plugs = mgr->au_plugin_info();
+ break;
+#endif
+
+ default:
+ return PluginPtr ((Plugin *) 0);
+ }
+
+ PluginInfoList::iterator i;
+
+ for (i = plugs.begin(); i != plugs.end(); ++i) {
+ if (identifier == (*i)->unique_id){
+ return (*i)->load (session);
+ }
+ }
+
+#ifdef VST_SUPPORT
+ /* hmm, we didn't find it. could be because in older versions of Ardour.
+ we used to store the name of a VST plugin, not its unique ID. so try
+ again.
+ */
+
+ for (i = plugs.begin(); i != plugs.end(); ++i) {
+ if (identifier == (*i)->name){
+ return (*i)->load (session);
+ }
+ }
+#endif
+
+ return PluginPtr ((Plugin*) 0);
+}
+
+ChanCount
+Plugin::output_streams () const
+{
+ /* LADSPA & VST should not get here because they do not
+ return "infinite" i/o counts.
+ */
+ return ChanCount::ZERO;
+}
+
+ChanCount
+Plugin::input_streams () const
+{
+ /* LADSPA & VST should not get here because they do not
+ return "infinite" i/o counts.
+ */
+ return ChanCount::ZERO;
+}
+
+