summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
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*