1 /* code for the "obj4" pd class. This adds a creation argument, of
13 void obj4_float(t_obj4
*x
, t_floatarg f
)
15 outlet_float(x
->x_outlet
, x
->x_value
+ f
);
18 void obj4_ft1(t_obj4
*x
, t_floatarg g
)
25 /* as requested by the new invocation of "class_new" below, the new
26 routine will be called with a "float" argument. */
27 void *obj4_new(t_floatarg f
)
29 t_obj4
*x
= (t_obj4
*)pd_new(obj4_class
);
30 inlet_new(&x
->x_ob
, &x
->x_ob
.ob_pd
, gensym("float"), gensym("ft1"));
31 x
->x_outlet
= outlet_new(&x
->x_ob
, gensym("float"));
32 /* just stick the argument in the object structure for later. */
39 /* here we add "A_DEFFLOAT" to the (zero-terminated) list of arg
40 types we declare for a new object. The value will be filled
41 in as 0 if not given in the object box. */
42 obj4_class
= class_new(gensym("obj4"), (t_newmethod
)obj4_new
,
43 0, sizeof(t_obj4
), 0, A_DEFFLOAT
, 0);
44 class_addmethod(obj4_class
, (t_method
)obj4_ft1
, gensym("ft1"), A_FLOAT
, 0);
45 class_addfloat(obj4_class
, obj4_float
);
This page took 0.53645 seconds and 4 git commands to generate.