1
/******************************************************
3
* zexy - implementation file
5
* copyleft (c) IOhannes m zm�lnig
7
* 1999:forum::f�r::uml�ute:2004
9
* institute of electronic music and acoustics (iem)
11
******************************************************
13
* license: GNU General Public License v.2
15
******************************************************/
17
/* hack : 2108:forum::f�r::uml�ute:1999 @ iem */
22
/* =================== tabset ====================== */
24
static t_class *tabset_class;
26
typedef struct _tabset
29
t_symbol *x_arrayname;
32
static void tabset_float(t_tabset *x, t_floatarg f)
38
if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class)))
39
error("%s: no such array", x->x_arrayname->s_name);
40
else if (!zarray_getarray(A, &npoints, &vec))
41
error("%s: bad template for tabset", x->x_arrayname->s_name);
44
zarray_setfloat(vec, 0, f);
51
static void tabset_list(t_tabset *x, t_symbol *s, int argc, t_atom* argv)
58
if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class)))
59
error("%s: no such array", x->x_arrayname->s_name);
60
else if (!zarray_getarray(A, &npoints, &vec))
61
error("%s: bad template for tabset", x->x_arrayname->s_name);
65
t_float f= atom_getfloat(argv++);
66
zarray_setfloat(vec, 0, f);
72
t_float f= atom_getfloat(argv++);
73
zarray_setfloat(vec, 0, f);
77
zarray_setfloat(vec, 0, 0);
84
static void tabset_set(t_tabset *x, t_symbol *s)
89
static void *tabset_new(t_symbol *s)
91
t_tabset *x = (t_tabset *)pd_new(tabset_class);
97
static void tabset_helper(void)
99
post("\n%c tabset - object : set a table with a package of floats", HEARTSYMBOL);
100
post("'set <table>'\t: set another table\n"
101
"<list>\t\t: set the table"
102
"<float>\t\t: set the table to constant float\n");
103
post("creation\t: \"tabset <table>\"");
106
void tabset_setup(void)
108
tabset_class = class_new(gensym("tabset"), (t_newmethod)tabset_new,
109
0, sizeof(t_tabset), 0, A_DEFSYM, 0);
110
class_addfloat(tabset_class, (t_method)tabset_float);
111
class_addlist (tabset_class, (t_method)tabset_list);
112
class_addmethod(tabset_class, (t_method)tabset_set, gensym("set"),
115
class_addmethod(tabset_class, (t_method)tabset_helper, gensym("help"), 0);
116
zexy_register("tabset");