From 6aed9cfedbddf9c20486db51a1952958c78d4acf Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Wed, 27 Jan 2010 23:29:44 +0200 Subject: [PATCH] lv2: better gobject properties Use lv2:symbol as a base for the property name and lv2:name for nick and blurb. --- ext/lv2/gstlv2.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ext/lv2/gstlv2.c b/ext/lv2/gstlv2.c index 2436238106..c604ace979 100644 --- a/ext/lv2/gstlv2.c +++ b/ext/lv2/gstlv2.c @@ -375,15 +375,22 @@ gst_lv2_base_init (gpointer g_class) } static gchar * -gst_lv2_class_get_param_name (GstLV2Class * klass, gint portnum) +gst_lv2_class_get_param_name (GstLV2Class * klass, SLV2Port port) { SLV2Plugin lv2plugin = klass->plugin; - SLV2Port port = slv2_plugin_get_port_by_index (lv2plugin, portnum); return g_strdup (slv2_value_as_string (slv2_port_get_symbol (lv2plugin, port))); } +static gchar * +gst_lv2_class_get_param_nick (GstLV2Class * klass, SLV2Port port) +{ + SLV2Plugin lv2plugin = klass->plugin; + + return g_strdup (slv2_value_as_string (slv2_port_get_name (lv2plugin, port))); +} + static GParamSpec * gst_lv2_class_get_param_spec (GstLV2Class * klass, gint portnum) { @@ -395,8 +402,8 @@ gst_lv2_class_get_param_spec (GstLV2Class * klass, gint portnum) gint perms; gfloat lower = 0.0f, upper = 1.0f, def = 0.0f; - nick = gst_lv2_class_get_param_name (klass, portnum); - name = g_strdup (nick); + nick = gst_lv2_class_get_param_nick (klass, port); + name = gst_lv2_class_get_param_name (klass, port); g_strcanon (name, G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-", '-'); if (!((name[0] >= 'a' && name[0] <= 'z') || (name[0] >= 'A' && name[0] <= 'Z'))) {