From 1a2dabffe961eb093846f8c8a8462468f740ad97 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 25 Aug 2013 15:16:29 +0000 Subject: Support denoting latency ports with lv2:designation lv2:latency. git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@5157 a436a847-0d15-0410-975c-d299462d15a1 --- src/lilv_internal.h | 1 + src/plugin.c | 16 +++++++++++----- src/world.c | 1 + 3 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/lilv_internal.h b/src/lilv_internal.h index 49a7440..95bcee7 100644 --- a/src/lilv_internal.h +++ b/src/lilv_internal.h @@ -164,6 +164,7 @@ struct LilvWorldImpl { SordNode* lv2_designation; SordNode* lv2_extensionData; SordNode* lv2_index; + SordNode* lv2_latency; SordNode* lv2_maximum; SordNode* lv2_minimum; SordNode* lv2_name; diff --git a/src/plugin.c b/src/plugin.c index 7e33495..8ec93ff 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -594,15 +594,21 @@ lilv_plugin_has_latency(const LilvPlugin* p) bool ret = false; FOREACH_MATCH(ports) { - const SordNode* port = sord_iter_get_node(ports, SORD_OBJECT); - SordIter* reports_latency = lilv_world_query_internal( + const SordNode* port = sord_iter_get_node(ports, SORD_OBJECT); + SordIter* prop = lilv_world_query_internal( p->world, port, p->world->uris.lv2_portProperty, p->world->uris.lv2_reportsLatency); - const bool end = sord_iter_end(reports_latency); - sord_iter_free(reports_latency); - if (!end) { + SordIter* des = lilv_world_query_internal( + p->world, + port, + p->world->uris.lv2_designation, + p->world->uris.lv2_latency); + const bool latent = !sord_iter_end(prop) || !sord_iter_end(des); + sord_iter_free(prop); + sord_iter_free(des); + if (latent) { ret = true; break; } diff --git a/src/world.c b/src/world.c index a577bbe..e64c5d2 100644 --- a/src/world.c +++ b/src/world.c @@ -64,6 +64,7 @@ lilv_world_new(void) world->uris.lv2_designation = NEW_URI(LV2_CORE__designation); world->uris.lv2_extensionData = NEW_URI(LV2_CORE__extensionData); world->uris.lv2_index = NEW_URI(LV2_CORE__index); + world->uris.lv2_latency = NEW_URI(LV2_CORE__latency); world->uris.lv2_maximum = NEW_URI(LV2_CORE__maximum); world->uris.lv2_minimum = NEW_URI(LV2_CORE__minimum); world->uris.lv2_name = NEW_URI(LV2_CORE__name); -- cgit v1.2.1