summaryrefslogtreecommitdiffstats
path: root/src/server/ingen_lv2.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-10-14 21:49:59 -0400
committerDavid Robillard <d@drobilla.net>2016-10-14 21:49:59 -0400
commit1eccad7a9361a2e98d0b7178f8ee655610802630 (patch)
tree4ee3c8e2d1941fb4e7ea969cbdb9abd7f6fd4986 /src/server/ingen_lv2.cpp
parent883b9b94bae3e3ba1164d09ca398b2b1f856b35a (diff)
downloadingen-1eccad7a9361a2e98d0b7178f8ee655610802630.tar.gz
ingen-1eccad7a9361a2e98d0b7178f8ee655610802630.tar.bz2
ingen-1eccad7a9361a2e98d0b7178f8ee655610802630.zip
Fix LV2 initialisation
Diffstat (limited to 'src/server/ingen_lv2.cpp')
-rw-r--r--src/server/ingen_lv2.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp
index cc01f68a..40d5b664 100644
--- a/src/server/ingen_lv2.cpp
+++ b/src/server/ingen_lv2.cpp
@@ -560,22 +560,24 @@ ingen_instantiate(const LV2_Descriptor* descriptor,
engine->activate();
Server::ThreadManager::single_threaded = true;
- engine->locate(0, block_length);
+ std::lock_guard<std::mutex> lock(plugin->world->rdf_mutex());
+ // Locate to time 0 to process initialization events
+ engine->locate(0, block_length);
engine->post_processor()->set_end_time(block_length);
- engine->process_events();
- engine->post_processor()->process();
-
- std::lock_guard<std::mutex> lock(plugin->world->rdf_mutex());
- fprintf(stderr, "LV2 parse resource %s from %s\n", graph->uri.c_str(), graph->filename.c_str());
+ // Parse graph, filling the queue with events to create it
+ plugin->world->interface()->bundle_begin();
plugin->world->parser()->parse_file(plugin->world,
plugin->world->interface().get(),
graph->filename);
+ plugin->world->interface()->bundle_end();
+ // Drain event queue
while (engine->pending_events()) {
- engine->process_events();
+ engine->process_all_events();
engine->post_processor()->process();
+ engine->maid()->cleanup();
}
/* Register client after loading graph so the to-ui ring does not overflow.