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/print~.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/print~.c')
-rw-r--r-- | apps/plugins/pdbox/PDa/intern/print~.c | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/apps/plugins/pdbox/PDa/intern/print~.c b/apps/plugins/pdbox/PDa/intern/print~.c index 3051ca37be..699555a1bc 100644 --- a/apps/plugins/pdbox/PDa/intern/print~.c +++ b/apps/plugins/pdbox/PDa/intern/print~.c | |||
@@ -76,81 +76,4 @@ void print_tilde_setup(void) | |||
76 | class_addbang(print_class, print_bang); | 76 | class_addbang(print_class, print_bang); |
77 | class_addfloat(print_class, print_float); | 77 | class_addfloat(print_class, print_float); |
78 | } | 78 | } |
79 | #include <m_pd.h> | ||
80 | #include <m_fixed.h> | ||
81 | |||
82 | static t_class *print_class; | ||
83 | |||
84 | typedef struct _print | ||
85 | { | ||
86 | t_object x_obj; | ||
87 | float x_f; | ||
88 | t_symbol *x_sym; | ||
89 | int x_count; | ||
90 | } t_print; | ||
91 | 79 | ||
92 | static t_int *print_perform(t_int *w) | ||
93 | { | ||
94 | t_print *x = (t_print *)(w[1]); | ||
95 | t_sample *in = (t_sample *)(w[2]); | ||
96 | int n = (int)(w[3]); | ||
97 | if (x->x_count) | ||
98 | { | ||
99 | post("%s:", x->x_sym->s_name); | ||
100 | if (n == 1) post("%8g", in[0]); | ||
101 | else if (n == 2) post("%8g %8g", in[0], in[1]); | ||
102 | else if (n == 4) post("%8g %8g %8g %8g", | ||
103 | in[0], in[1], in[2], in[3]); | ||
104 | else while (n > 0) | ||
105 | { | ||
106 | post("%-8.5g %-8.5g %-8.5g %-8.5g %-8.5g %-8.5g %-8.5g %-8.5g", | ||
107 | fixtof(in[0]), | ||
108 | fixtof(in[1]), | ||
109 | fixtof(in[2]), | ||
110 | fixtof(in[3]), | ||
111 | fixtof(in[4]), | ||
112 | fixtof(in[5]), | ||
113 | fixtof(in[6]), | ||
114 | fixtof(in[7])); | ||
115 | n -= 8; | ||
116 | in += 8; | ||
117 | } | ||
118 | x->x_count--; | ||
119 | } | ||
120 | return (w+4); | ||
121 | } | ||
122 | |||
123 | static void print_dsp(t_print *x, t_signal **sp) | ||
124 | { | ||
125 | dsp_add(print_perform, 3, x, sp[0]->s_vec, sp[0]->s_n); | ||
126 | } | ||
127 | |||
128 | static void print_float(t_print *x, t_float f) | ||
129 | { | ||
130 | if (f < 0) f = 0; | ||
131 | x->x_count = f; | ||
132 | } | ||
133 | |||
134 | static void print_bang(t_print *x) | ||
135 | { | ||
136 | x->x_count = 1; | ||
137 | } | ||
138 | |||
139 | static void *print_new(t_symbol *s) | ||
140 | { | ||
141 | t_print *x = (t_print *)pd_new(print_class); | ||
142 | x->x_sym = (s->s_name[0]? s : gensym("print~")); | ||
143 | x->x_count = 0; | ||
144 | x->x_f = 0; | ||
145 | return (x); | ||
146 | } | ||
147 | |||
148 | void print_tilde_setup(void) | ||
149 | { | ||
150 | print_class = class_new(gensym("print~"), (t_newmethod)print_new, 0, | ||
151 | sizeof(t_print), 0, A_DEFSYM, 0); | ||
152 | CLASS_MAINSIGNALIN(print_class, t_print, x_f); | ||
153 | class_addmethod(print_class, (t_method)print_dsp, gensym("dsp"), 0); | ||
154 | class_addbang(print_class, print_bang); | ||
155 | class_addfloat(print_class, print_float); | ||
156 | } | ||