summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-08-25 15:16:29 +0000
committerDavid Robillard <d@drobilla.net>2013-08-25 15:16:29 +0000
commit1a2dabffe961eb093846f8c8a8462468f740ad97 (patch)
tree985b92e224ad41759f607142e5b26af444080aa9 /src
parente4b658c47ac55539f7c8724a61ebb6940ae1cc5c (diff)
downloadlilv-1a2dabffe961eb093846f8c8a8462468f740ad97.tar.gz
lilv-1a2dabffe961eb093846f8c8a8462468f740ad97.tar.bz2
lilv-1a2dabffe961eb093846f8c8a8462468f740ad97.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/lilv_internal.h1
-rw-r--r--src/plugin.c16
-rw-r--r--src/world.c1
3 files changed, 13 insertions, 5 deletions
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);