diff options
author | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2005-06-02 18:25:00 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2005-06-02 18:25:00 +0000 |
commit | 0c9b89b1018eb7760708ee5b080cd96846861328 (patch) | |
tree | f43a2b20292bba90931fe84e67aca8fb0013a984 /src/iemlib1/split.c | |
parent | d56ec9d039c904e9230137254ff2fe281320eed9 (diff) |
updated to release-1.16
svn path=/trunk/externals/iemlib/; revision=3102
Diffstat (limited to 'src/iemlib1/split.c')
-rw-r--r-- | src/iemlib1/split.c | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/src/iemlib1/split.c b/src/iemlib1/split.c index 7716054..ed98568 100644 --- a/src/iemlib1/split.c +++ b/src/iemlib1/split.c @@ -1,54 +1,54 @@ -/* For information on usage and redistribution, and for a DISCLAIMER OF ALL -* WARRANTIES, see the file, "LICENSE.txt," in this distribution. - -iemlib1 written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2003 */ - -#ifdef NT -#pragma warning( disable : 4244 ) -#pragma warning( disable : 4305 ) -#endif - - -#include "m_pd.h" -#include "iemlib.h" -#include <math.h> -#include <stdio.h> -#include <string.h> - -/* --------------------------- split ----------------------------- */ - -typedef struct _split -{ - t_object x_obj; - t_outlet *x_out_less; - t_outlet *x_out_greater_equal; - float x_threshold; -} t_split; - -static t_class *split_class; - -static void split_float(t_split *x, t_float f) -{ - if(f < x->x_threshold) - outlet_float(x->x_out_less, f); - else - outlet_float(x->x_out_greater_equal, f); -} - -static void *split_new(t_floatarg f) -{ - t_split *x = (t_split *)pd_new(split_class); - floatinlet_new(&x->x_obj, &x->x_threshold); - x->x_out_less = outlet_new(&x->x_obj, &s_float); - x->x_out_greater_equal = outlet_new(&x->x_obj, &s_float); - x->x_threshold = f; - return (x); -} - -void split_setup(void) -{ - split_class = class_new(gensym("split"), (t_newmethod)split_new, 0, - sizeof(t_split), 0, A_DEFFLOAT, 0); - class_addfloat(split_class, split_float); - class_sethelpsymbol(split_class, gensym("iemhelp/help-split")); -} +/* For information on usage and redistribution, and for a DISCLAIMER OF ALL
+* WARRANTIES, see the file, "LICENSE.txt," in this distribution.
+
+iemlib1 written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */
+
+#ifdef NT
+#pragma warning( disable : 4244 )
+#pragma warning( disable : 4305 )
+#endif
+
+
+#include "m_pd.h"
+#include "iemlib.h"
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+
+/* --------- split is like moses ----------- */
+
+typedef struct _split
+{
+ t_object x_obj;
+ t_outlet *x_out_less;
+ t_outlet *x_out_greater_equal;
+ float x_threshold;
+} t_split;
+
+static t_class *split_class;
+
+static void split_float(t_split *x, t_float f)
+{
+ if(f < x->x_threshold)
+ outlet_float(x->x_out_less, f);
+ else
+ outlet_float(x->x_out_greater_equal, f);
+}
+
+static void *split_new(t_floatarg f)
+{
+ t_split *x = (t_split *)pd_new(split_class);
+ floatinlet_new(&x->x_obj, &x->x_threshold);
+ x->x_out_less = outlet_new(&x->x_obj, &s_float);
+ x->x_out_greater_equal = outlet_new(&x->x_obj, &s_float);
+ x->x_threshold = f;
+ return (x);
+}
+
+void split_setup(void)
+{
+ split_class = class_new(gensym("split"), (t_newmethod)split_new, 0,
+ sizeof(t_split), 0, A_DEFFLOAT, 0);
+ class_addfloat(split_class, split_float);
+ class_sethelpsymbol(split_class, gensym("iemhelp/help-split"));
+}
|