diff options
author | David Robillard <d@drobilla.net> | 2010-03-06 10:23:19 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-03-06 10:23:19 +0000 |
commit | 059f20c9666234f2be01498ee04f1e7ee795ba8f (patch) | |
tree | ef0d53073d53012aeaa7d084fccf477b166c0684 /src/engine/NodeFactory.cpp | |
parent | 085a451dfec54126be1b9346899c81d82e6eb58e (diff) | |
download | ingen-059f20c9666234f2be01498ee04f1e7ee795ba8f.tar.gz ingen-059f20c9666234f2be01498ee04f1e7ee795ba8f.tar.bz2 ingen-059f20c9666234f2be01498ee04f1e7ee795ba8f.zip |
Save Ingen patches as working standard LV2 plugin bundles.
This allows you to create an Ingen patch in Ingen running as a Jack client,
save it, then load that patch as an LV2 plugin in any LV2 compliant host.
Eliminate (hopefully) all static data in the engine (for multiple instantiations in a single process).
More API/ABI stable interface for Ingen::Shared::World.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2533 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/NodeFactory.cpp')
-rw-r--r-- | src/engine/NodeFactory.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/engine/NodeFactory.cpp b/src/engine/NodeFactory.cpp index 5ff21c04..c20afed8 100644 --- a/src/engine/NodeFactory.cpp +++ b/src/engine/NodeFactory.cpp @@ -66,8 +66,7 @@ NodeFactory::NodeFactory(Ingen::Shared::World* world) NodeFactory::~NodeFactory() { for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) - if (i->second->type() != Shared::Plugin::Internal) - delete i->second; + delete i->second; _plugins.clear(); } @@ -111,7 +110,7 @@ NodeFactory::load_plugins() { ThreadManager::assert_thread(THREAD_PRE_PROCESS); - _world->rdf_world->mutex().lock(); + _world->rdf_world()->mutex().lock(); // Only load if we havn't already, so every client connecting doesn't cause // this (expensive!) stuff to happen. Not the best solution - would be nice @@ -132,24 +131,25 @@ NodeFactory::load_plugins() _has_loaded = true; } - _world->rdf_world->mutex().unlock(); + _world->rdf_world()->mutex().unlock(); } void NodeFactory::load_internal_plugins() { - InternalPlugin& controller_plug = ControllerNode::internal_plugin(); - _plugins.insert(make_pair(controller_plug.uri(), &controller_plug)); + Shared::LV2URIMap& uris = *_world->uris().get(); + InternalPlugin* controller_plug = ControllerNode::internal_plugin(uris); + _plugins.insert(make_pair(controller_plug->uri(), controller_plug)); - InternalPlugin& delay_plug = DelayNode::internal_plugin(); - _plugins.insert(make_pair(delay_plug.uri(), &delay_plug)); + InternalPlugin* delay_plug = DelayNode::internal_plugin(uris); + _plugins.insert(make_pair(delay_plug->uri(), delay_plug)); - InternalPlugin& note_plug = NoteNode::internal_plugin(); - _plugins.insert(make_pair(note_plug.uri(), ¬e_plug)); + InternalPlugin* note_plug = NoteNode::internal_plugin(uris); + _plugins.insert(make_pair(note_plug->uri(), note_plug)); - InternalPlugin& trigger_plug = TriggerNode::internal_plugin(); - _plugins.insert(make_pair(trigger_plug.uri(), &trigger_plug)); + InternalPlugin* trigger_plug = TriggerNode::internal_plugin(uris); + _plugins.insert(make_pair(trigger_plug->uri(), trigger_plug)); } @@ -159,7 +159,7 @@ NodeFactory::load_internal_plugins() void NodeFactory::load_lv2_plugins() { - SLV2Plugins plugins = slv2_world_get_all_plugins(_world->slv2_world); + SLV2Plugins plugins = slv2_world_get_all_plugins(_world->slv2_world()); for (unsigned i=0; i < slv2_plugins_size(plugins); ++i) { @@ -177,7 +177,7 @@ NodeFactory::load_lv2_plugins() _plugins.insert(make_pair(uri, plugin)); } - slv2_plugins_free(_world->slv2_world, plugins); + slv2_plugins_free(_world->slv2_world(), plugins); } #endif // HAVE_SLV2 @@ -254,10 +254,11 @@ NodeFactory::load_ladspa_plugins() const Plugins::const_iterator i = _plugins.find(uri); if (i == _plugins.end()) { - LADSPAPlugin* plugin = new LADSPAPlugin(lib_path, uri, - descriptor->UniqueID, - descriptor->Label, - descriptor->Name); + LADSPAPlugin* plugin = new LADSPAPlugin(*_world->uris().get(), + lib_path, uri, + descriptor->UniqueID, + descriptor->Label, + descriptor->Name); _plugins.insert(make_pair(uri, plugin)); |