summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-07-04 20:43:12 +0000
committerDavid Robillard <d@drobilla.net>2009-07-04 20:43:12 +0000
commitb8cdfe9d97b8b5b8f0de3732a9f3075476df8071 (patch)
tree9ee66a74fcfe3c4531456fde60700c598d2d8e13
parent444d4b127e7baadfe6ac050e522932a2e6a620ba (diff)
downloadlilv-b8cdfe9d97b8b5b8f0de3732a9f3075476df8071.tar.gz
lilv-b8cdfe9d97b8b5b8f0de3732a9f3075476df8071.tar.bz2
lilv-b8cdfe9d97b8b5b8f0de3732a9f3075476df8071.zip
Print group types.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@2137 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--utils/lv2_inspect.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/utils/lv2_inspect.c b/utils/lv2_inspect.c
index 8b6f5ca..f0092a4 100644
--- a/utils/lv2_inspect.c
+++ b/utils/lv2_inspect.c
@@ -30,9 +30,10 @@ SLV2Value in_group_pred = NULL;
SLV2Value role_pred = NULL;
void
-print_group(SLV2Plugin p, SLV2Value group, SLV2Value symbol)
+print_group(SLV2Plugin p, SLV2Value group, SLV2Value type, SLV2Value symbol)
{
printf("\n\tGroup %s:\n", slv2_value_as_string(group));
+ printf("\t\tType: %s\n", slv2_value_as_string(type));
printf("\t\tSymbol: %s\n", slv2_value_as_string(symbol));
}
@@ -254,15 +255,17 @@ SELECT ?name WHERE { <> lv2p:hasPreset ?preset . ?preset dc:title ?name }");
SLV2Results groups = slv2_plugin_query_sparql(p, "\
PREFIX pg: <http://lv2plug.in/ns/dev/port-groups#> \
PREFIX dc: <http://dublincore.org/documents/dcmi-namespace/> \
-SELECT DISTINCT ?group ?sym WHERE {\n"
+SELECT DISTINCT ?group ?type ?sym WHERE {\n"
" <> lv2:port ?port .\n"
" ?port pg:inGroup ?group .\n"
-" ?group lv2:symbol ?sym .\n"
+" ?group rdf:type ?type ;\n"
+" lv2:symbol ?sym .\n"
"}");
for (; !slv2_results_finished(groups); slv2_results_next(groups)) {
SLV2Value group = slv2_results_get_binding_value(groups, 0);
- SLV2Value symbol = slv2_results_get_binding_value(groups, 1);
- print_group(p, group, symbol);
+ SLV2Value type = slv2_results_get_binding_value(groups, 1);
+ SLV2Value symbol = slv2_results_get_binding_value(groups, 2);
+ print_group(p, group, type, symbol);
}
slv2_results_free(groups);