diff options
author | David Robillard <d@drobilla.net> | 2013-08-25 15:38:31 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-08-25 15:38:31 +0000 |
commit | 9b855e16294bedda04a82308f48bbefb6fc5f70d (patch) | |
tree | 648163304b8f6398ac21dd159d4a961f549f7f7e /src | |
parent | 1a2dabffe961eb093846f8c8a8462468f740ad97 (diff) | |
download | lilv-9b855e16294bedda04a82308f48bbefb6fc5f70d.tar.gz lilv-9b855e16294bedda04a82308f48bbefb6fc5f70d.tar.bz2 lilv-9b855e16294bedda04a82308f48bbefb6fc5f70d.zip |
Support getting index of designated latency ports.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@5158 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/plugin.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/plugin.c b/src/plugin.c index 8ec93ff..4383cc0 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -659,7 +659,7 @@ lilv_plugin_get_port_by_designation(const LilvPlugin* plugin, designation->node); const bool found = !sord_iter_end(iter) && - lilv_port_is_a(plugin, port, port_class); + (!port_class || lilv_port_is_a(plugin, port, port_class)); sord_iter_free(iter); if (found) { @@ -676,9 +676,19 @@ lilv_plugin_get_latency_port_index(const LilvPlugin* p) { LilvNode* prop = lilv_node_new_from_node( p->world, p->world->uris.lv2_reportsLatency); - const LilvPort* latency_port = lilv_plugin_get_port_by_property(p, prop); + LilvNode* des = lilv_node_new_from_node( + p->world, p->world->uris.lv2_latency); + const LilvPort* prop_port = lilv_plugin_get_port_by_property(p, prop); + const LilvPort* des_port = lilv_plugin_get_port_by_property(p, des); lilv_node_free(prop); - return latency_port ? latency_port->index : UINT32_MAX; + lilv_node_free(des); + if (prop_port) { + return prop_port->index; + } else if (des_port) { + return des_port->index; + } else { + return UINT32_MAX; + } } LILV_API |