aboutsummaryrefslogtreecommitdiff
path: root/invert.c
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2003-07-30 21:52:27 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2003-07-30 21:52:27 +0000
commitc8f3e3674f08bf56407e478c3160c4392196c118 (patch)
treec02a0612aa9172c4ee8557ecc5626020a2d4d4b8 /invert.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 'invert.c')
-rw-r--r--invert.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/invert.c b/invert.c
new file mode 100644
index 0000000..0b15ec3
--- /dev/null
+++ b/invert.c
@@ -0,0 +1,41 @@
+/*
+ * 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"
+
+/* -------------------------- invert ------------------------------ */
+
+/* instance structure */
+
+static t_class *invert_class;
+
+typedef struct _invert
+{
+ t_object x_obj; /* obligatory object header */
+ t_outlet *t_out1; /* the outlet */
+} t_invert;
+
+static void invert_float(t_invert *x, t_floatarg n)
+{
+ if (n) outlet_float(x->t_out1, 0.f);
+ else outlet_float(x->t_out1, 1.f);
+}
+
+static void *invert_new(t_symbol *s) /* init vals in struc */
+{
+ t_invert *x = (t_invert *)pd_new(invert_class);
+ x->t_out1 = outlet_new(&x->x_obj, 0);
+ return(x);
+}
+
+void invert_setup(void)
+{
+ invert_class = class_new(gensym("invert"), (t_newmethod)invert_new, 0,
+ sizeof(t_invert), 0, A_NULL);
+ class_addfloat(invert_class, (t_method)invert_float);
+
+ class_sethelpsymbol(invert_class, gensym("help-invert"));
+}