Now making use of new utf8 support when using Curses::UI
[mirrors/Programs.git] / puredata / 6.externs / obj3.c
CommitLineData
21c4e167
H
1/* code for the "obj3" pd class. This adds an outlet and a state variable. */
2
3#include "m_pd.h"
4
5typedef struct obj3
6{
7 t_object x_ob;
8 t_outlet *x_outlet;
9 float x_value;
10} t_obj3;
11
12void obj3_float(t_obj3 *x, t_floatarg f)
13{
14 outlet_float(x->x_outlet, f + x->x_value);
15}
16
17void obj3_ft1(t_obj3 *x, t_floatarg g)
18{
19 x->x_value = g;
20}
21
22t_class *obj3_class;
23
24void *obj3_new(void)
25{
26 t_obj3 *x = (t_obj3 *)pd_new(obj3_class);
27 inlet_new(&x->x_ob, &x->x_ob.ob_pd, gensym("float"), gensym("ft1"));
28 x->x_outlet = outlet_new(&x->x_ob, gensym("float"));
29 return (void *)x;
30}
31
32void obj3_setup(void)
33{
34 obj3_class = class_new(gensym("obj3"), (t_newmethod)obj3_new,
35 0, sizeof(t_obj3), 0, 0);
36 class_addmethod(obj3_class, (t_method)obj3_ft1, gensym("ft1"), A_FLOAT, 0);
37 class_addfloat(obj3_class, obj3_float);
38}
39
This page took 0.246849 seconds and 4 git commands to generate.