aboutsummaryrefslogtreecommitdiff
path: root/henon.c
diff options
context:
space:
mode:
authorB. Bogart <bbogart@users.sourceforge.net>2002-08-29 17:06:09 +0000
committerB. Bogart <bbogart@users.sourceforge.net>2002-08-29 17:06:09 +0000
commitdd5a86efe9a9f6ed8278a5a5a3927c6a80bbbf90 (patch)
tree464982414c09dc955dff3c3a114993766d64a16d /henon.c
parent48c014742612aa874fc736a5be3ab43e1091fa45 (diff)
Updated makefile and setup single library, win32, linux, OSX
svn path=/trunk/externals/bbogart/chaos/; revision=96
Diffstat (limited to 'henon.c')
-rw-r--r--henon.c87
1 files changed, 42 insertions, 45 deletions
diff --git a/henon.c b/henon.c
index 21dbad1..54cf4e2 100644
--- a/henon.c
+++ b/henon.c
@@ -25,20 +25,20 @@
#include "m_pd.h"
#include <math.h>
-t_class *myclass;
+t_class *henon_class;
-typedef struct thisismystruct
+typedef struct henon_struct
{
- t_object myobj;
- double a,b,lx0,ly0;
+ t_object henon_obj;
+ double a, b, lx0, ly0;
t_outlet *y_outlet;
-} mystruct;
+} henon_struct;
-static void calculate(mystruct *x)
+static void calculate(henon_struct *x)
{
- double lx0,ly0,lx1,ly1;
- double a,b;
-
+ double lx0, ly0, lx1, ly1;
+ double a, b;
+
a = x->a;
b = x->b;
lx0 = x->lx0;
@@ -49,62 +49,59 @@ static void calculate(mystruct *x)
x->lx0 = lx1;
x->ly0 = ly1;
- outlet_float(x->myobj.ob_outlet, (t_float)lx1);
+ outlet_float(x->henon_obj.ob_outlet, (t_float)lx1);
outlet_float(x->y_outlet, (t_float)ly1);
}
-static void reset(mystruct *x)
+static void reset(henon_struct *x)
{
x->lx0 = 1;
- x->ly0 = 1;
+ x->ly0 = 1;
}
-static void param(mystruct *x, t_floatarg a, t_floatarg b)
+static void param(henon_struct *x, t_floatarg a, t_floatarg b)
{
- x->a = (double)a;
- x->b = (double)b;
+ x->a = (double)a;
+ x->b = (double)b;
}
void *henon_new(void)
{
- mystruct *x = (mystruct *)pd_new(myclass);
+ henon_struct *x = (henon_struct *)pd_new(henon_class);
x->a = 1.4;
x->b = 0.3;
x->lx0 = 1;
x->ly0 = 1;
- outlet_new(&x->myobj, &s_float); /* Default float outlet */
- x->y_outlet = outlet_new(&x->myobj, &s_float); /* New Outlet */
- return (void *)x;
+ outlet_new(&x->henon_obj, &s_float); /* Default float outlet */
+ x->y_outlet = outlet_new(&x->henon_obj, &s_float); /* New Outlet */
+
+ return (void *)x;
}
void henon_setup(void)
{
- post("-------------------------"); /* Copyright info */
- post("Chaos PD Externals");
- post("Copyright Ben Bogart 2002");
- post("-------------------------");
-
- myclass = class_new(gensym("henon"), /* symname is the symbolic name */
- (t_newmethod)henon_new, /* Constructor Function */
- 0, /* Destructor Function */
- sizeof(mystruct), /* Size of the structure */
- CLASS_DEFAULT, /* Graphical Representation */
- 0); /* 0 Terminates Argument List */
-
- class_addbang(myclass, (t_method)calculate);
- class_addmethod(myclass,
- (t_method)reset,
- gensym("reset"),
- 0);
-
- class_addmethod(myclass,
- (t_method)param,
- gensym("param"),
- A_DEFFLOAT,
- A_DEFFLOAT,
- 0);
+ post("henon");
+
+ henon_class = class_new(gensym("henon"), /* symname is the symbolic name */
+ (t_newmethod)henon_new, /* Constructor Function */
+ 0, /* Destructor Function */
+ sizeof(henon_struct), /* Size of the structure */
+ CLASS_DEFAULT, /* Graphical Representation */
+ 0); /* 0 Terminates Argument List */
+
+ class_addbang(henon_class, (t_method)calculate);
+
+ class_addmethod(henon_class,
+ (t_method)reset,
+ gensym("reset"),
+ 0);
+
+ class_addmethod(henon_class,
+ (t_method)param,
+ gensym("param"),
+ A_DEFFLOAT,
+ A_DEFFLOAT,
+ 0);
}
-
-