diff options
author | Peter D'Hoye <peter.dhoye@gmail.com> | 2009-05-24 21:28:16 +0000 |
---|---|---|
committer | Peter D'Hoye <peter.dhoye@gmail.com> | 2009-05-24 21:28:16 +0000 |
commit | 526b5580dabbfed7cfe5439dc3a90ec727f563c2 (patch) | |
tree | 22b1af92348785daad16714ee5e2b633017e0e48 /apps/plugins/pdbox/PDa/intern/tabreceive~.c | |
parent | 4f2dfcc01b260d946044ef2b6af5fe36cb772c8d (diff) | |
download | rockbox-526b5580dabbfed7cfe5439dc3a90ec727f563c2.tar.gz rockbox-526b5580dabbfed7cfe5439dc3a90ec727f563c2.zip |
Cut the files in half and it might work better (note to self: check your tree is really clean before patching)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21070 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/pdbox/PDa/intern/tabreceive~.c')
-rw-r--r-- | apps/plugins/pdbox/PDa/intern/tabreceive~.c | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/apps/plugins/pdbox/PDa/intern/tabreceive~.c b/apps/plugins/pdbox/PDa/intern/tabreceive~.c index 82f2ff388a..e51a5c015e 100644 --- a/apps/plugins/pdbox/PDa/intern/tabreceive~.c +++ b/apps/plugins/pdbox/PDa/intern/tabreceive~.c | |||
@@ -59,64 +59,3 @@ void tabreceive_tilde_setup(void) | |||
59 | gensym("dsp"), 0); | 59 | gensym("dsp"), 0); |
60 | } | 60 | } |
61 | 61 | ||
62 | #include <m_pd.h> | ||
63 | #include <m_fixed.h> | ||
64 | |||
65 | static t_class *tabreceive_class; | ||
66 | |||
67 | typedef struct _tabreceive | ||
68 | { | ||
69 | t_object x_obj; | ||
70 | t_sample *x_vec; | ||
71 | t_symbol *x_arrayname; | ||
72 | } t_tabreceive; | ||
73 | |||
74 | static t_int *tabreceive_perform(t_int *w) | ||
75 | { | ||
76 | t_tabreceive *x = (t_tabreceive *)(w[1]); | ||
77 | t_sample *out = (t_sample *)(w[2]); | ||
78 | int n = w[3]; | ||
79 | t_sample *from = x->x_vec; | ||
80 | if (from) while (n--) *out++ = *from++; | ||
81 | else while (n--) *out++ = 0; | ||
82 | return (w+4); | ||
83 | } | ||
84 | |||
85 | static void tabreceive_dsp(t_tabreceive *x, t_signal **sp) | ||
86 | { | ||
87 | t_garray *a; | ||
88 | int vecsize; | ||
89 | |||
90 | if (!(a = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class))) | ||
91 | { | ||
92 | if (*x->x_arrayname->s_name) | ||
93 | error("tabsend~: %s: no such array", x->x_arrayname->s_name); | ||
94 | } | ||
95 | else if (!garray_getfloatarray(a, &vecsize, &x->x_vec)) | ||
96 | error("%s: bad template for tabreceive~", x->x_arrayname->s_name); | ||
97 | else | ||
98 | { | ||
99 | int n = sp[0]->s_n; | ||
100 | if (n < vecsize) vecsize = n; | ||
101 | garray_usedindsp(a); | ||
102 | dsp_add(tabreceive_perform, 3, x, sp[0]->s_vec, vecsize); | ||
103 | } | ||
104 | } | ||
105 | |||
106 | static void *tabreceive_new(t_symbol *s) | ||
107 | { | ||
108 | t_tabreceive *x = (t_tabreceive *)pd_new(tabreceive_class); | ||
109 | x->x_arrayname = s; | ||
110 | outlet_new(&x->x_obj, &s_signal); | ||
111 | return (x); | ||
112 | } | ||
113 | |||
114 | void tabreceive_tilde_setup(void) | ||
115 | { | ||
116 | tabreceive_class = class_new(gensym("tabreceive~"), | ||
117 | (t_newmethod)tabreceive_new, 0, | ||
118 | sizeof(t_tabreceive), 0, A_DEFSYM, 0); | ||
119 | class_addmethod(tabreceive_class, (t_method)tabreceive_dsp, | ||
120 | gensym("dsp"), 0); | ||
121 | } | ||
122 | |||