aboutsummaryrefslogtreecommitdiff
path: root/src/z_nop.c
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2005-03-22 20:58:25 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2005-03-22 20:58:25 +0000
commit2b60d55c919e7588f5aff15936e83c300b3660bb (patch)
tree14d860de7f28083d3756ad91b627de70f26788f6 /src/z_nop.c
parentc500bc542cb7cc78d6dac3f7da3bff626056b1aa (diff)
zexy-2.0:
- use of abstractions for objects that allow it - some objects are build both as externals and abstractions (as slower fallbacks) - code-layout is now 1:1 c-file<->object (this should allow for building of zexy as a collection of externals instead as a big library) - matrix-objects have moved to iemmatrix !! svn path=/trunk/externals/zexy/; revision=2641
Diffstat (limited to 'src/z_nop.c')
-rw-r--r--src/z_nop.c78
1 files changed, 0 insertions, 78 deletions
diff --git a/src/z_nop.c b/src/z_nop.c
deleted file mode 100644
index 6fa6ac0..0000000
--- a/src/z_nop.c
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "zexy.h"
-#ifdef NT
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-
-/* ------------------------ nop~ ----------------------------- */
-/* this will pass trough the signal unchanged except for a delay of 1 block */
-
-static t_class *nop_class;
-
-typedef struct _nop
-{
- t_object x_obj;
- t_float *buf;
- int n;
- int toggle;
-} t_nop;
-
-static t_int *nop_perform(t_int *w)
-{
- t_float *in = (t_float *)w[1];
- t_float *out = (t_float *)w[2];
- t_nop *x = (t_nop *)w[3];
- int n = x->n;
- t_float *rp = x->buf + n * x->toggle, *wp = x->buf + n * (x->toggle ^= 1);
-
- while (n--) {
- *wp++ = *in++;
- *out++ = *rp++;
- }
-
- return (w+4);
-}
-
-static void nop_dsp(t_nop *x, t_signal **sp)
-{
- if (x->n != sp[0]->s_n)
- {
- freebytes(x->buf, x->n * 2 * sizeof(t_float));
-
- x->buf = (t_float *)getbytes(sizeof(t_float) * 2 * (x->n = sp[0]->s_n));
- }
- dsp_add(nop_perform, 3, sp[0]->s_vec, sp[1]->s_vec, x);
-}
-
-static void helper(t_nop *x)
-{
- post("%c nop~-object ::\tdo_nothing but delay a signal for 1 block\n"
- "\t\t this might be helpful for synchronising signals", HEARTSYMBOL);
-}
-
-static void nop_free(t_nop *x)
-{
- freebytes(x->buf, x->n * sizeof(t_float));
-}
-
-
-static void *nop_new()
-{
- t_nop *x = (t_nop *)pd_new(nop_class);
- outlet_new(&x->x_obj, gensym("signal"));
- x->toggle = 0;
- x->n = 0;
-
- return (x);
-}
-
-void z_nop_setup(void)
-{
- nop_class = class_new(gensym("nop~"), (t_newmethod)nop_new, (t_method)nop_free,
- sizeof(t_nop), 0, A_DEFFLOAT, 0);
- class_addmethod(nop_class, nullfn, gensym("signal"), 0);
- class_addmethod(nop_class, (t_method)nop_dsp, gensym("dsp"), 0);
-
- class_addmethod(nop_class, (t_method)helper, gensym("help"), 0);
- class_sethelpsymbol(nop_class, gensym("zexy/nop~"));
-}