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/snapshot~.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/snapshot~.c')
-rw-r--r-- | apps/plugins/pdbox/PDa/intern/snapshot~.c | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/apps/plugins/pdbox/PDa/intern/snapshot~.c b/apps/plugins/pdbox/PDa/intern/snapshot~.c index f63aeb76cd..cd3557a3df 100644 --- a/apps/plugins/pdbox/PDa/intern/snapshot~.c +++ b/apps/plugins/pdbox/PDa/intern/snapshot~.c | |||
@@ -55,60 +55,4 @@ void snapshot_tilde_setup(void) | |||
55 | gensym("set"), A_DEFFLOAT, 0); | 55 | gensym("set"), A_DEFFLOAT, 0); |
56 | class_addbang(snapshot_tilde_class, snapshot_tilde_bang); | 56 | class_addbang(snapshot_tilde_class, snapshot_tilde_bang); |
57 | } | 57 | } |
58 | #include <m_pd.h> | ||
59 | #include <m_fixed.h> | ||
60 | |||
61 | |||
62 | static t_class *snapshot_tilde_class; | ||
63 | |||
64 | typedef struct _snapshot | ||
65 | { | ||
66 | t_object x_obj; | ||
67 | t_sample x_value; | ||
68 | float x_f; | ||
69 | } t_snapshot; | ||
70 | |||
71 | static void *snapshot_tilde_new(void) | ||
72 | { | ||
73 | t_snapshot *x = (t_snapshot *)pd_new(snapshot_tilde_class); | ||
74 | x->x_value = 0; | ||
75 | outlet_new(&x->x_obj, &s_float); | ||
76 | x->x_f = 0; | ||
77 | return (x); | ||
78 | } | ||
79 | |||
80 | static t_int *snapshot_tilde_perform(t_int *w) | ||
81 | { | ||
82 | t_sample *in = (t_sample *)(w[1]); | ||
83 | t_sample *out = (t_sample *)(w[2]); | ||
84 | *out = *in; | ||
85 | return (w+3); | ||
86 | } | ||
87 | |||
88 | static void snapshot_tilde_dsp(t_snapshot *x, t_signal **sp) | ||
89 | { | ||
90 | dsp_add(snapshot_tilde_perform, 2, sp[0]->s_vec + (sp[0]->s_n-1), | ||
91 | &x->x_value); | ||
92 | } | ||
93 | |||
94 | static void snapshot_tilde_bang(t_snapshot *x) | ||
95 | { | ||
96 | outlet_float(x->x_obj.ob_outlet, fixtof(x->x_value)); | ||
97 | } | ||
98 | |||
99 | static void snapshot_tilde_set(t_snapshot *x, t_floatarg f) | ||
100 | { | ||
101 | x->x_value = ftofix(f); | ||
102 | } | ||
103 | 58 | ||
104 | void snapshot_tilde_setup(void) | ||
105 | { | ||
106 | snapshot_tilde_class = class_new(gensym("snapshot~"), snapshot_tilde_new, 0, | ||
107 | sizeof(t_snapshot), 0, 0); | ||
108 | CLASS_MAINSIGNALIN(snapshot_tilde_class, t_snapshot, x_f); | ||
109 | class_addmethod(snapshot_tilde_class, (t_method)snapshot_tilde_dsp, | ||
110 | gensym("dsp"), 0); | ||
111 | class_addmethod(snapshot_tilde_class, (t_method)snapshot_tilde_set, | ||
112 | gensym("set"), A_DEFFLOAT, 0); | ||
113 | class_addbang(snapshot_tilde_class, snapshot_tilde_bang); | ||
114 | } | ||