diff options
author | David Robillard <d@drobilla.net> | 2007-10-11 17:24:49 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-10-11 17:24:49 +0000 |
commit | 5791d19a0f56c65ef7b89da80f4bcc3e1cee0c93 (patch) | |
tree | de0a795658df184d29e4ed795c6b6b15c6e0454d /src/libs/engine/PluginImpl.cpp | |
parent | 058174f81f325521957cc6927667dfcf0d7346b4 (diff) | |
download | ingen-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/PluginImpl.cpp')
-rw-r--r-- | src/libs/engine/PluginImpl.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/libs/engine/PluginImpl.cpp b/src/libs/engine/PluginImpl.cpp index e8b090ef..dfff1031 100644 --- a/src/libs/engine/PluginImpl.cpp +++ b/src/libs/engine/PluginImpl.cpp @@ -15,14 +15,41 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <iostream> #include "PluginImpl.hpp" #include "MidiNoteNode.hpp" #include "MidiTriggerNode.hpp" #include "MidiControlNode.hpp" #include "TransportNode.hpp" +using namespace std; + namespace Ingen { + +void +PluginImpl::load() +{ + if (!_module) { + cerr << "Loading " << _lib_path << endl; + _module = new Glib::Module(_lib_path, Glib::MODULE_BIND_LOCAL); + if (!(*_module)) + delete _module; + } +} + + +void +PluginImpl::unload() +{ + if (_module) { + cerr << "Unloading " << _lib_path << endl; + delete _module; + _module = NULL; + } +} + + NodeImpl* PluginImpl::instantiate(const string& name, bool polyphonic, Ingen::PatchImpl* parent, SampleRate srate, size_t buffer_size) { |