summaryrefslogtreecommitdiffstats
path: root/ext/ladspa
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2002-01-10 01:17:29 +0000
committerAndy Wingo <wingo@pobox.com>2002-01-10 01:17:29 +0000
commitcce1fb13d6d0adbdad4a3711130dbbe0789e8acd (patch)
tree547bad5278247f9658a649687f2c49e8ac94c54f /ext/ladspa
parent58394455d88fb5a844b03f48148c13373eaf1ba7 (diff)
fix glib2's complaining on the params of some plugins there's still some work to be done: s/-$//g; && s/\(.*$//;
Original commit message from CVS: fix glib2's complaining on the params of some plugins there's still some work to be done: s/-$//g; && s/\(.*$//;
Diffstat (limited to 'ext/ladspa')
-rw-r--r--ext/ladspa/gstladspa.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/ext/ladspa/gstladspa.c b/ext/ladspa/gstladspa.c
index e605ec34..b83f0268 100644
--- a/ext/ladspa/gstladspa.c
+++ b/ext/ladspa/gstladspa.c
@@ -119,7 +119,7 @@ gst_ladspa_class_init (GstLADSPAClass *klass)
gint hintdesc;
gint argtype,argperms;
GParamSpec *paramspec = NULL;
- gchar *argname;
+ gchar *argname, *tempstr;
gobject_class = (GObjectClass*)klass;
gstelement_class = (GstElementClass*)klass;
@@ -254,10 +254,16 @@ gst_ladspa_class_init (GstLADSPAClass *klass)
klass->control_info[i].name = g_strdup(desc->PortNames[current_portnum]);
argname = g_strdup(klass->control_info[i].name);
- // this is the same thing that param_spec_* will do
+ /* this is the same thing that param_spec_* will do */
g_strcanon (argname, G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-", '-');
+ /* satisfy glib2 (argname[0] must be [A-Za-z]) */
+ if (!((argname[0] >= 'a' && argname[0] <= 'z') || (argname[0] >= 'A' && argname[0] <= 'Z'))) {
+ tempstr = argname;
+ argname = g_strconcat("param-", argname, NULL);
+ g_free (tempstr);
+ }
- // check for duplicate property names
+ /* check for duplicate property names */
if (g_object_class_find_property(G_OBJECT_CLASS(klass), argname) != NULL){
gint numarg=1;
gchar *numargname = g_strdup_printf("%s_%d",argname,numarg++);
@@ -268,6 +274,8 @@ gst_ladspa_class_init (GstLADSPAClass *klass)
argname = numargname;
}
+ g_print("adding arg %s from %s\n",argname, klass->control_info[i].name);
+
if (argtype==G_TYPE_BOOLEAN){
paramspec = g_param_spec_boolean(argname,argname,argname, FALSE, argperms);
} else if (argtype==G_TYPE_INT){
@@ -278,9 +286,8 @@ gst_ladspa_class_init (GstLADSPAClass *klass)
klass->control_info[i].lowerbound, klass->control_info[i].upperbound,
(klass->control_info[i].lowerbound + klass->control_info[i].upperbound) / 2.0f, argperms);
}
- g_object_class_install_property(G_OBJECT_CLASS(klass), i+ARG_LAST, paramspec);
- g_print("added arg %s from %s\n",argname, klass->control_info[i].name);
+ g_object_class_install_property(G_OBJECT_CLASS(klass), i+ARG_LAST, paramspec);
}
}