changed sign
[mirrors/Programs.git] / puredata / 6.externs / obj2.c
1 /* code for the "obj2" pd class. This one, in addition to the "obj1"
2 code, has an inlet taking numbers. */
3
4 #include "m_pd.h"
5
6 typedef struct obj2
7 {
8 t_object x_ob;
9 } t_obj2;
10
11 void obj2_float(t_obj2 *x, t_floatarg f)
12 {
13 post("obj2: %f", f);
14 }
15
16 void obj2_rats(t_obj2 *x)
17 {
18 post("obj2: rats");
19 }
20
21 void obj2_ft1(t_obj2 *x, t_floatarg g)
22 {
23 post("ft1: %f", g);
24 }
25
26 t_class *obj2_class;
27
28 void *obj2_new(void)
29 {
30 t_obj2 *x = (t_obj2 *)pd_new(obj2_class);
31 inlet_new(&x->x_ob, &x->x_ob.ob_pd, gensym("float"), gensym("ft1"));
32 post("obj2_new");
33 return (void *)x;
34 }
35
36 void obj2_setup(void)
37 {
38 post("obj2_setup");
39 obj2_class = class_new(gensym("obj2"), (t_newmethod)obj2_new,
40 0, sizeof(t_obj2), 0, 0);
41 class_addmethod(obj2_class, (t_method)obj2_rats, gensym("rats"), 0);
42 class_addmethod(obj2_class, (t_method)obj2_ft1, gensym("ft1"), A_FLOAT, 0);
43 class_addfloat(obj2_class, obj2_float);
44 }
45
This page took 1.796979 seconds and 4 git commands to generate.