summaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/port.c26
-rw-r--r--src/query.c3
2 files changed, 28 insertions, 1 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,
diff --git a/src/query.c b/src/query.c
index b226f04..6dbb47f 100644
--- a/src/query.c
+++ b/src/query.c
@@ -33,7 +33,8 @@ static const char* slv2_query_prefixes =
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n"
"PREFIX doap: <http://usefulinc.com/ns/doap#>\n"
"PREFIX foaf: <http://xmlns.com/foaf/0.1/>\n"
- "PREFIX lv2: <http://lv2plug.in/ns/lv2core#>\n";
+ "PREFIX lv2: <http://lv2plug.in/ns/lv2core#>\n"
+ "PREFIX lv2ev: <http://lv2plug.in/ns/ext/event#>\n";
#if 0
char*