diff options
author | David Robillard <d@drobilla.net> | 2012-03-14 23:38:53 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-03-14 23:38:53 +0000 |
commit | f8ca7f3cf6f4a0e967eacfd2e1f9a8ae9625c015 (patch) | |
tree | a1e7bff65900df78c2283fec7093454a18340195 /src/server/ingen_lv2.cpp | |
parent | 31f009967ea0a1664c05d38ea1c126e0c678b20a (diff) | |
download | ingen-f8ca7f3cf6f4a0e967eacfd2e1f9a8ae9625c015.tar.gz ingen-f8ca7f3cf6f4a0e967eacfd2e1f9a8ae9625c015.tar.bz2 ingen-f8ca7f3cf6f4a0e967eacfd2e1f9a8ae9625c015.zip |
Use the host URI map/unmap when running as a plugin.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4058 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/ingen_lv2.cpp')
-rw-r--r-- | src/server/ingen_lv2.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp index db8a642e..23aa3715 100644 --- a/src/server/ingen_lv2.cpp +++ b/src/server/ingen_lv2.cpp @@ -278,24 +278,27 @@ ingen_instantiate(const LV2_Descriptor* descriptor, return NULL; } - IngenPlugin* plugin = (IngenPlugin*)malloc(sizeof(IngenPlugin)); - plugin->conf = new Ingen::Shared::Configuration(&plugin->forge); - plugin->world = new Ingen::Shared::World(plugin->conf, - plugin->argc, - plugin->argv); - if (!plugin->world->load_module("serialisation")) { - delete plugin->world; - return NULL; - } - plugin->main = NULL; - plugin->map = NULL; + IngenPlugin* plugin = (IngenPlugin*)malloc(sizeof(IngenPlugin)); + plugin->conf = new Ingen::Shared::Configuration(&plugin->forge); + plugin->main = NULL; + plugin->map = NULL; + LV2_URID_Unmap* unmap = NULL; for (int i = 0; features[i]; ++i) { if (!strcmp(features[i]->URI, LV2_URID_URI "#map")) { plugin->map = (LV2_URID_Map*)features[i]->data; + } else if (!strcmp(features[i]->URI, LV2_URID_URI "#unmap")) { + unmap = (LV2_URID_Unmap*)features[i]->data; } } + plugin->world = new Ingen::Shared::World( + plugin->conf, plugin->argc, plugin->argv, plugin->map, unmap); + if (!plugin->world->load_module("serialisation")) { + delete plugin->world; + return NULL; + } + SharedPtr<Server::Engine> engine(new Server::Engine(plugin->world)); plugin->world->set_local_engine(engine); plugin->main = new MainThread(engine); |