diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2003-07-30 21:52:27 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2003-07-30 21:52:27 +0000 |
commit | c8f3e3674f08bf56407e478c3160c4392196c118 (patch) | |
tree | c02a0612aa9172c4ee8557ecc5626020a2d4d4b8 /gem_change.c |
separated out all objects into individual files; created a few missing help files; moves all help files to new 0.37 help- standard; removed [reson~] and [abs~] since they are now maintained elsewhere; created Makefile for Linux and Darwinsvn2git-root
svn path=/trunk/externals/markex/; revision=806
Diffstat (limited to 'gem_change.c')
-rw-r--r-- | gem_change.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/gem_change.c b/gem_change.c new file mode 100644 index 0000000..a577868 --- /dev/null +++ b/gem_change.c @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1997-1999 Mark Danks. + * For information on usage and redistribution, and for a DISCLAIMER OF ALL + * WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. + */ + +#include "m_pd.h" + +/* -------------------------- gem_change ------------------------------ */ + +/* instance structure */ + +static t_class *gem_change_class; + +typedef struct _gem_change +{ + t_object x_obj; /* obligatory object header */ + float x_cur; + t_outlet *t_out1; /* the outlet */ +} t_gem_change; + +static void gem_change_float(t_gem_change *x, t_floatarg n) +{ + if (n != x->x_cur) + { + outlet_float(x->t_out1, n); + x->x_cur = n; + } +} + +static void *gem_change_new(void) /* init vals in struc */ +{ + t_gem_change *x = (t_gem_change *)pd_new(gem_change_class); + x->x_cur = -1.f; + x->t_out1 = outlet_new(&x->x_obj, 0); + return(x); +} + +void gem_change_setup(void) +{ + gem_change_class = class_new(gensym("gem_change"), (t_newmethod)gem_change_new, 0, + sizeof(t_gem_change), 0, A_NULL); + class_addfloat(gem_change_class, gem_change_float); + + class_sethelpsymbol(gem_change_class, gensym("help-gem_change")); +} |