summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/NodeFactory.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-10-11 17:24:49 +0000
committerDavid Robillard <d@drobilla.net>2007-10-11 17:24:49 +0000
commit5791d19a0f56c65ef7b89da80f4bcc3e1cee0c93 (patch)
treede0a795658df184d29e4ed795c6b6b15c6e0454d /src/libs/engine/NodeFactory.hpp
parent058174f81f325521957cc6927667dfcf0d7346b4 (diff)
downloadingen-5791d19a0f56c65ef7b89da80f4bcc3e1cee0c93.tar.gz
ingen-5791d19a0f56c65ef7b89da80f4bcc3e1cee0c93.tar.bz2
ingen-5791d19a0f56c65ef7b89da80f4bcc3e1cee0c93.zip
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
Diffstat (limited to 'src/libs/engine/NodeFactory.hpp')
-rw-r--r--src/libs/engine/NodeFactory.hpp28
1 files changed, 13 insertions, 15 deletions
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<PluginImpl*>& plugins() { return _plugins; }
+ typedef std::map<std::string,PluginImpl*> 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<std::string,Glib::Module*> Libraries;
-
- Libraries _libraries;
- list<PluginImpl*> _internal_plugins;
- list<PluginImpl*> _plugins; // FIXME: make a map
+ Plugins _plugins;
Ingen::Shared::World* _world;
bool _has_loaded;