aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormusil <tmusil@users.sourceforge.net>2007-11-08 15:56:12 +0000
committermusil <tmusil@users.sourceforge.net>2007-11-08 15:56:12 +0000
commita6dc408c46f8f4010aaff171786c1749f3598cc5 (patch)
tree9ff987e0159865c6557952a3b3e719fff6d3700c
parentb192b092e159ce9b3274f667cc8280fcbc543bed (diff)
add old method set_item_name to make it compatible
svn path=/trunk/externals/iemlib/; revision=8969
-rw-r--r--iemlib2/src/iem_sel_any.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/iemlib2/src/iem_sel_any.c b/iemlib2/src/iem_sel_any.c
index 2a00b49..8ab34fa 100644
--- a/iemlib2/src/iem_sel_any.c
+++ b/iemlib2/src/iem_sel_any.c
@@ -68,6 +68,29 @@ static void iem_sel_any_add(t_iem_sel_any *x, t_symbol *s, int ac, t_atom *av)
}
}
+static void iem_sel_any_set_item_name(t_iem_sel_any *x, t_symbol *s, int ac, t_atom *av)
+{
+ if((ac >= 2) && (IS_A_FLOAT(av, 1)))
+ {
+ int i = (int)atom_getintarg(1, ac, av);
+
+ if((i >= 0) && (i < x->x_max_ac))
+ {
+ if(IS_A_SYMBOL(av, 0))
+ x->x_any[i] = atom_getsymbolarg(0, ac, av);
+ else if(IS_A_FLOAT(av, 0))
+ {
+ char str[100];
+
+ sprintf(str, "%g", atom_getfloatarg(0, ac, av));
+ x->x_any[i] = gensym(str);
+ }
+ if(i >= x->x_ac)
+ x->x_ac = i+1;
+ }
+ }
+}
+
static void iem_sel_any_clear(t_iem_sel_any *x)
{
x->x_ac = 0;
@@ -102,6 +125,7 @@ void iem_sel_any_setup(void)
iem_sel_any_class = class_new(gensym("iem_sel_any"), (t_newmethod)iem_sel_any_new,
(t_method)iem_sel_any_free, sizeof(t_iem_sel_any), 0, A_DEFFLOAT, 0);
class_addmethod(iem_sel_any_class, (t_method)iem_sel_any_add, gensym("add"), A_GIMME, 0);
+ class_addmethod(iem_sel_any_class, (t_method)iem_sel_any_set_item_name, gensym("set_item_name"), A_GIMME, 0);
class_addmethod(iem_sel_any_class, (t_method)iem_sel_any_clear, gensym("clear"), 0);
class_addfloat(iem_sel_any_class, (t_method)iem_sel_any_float);
// class_sethelpsymbol(iem_sel_any_class, gensym("iemhelp/help-iem_sel_any"));