From 5791d19a0f56c65ef7b89da80f4bcc3e1cee0c93 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 11 Oct 2007 17:24:49 +0000 Subject: Fix awful plugin loading situation. Don't double-lookup plugins on discovery/load. O(log(n)) plugin searching instead of 2*O(n). Don't keep discovered LADSPA plugins loaded (until a node is instantiated). git-svn-id: http://svn.drobilla.net/lad/ingen@876 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/NodeFactory.hpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'src/libs/engine/NodeFactory.hpp') diff --git a/src/libs/engine/NodeFactory.hpp b/src/libs/engine/NodeFactory.hpp index a956a938..6eceb0ee 100644 --- a/src/libs/engine/NodeFactory.hpp +++ b/src/libs/engine/NodeFactory.hpp @@ -32,7 +32,7 @@ #endif #include "types.hpp" -using std::string; using std::list; +using std::string; namespace Ingen { @@ -58,33 +58,31 @@ public: ~NodeFactory(); void load_plugins(); - NodeImpl* load_plugin(const PluginImpl* info, const string& name, bool polyphonic, PatchImpl* parent); + NodeImpl* load_plugin(PluginImpl* info, const string& name, bool polyphonic, PatchImpl* parent); - const list& plugins() { return _plugins; } + typedef std::map Plugins; + const Plugins& plugins() const { return _plugins; } - const PluginImpl* plugin(const string& uri); - const PluginImpl* plugin(const string& type, const string& lib, const string& label); // DEPRECATED + PluginImpl* plugin(const string& uri); + + /** DEPRECATED */ + PluginImpl* plugin(const string& type, const string& lib, const string& label); private: #ifdef HAVE_LADSPA void load_ladspa_plugins(); - NodeImpl* load_ladspa_plugin(const string& plugin_uri, const string& name, bool polyphonic, PatchImpl* parent, SampleRate srate, size_t buffer_size); + NodeImpl* load_ladspa_plugin(PluginImpl* plugin, const string& name, bool polyphonic, PatchImpl* parent, SampleRate srate, size_t buffer_size); #endif #ifdef HAVE_SLV2 void load_lv2_plugins(); - NodeImpl* load_lv2_plugin(const string& plugin_uri, const string& name, bool polyphonic, PatchImpl* parent, SampleRate srate, size_t buffer_size); + NodeImpl* load_lv2_plugin(PluginImpl* plugin, const string& name, bool polyphonic, PatchImpl* parent, SampleRate srate, size_t buffer_size); #endif - NodeImpl* load_internal_plugin(const string& plug_label, const string& name, bool polyphonic, PatchImpl* parent, SampleRate srate, size_t buffer_size); - - Glib::Module* library(const string& path); + void load_internal_plugins(); + NodeImpl* load_internal_plugin(PluginImpl* plugin, const string& name, bool polyphonic, PatchImpl* parent, SampleRate srate, size_t buffer_size); - typedef std::map Libraries; - - Libraries _libraries; - list _internal_plugins; - list _plugins; // FIXME: make a map + Plugins _plugins; Ingen::Shared::World* _world; bool _has_loaded; -- cgit v1.2.1