diff options
author | Thomas O Fredericks <mrtof@users.sourceforge.net> | 2009-09-30 18:52:19 +0000 |
---|---|---|
committer | Thomas O Fredericks <mrtof@users.sourceforge.net> | 2009-09-30 18:52:19 +0000 |
commit | 82c0f9c8e917102c29dc0f3fbdb5183781305fef (patch) | |
tree | 97606e799a0e66792bcd7fc5cd3666212e04aea5 /test | |
parent | bd6957bd624da4ee9d99da0cced28d144da67f6f (diff) |
Fools, put~ and get~ are now part of tof
svn path=/trunk/externals/tof/; revision=12500
Diffstat (limited to 'test')
-rw-r--r-- | test/get~.c | 93 | ||||
-rw-r--r-- | test/put~.c | 89 |
2 files changed, 0 insertions, 182 deletions
diff --git a/test/get~.c b/test/get~.c deleted file mode 100644 index 4d6356d..0000000 --- a/test/get~.c +++ /dev/null @@ -1,93 +0,0 @@ -#include "putget~.h" - -static t_class *get_tilde_class; - -typedef struct _get_tilde { - t_object x_obj; - t_sample f_put; - struct putget* pg; - t_sample f; -} t_get_tilde; - -t_int *get_tilde_perform(t_int *w) -{ - t_get_tilde *x = (t_get_tilde *)(w[1]); - t_sample *out = (t_sample *)(w[2]); - int n = (int)(w[3]); - - if ( x->pg) { - - putget_arm( x->pg); - - - t_sample *samples = x->pg->r; - - while (n--) { - *out++ = *samples++; - } - } else { - while (n--) { - *out++ = 0; - } - } - - return (w+4); -} - -static void get_tilde_set(t_get_tilde *x, t_symbol* s) { - - if (gensym("") != s ) { - if ( x->pg ) { - if ( x->pg->name != s) { - putget_unregister(x->pg,0); - x->pg = putget_register(s,0); - } - } else { - x->pg = putget_register(s,0); - } - } - -} - -void get_tilde_dsp(t_get_tilde *x, t_signal **sp) -{ - - if ( sp[0]->s_n == 64 ) { - dsp_add(get_tilde_perform, 3, x,sp[0]->s_vec, sp[0]->s_n); - } else { - pd_error(x,"get~ only works with a block size of 64"); - } -} - -static void get_tilde_free( t_get_tilde *x) { - - if (x->pg) putget_unregister(x->pg,0); -} - - -void *get_tilde_new(t_symbol* s) -{ - t_get_tilde *x = (t_get_tilde *)pd_new(get_tilde_class); - - - if (gensym("") != s ) x->pg = putget_register(s,0); - - outlet_new(&x->x_obj, &s_signal); - - return (void *)x; -} - -void get_tilde_setup(void) { - get_tilde_class = class_new(gensym("get~"), - (t_newmethod)get_tilde_new, - (t_method)get_tilde_free, sizeof(t_get_tilde), - CLASS_DEFAULT, - A_DEFSYMBOL, 0); - - class_addmethod(get_tilde_class, - (t_method)get_tilde_set, gensym("set"), A_SYMBOL, 0); - - class_addmethod(get_tilde_class, - (t_method)get_tilde_dsp, gensym("dsp"), 0); - //CLASS_MAINSIGNALIN(get_tilde_class, t_get_tilde, f); -} diff --git a/test/put~.c b/test/put~.c deleted file mode 100644 index 9074888..0000000 --- a/test/put~.c +++ /dev/null @@ -1,89 +0,0 @@ -#include "putget~.h" - -static t_class *put_tilde_class; - -typedef struct _put_tilde { - t_object x_obj; - //t_sample f_put; - struct putget* pg; - t_sample f; -} t_put_tilde; - -static t_int* put_tilde_perform(t_int *w) -{ - - t_put_tilde *x = (t_put_tilde *)(w[1]); - - if (x->pg && (x->pg->users > x->pg->writers)) { - t_sample *in = (t_sample *)(w[2]); - int n = (int)(w[3]); - t_sample *samples = x->pg->w; - - while (n--) { - *samples = *samples + *in; - samples++; in++; - } - - } - return (w+4); -} - - -static void put_tilde_set(t_put_tilde *x, t_symbol* s) { - - if (gensym("") != s ) { - if ( x->pg ) { - if ( x->pg->name != s) { - putget_unregister(x->pg,1); - x->pg = putget_register(s,1); - } - } else { - x->pg = putget_register(s,1); - } - } - -} - - -static void put_tilde_dsp(t_put_tilde *x, t_signal **sp) -{ - - if ( (int) sp[0]->s_n == 64 ) { - dsp_add(put_tilde_perform, 3, x,sp[0]->s_vec, sp[0]->s_n); - - } else { - error("put~ only works with a block size of 64"); - } - -} - -static void put_tilde_free( t_put_tilde *x) { - - if (x->pg) putget_unregister(x->pg,1); -} - - -static void *put_tilde_new(t_symbol* s) -{ - t_put_tilde *x = (t_put_tilde *)pd_new(put_tilde_class); - - if (gensym("") != s ) x->pg = putget_register(s,1); - - - return (void *)x; -} - -void put_tilde_setup(void) { - put_tilde_class = class_new(gensym("put~"), - (t_newmethod)put_tilde_new, - (t_method)put_tilde_free, sizeof(t_put_tilde), - 0, A_DEFSYM, 0); - - class_addmethod(put_tilde_class, - (t_method)put_tilde_dsp, gensym("dsp"), 0); - - class_addmethod(put_tilde_class, - (t_method)put_tilde_set, gensym("set"), A_SYMBOL, 0); - - CLASS_MAINSIGNALIN(put_tilde_class, t_put_tilde, f); -} |