summaryrefslogtreecommitdiffstats
path: root/src/port.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-01-20 21:32:57 +0000
committerDavid Robillard <d@drobilla.net>2008-01-20 21:32:57 +0000
commit42aa3c32cdd4c6a0cc1e3372d57ac99511b2f46d (patch)
tree483949fefd1306a1d9919de3effe5efb1056f65d /src/port.c
parent5d8ed7bec58131367d69840bfb299fe93568fe6d (diff)
downloadlilv-42aa3c32cdd4c6a0cc1e3372d57ac99511b2f46d.tar.gz
lilv-42aa3c32cdd4c6a0cc1e3372d57ac99511b2f46d.tar.bz2
lilv-42aa3c32cdd4c6a0cc1e3372d57ac99511b2f46d.zip
Work on new generic events extension.
git-svn-id: http://svn.drobilla.net/lad/slv2@1089 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/port.c')
-rw-r--r--src/port.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/port.c b/src/port.c
index 9925a13..1e435f0 100644
--- a/src/port.c
+++ b/src/port.c
@@ -150,6 +150,32 @@ slv2_port_has_property(SLV2Plugin p,
}
+bool
+slv2_port_supports_event(SLV2Plugin p,
+ SLV2Port port,
+ const char* event)
+{
+ assert(event);
+
+ char* query = slv2_strjoin(
+ "ASK WHERE {\n"
+ "<", librdf_uri_as_string(p->plugin_uri), "> lv2:port ?port ."
+ "?port lv2:symbol \"", port->symbol, "\";\n",
+ " lv2ev:supportsEvent <", event, "> .\n"
+ "}", NULL);
+
+ librdf_query_results* results = slv2_plugin_query(p, query);
+ assert(librdf_query_results_is_boolean(results));
+
+ const bool ret = librdf_query_results_get_boolean(results);
+
+ free(query);
+ librdf_free_query_results(results);
+
+ return ret;
+}
+
+
SLV2Values
slv2_port_get_value(SLV2Plugin p,
SLV2Port port,