1 /* code for "obj1" pd class. This takes two messages: floating-point
2 numbers, and "rats", and just prints something out for each message. */
6 /* the data structure for each copy of "obj1". In this case we
7 on;y need pd's obligatory header (of type t_object). */
13 /* this is called back when obj1 gets a "float" message (i.e., a
15 void obj1_float(t_obj1
*x
, t_floatarg f
)
20 /* this is called when obj1 gets the message, "rats". */
21 void obj1_rats(t_obj1
*x
)
26 /* this is a pointer to the class for "obj1", which is created in the
27 "setup" routine below and used to create new ones in the "new" routine. */
30 /* this is called when a new "obj1" object is created. */
33 t_obj1
*x
= (t_obj1
*)pd_new(obj1_class
);
38 /* this is called once at setup time, when this code is loaded into Pd. */
42 obj1_class
= class_new(gensym("obj1"), (t_newmethod
)obj1_new
, 0,
43 sizeof(t_obj1
), 0, 0);
44 class_addmethod(obj1_class
, (t_method
)obj1_rats
, gensym("rats"), 0);
45 class_addfloat(obj1_class
, obj1_float
);
This page took 0.82592 seconds and 4 git commands to generate.