diff options
author | David Robillard <d@drobilla.net> | 2012-11-23 02:48:39 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-11-23 02:48:39 +0000 |
commit | a76bd27ee0a9e763654100b584b3506f4f53e0c0 (patch) | |
tree | 3e8eb73e5835c941ce4c9c5c0f7d72ad60e47856 /src | |
parent | f7963514ecc6b09717e5a5b49845cb0043145e37 (diff) | |
download | lilv-a76bd27ee0a9e763654100b584b3506f4f53e0c0.tar.gz lilv-a76bd27ee0a9e763654100b584b3506f4f53e0c0.tar.bz2 lilv-a76bd27ee0a9e763654100b584b3506f4f53e0c0.zip |
Support atom:supports in lilv_port_supports_event() (fix #857).
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@4857 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/port.c | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -20,6 +20,7 @@ #include <stdlib.h> #include <string.h> +#include "lv2/lv2plug.in/ns/ext/atom/atom.h" #include "lv2/lv2plug.in/ns/ext/event/event.h" #include "lilv_internal.h" @@ -81,11 +82,19 @@ lilv_port_supports_event(const LilvPlugin* p, const LilvPort* port, const LilvNode* event) { - return lilv_world_ask_internal( - p->world, - port->node, - sord_new_uri(p->world->world, (const uint8_t*)LV2_EVENT__supportsEvent), - lilv_node_as_node(event)); + const uint8_t* predicates[] = { (const uint8_t*)LV2_EVENT__supportsEvent, + (const uint8_t*)LV2_ATOM__supports, + NULL }; + + for (const uint8_t** pred = predicates; *pred; ++pred) { + if (lilv_world_ask_internal(p->world, + port->node, + sord_new_uri(p->world->world, *pred), + lilv_node_as_node(event))) { + return true; + } + } + return false; } static LilvNodes* |