From f35d4d43ea0291df1edf6fb3d3b0e6638b60de76 Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Tue, 10 May 2016 21:11:41 -0700 Subject: [PATCH] lv2: add classification from metadata This helps apps to structure the element collection. --- ext/lv2/gstlv2utils.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ext/lv2/gstlv2utils.c b/ext/lv2/gstlv2utils.c index fca3a1c..589f6c5 100644 --- a/ext/lv2/gstlv2utils.c +++ b/ext/lv2/gstlv2utils.c @@ -311,7 +311,9 @@ gst_lv2_element_class_set_metadata (GstLV2Class * lv2_class, { LilvPlugin *lv2plugin = lv2_class->plugin; LilvNode *val; - gchar *longname, *author; + const LilvPluginClass *lv2plugin_class; + const LilvNode *cval; + gchar *longname, *author, *class_tags = NULL; val = lilv_plugin_get_name (lv2plugin); if (val) { @@ -328,10 +330,18 @@ gst_lv2_element_class_set_metadata (GstLV2Class * lv2_class, author = g_strdup ("no author available"); } - gst_element_class_set_metadata (elem_class, longname, lv2_class_tags, - longname, author); + lv2plugin_class = lilv_plugin_get_class (lv2plugin); + cval = lilv_plugin_class_get_label (lv2plugin_class); + if (cval) { + class_tags = g_strconcat (lv2_class_tags, "/", lilv_node_as_string (cval), + NULL); + } + + gst_element_class_set_metadata (elem_class, longname, + (class_tags ? class_tags : lv2_class_tags), longname, author); g_free (longname); g_free (author); + g_free (class_tags); } -- 2.7.4