diff options
Diffstat (limited to 'apps/plugins/pdbox/PDa/src/m_glob.c')
-rw-r--r-- | apps/plugins/pdbox/PDa/src/m_glob.c | 210 |
1 files changed, 210 insertions, 0 deletions
diff --git a/apps/plugins/pdbox/PDa/src/m_glob.c b/apps/plugins/pdbox/PDa/src/m_glob.c new file mode 100644 index 0000000000..5d62087b3c --- /dev/null +++ b/apps/plugins/pdbox/PDa/src/m_glob.c | |||
@@ -0,0 +1,210 @@ | |||
1 | /* Copyright (c) 1997-1999 Miller Puckette. | ||
2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL | ||
3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ | ||
4 | |||
5 | #include "m_pd.h" | ||
6 | #include "m_imp.h" | ||
7 | |||
8 | t_class *glob_pdobject; | ||
9 | static t_class *maxclass; | ||
10 | |||
11 | /* These "glob" routines, which implement messages to Pd, are from all | ||
12 | over. Some others are prototyped in m_imp.h as well. */ | ||
13 | |||
14 | void glob_setfilename(void *dummy, t_symbol *name, t_symbol *dir); | ||
15 | void glob_quit(void *dummy); | ||
16 | void glob_dsp(void *dummy, t_symbol *s, int argc, t_atom *argv); | ||
17 | void glob_meters(void *dummy, t_floatarg f); | ||
18 | void glob_key(void *dummy, t_symbol *s, int ac, t_atom *av); | ||
19 | void glob_audiostatus(void *dummy); | ||
20 | void glob_finderror(t_pd *dummy); | ||
21 | void glob_audio_properties(t_pd *dummy, t_floatarg flongform); | ||
22 | void glob_audio_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv); | ||
23 | void glob_audio_setapi(t_pd *dummy, t_floatarg f); | ||
24 | void glob_midi_properties(t_pd *dummy, t_floatarg flongform); | ||
25 | void glob_midi_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv); | ||
26 | void glob_start_path_dialog(t_pd *dummy, t_floatarg flongform); | ||
27 | void glob_path_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv); | ||
28 | void glob_ping(t_pd *dummy); | ||
29 | |||
30 | void alsa_resync( void); | ||
31 | |||
32 | |||
33 | #ifdef MSW | ||
34 | void glob_audio(void *dummy, t_floatarg adc, t_floatarg dac); | ||
35 | #endif | ||
36 | |||
37 | /* a method you add for debugging printout */ | ||
38 | void glob_foo(void *dummy, t_symbol *s, int argc, t_atom *argv); | ||
39 | |||
40 | #if 0 | ||
41 | void glob_foo(void *dummy, t_symbol *s, int argc, t_atom *argv) | ||
42 | { | ||
43 | *(int *)1 = 3; | ||
44 | } | ||
45 | #endif | ||
46 | |||
47 | void max_default(t_pd *x, t_symbol *s, int argc, t_atom *argv) | ||
48 | { | ||
49 | int i; | ||
50 | char str[80]; | ||
51 | startpost("%s: unknown message %s ", class_getname(pd_class(x)), | ||
52 | s->s_name); | ||
53 | for (i = 0; i < argc; i++) | ||
54 | { | ||
55 | atom_string(argv+i, str, 80); | ||
56 | poststring(str); | ||
57 | } | ||
58 | endpost(); | ||
59 | } | ||
60 | |||
61 | void glob_init(void) | ||
62 | { | ||
63 | maxclass = class_new(gensym("max"), 0, 0, sizeof(t_pd), | ||
64 | CLASS_DEFAULT, A_NULL); | ||
65 | class_addanything(maxclass, max_default); | ||
66 | pd_bind(&maxclass, gensym("max")); | ||
67 | |||
68 | glob_pdobject = class_new(gensym("pd"), 0, 0, sizeof(t_pd), | ||
69 | CLASS_DEFAULT, A_NULL); | ||
70 | class_addmethod(glob_pdobject, (t_method)glob_initfromgui, gensym("init"), | ||
71 | A_GIMME, 0); | ||
72 | class_addmethod(glob_pdobject, (t_method)glob_setfilename, gensym("filename"), | ||
73 | A_SYMBOL, A_SYMBOL, 0); | ||
74 | class_addmethod(glob_pdobject, (t_method)glob_evalfile, gensym("open"), | ||
75 | A_SYMBOL, A_SYMBOL, 0); | ||
76 | class_addmethod(glob_pdobject, (t_method)glob_quit, gensym("quit"), 0); | ||
77 | class_addmethod(glob_pdobject, (t_method)glob_foo, gensym("foo"), A_GIMME, 0); | ||
78 | class_addmethod(glob_pdobject, (t_method)glob_dsp, gensym("dsp"), A_GIMME, 0); | ||
79 | class_addmethod(glob_pdobject, (t_method)glob_meters, gensym("meters"), | ||
80 | A_FLOAT, 0); | ||
81 | class_addmethod(glob_pdobject, (t_method)glob_key, gensym("key"), A_GIMME, 0); | ||
82 | class_addmethod(glob_pdobject, (t_method)glob_audiostatus, | ||
83 | gensym("audiostatus"), 0); | ||
84 | class_addmethod(glob_pdobject, (t_method)glob_finderror, | ||
85 | gensym("finderror"), 0); | ||
86 | class_addmethod(glob_pdobject, (t_method)glob_audio_properties, | ||
87 | gensym("audio-properties"), A_DEFFLOAT, 0); | ||
88 | class_addmethod(glob_pdobject, (t_method)glob_audio_dialog, | ||
89 | gensym("audio-dialog"), A_GIMME, 0); | ||
90 | class_addmethod(glob_pdobject, (t_method)glob_audio_setapi, | ||
91 | gensym("audio-setapi"), A_FLOAT, 0); | ||
92 | class_addmethod(glob_pdobject, (t_method)glob_midi_properties, | ||
93 | gensym("midi-properties"), A_DEFFLOAT, 0); | ||
94 | class_addmethod(glob_pdobject, (t_method)glob_midi_dialog, | ||
95 | gensym("midi-dialog"), A_GIMME, 0); | ||
96 | class_addmethod(glob_pdobject, (t_method)glob_start_path_dialog, | ||
97 | gensym("start-path-dialog"), A_DEFFLOAT, 0); | ||
98 | class_addmethod(glob_pdobject, (t_method)glob_path_dialog, | ||
99 | gensym("path-dialog"), A_GIMME, 0); | ||
100 | #ifdef __linux__ | ||
101 | class_addmethod(glob_pdobject, (t_method)glob_ping, gensym("ping"), 0); | ||
102 | #endif | ||
103 | class_addanything(glob_pdobject, max_default); | ||
104 | pd_bind(&glob_pdobject, gensym("pd")); | ||
105 | } | ||
106 | /* Copyright (c) 1997-1999 Miller Puckette. | ||
107 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL | ||
108 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ | ||
109 | |||
110 | #include "m_pd.h" | ||
111 | #include "m_imp.h" | ||
112 | |||
113 | t_class *glob_pdobject; | ||
114 | static t_class *maxclass; | ||
115 | |||
116 | /* These "glob" routines, which implement messages to Pd, are from all | ||
117 | over. Some others are prototyped in m_imp.h as well. */ | ||
118 | |||
119 | void glob_setfilename(void *dummy, t_symbol *name, t_symbol *dir); | ||
120 | void glob_quit(void *dummy); | ||
121 | void glob_dsp(void *dummy, t_symbol *s, int argc, t_atom *argv); | ||
122 | void glob_meters(void *dummy, t_floatarg f); | ||
123 | void glob_key(void *dummy, t_symbol *s, int ac, t_atom *av); | ||
124 | void glob_audiostatus(void *dummy); | ||
125 | void glob_finderror(t_pd *dummy); | ||
126 | void glob_audio_properties(t_pd *dummy, t_floatarg flongform); | ||
127 | void glob_audio_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv); | ||
128 | void glob_audio_setapi(t_pd *dummy, t_floatarg f); | ||
129 | void glob_midi_properties(t_pd *dummy, t_floatarg flongform); | ||
130 | void glob_midi_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv); | ||
131 | void glob_start_path_dialog(t_pd *dummy, t_floatarg flongform); | ||
132 | void glob_path_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv); | ||
133 | void glob_ping(t_pd *dummy); | ||
134 | |||
135 | void alsa_resync( void); | ||
136 | |||
137 | |||
138 | #ifdef MSW | ||
139 | void glob_audio(void *dummy, t_floatarg adc, t_floatarg dac); | ||
140 | #endif | ||
141 | |||
142 | /* a method you add for debugging printout */ | ||
143 | void glob_foo(void *dummy, t_symbol *s, int argc, t_atom *argv); | ||
144 | |||
145 | #if 0 | ||
146 | void glob_foo(void *dummy, t_symbol *s, int argc, t_atom *argv) | ||
147 | { | ||
148 | *(int *)1 = 3; | ||
149 | } | ||
150 | #endif | ||
151 | |||
152 | void max_default(t_pd *x, t_symbol *s, int argc, t_atom *argv) | ||
153 | { | ||
154 | int i; | ||
155 | char str[80]; | ||
156 | startpost("%s: unknown message %s ", class_getname(pd_class(x)), | ||
157 | s->s_name); | ||
158 | for (i = 0; i < argc; i++) | ||
159 | { | ||
160 | atom_string(argv+i, str, 80); | ||
161 | poststring(str); | ||
162 | } | ||
163 | endpost(); | ||
164 | } | ||
165 | |||
166 | void glob_init(void) | ||
167 | { | ||
168 | maxclass = class_new(gensym("max"), 0, 0, sizeof(t_pd), | ||
169 | CLASS_DEFAULT, A_NULL); | ||
170 | class_addanything(maxclass, max_default); | ||
171 | pd_bind(&maxclass, gensym("max")); | ||
172 | |||
173 | glob_pdobject = class_new(gensym("pd"), 0, 0, sizeof(t_pd), | ||
174 | CLASS_DEFAULT, A_NULL); | ||
175 | class_addmethod(glob_pdobject, (t_method)glob_initfromgui, gensym("init"), | ||
176 | A_GIMME, 0); | ||
177 | class_addmethod(glob_pdobject, (t_method)glob_setfilename, gensym("filename"), | ||
178 | A_SYMBOL, A_SYMBOL, 0); | ||
179 | class_addmethod(glob_pdobject, (t_method)glob_evalfile, gensym("open"), | ||
180 | A_SYMBOL, A_SYMBOL, 0); | ||
181 | class_addmethod(glob_pdobject, (t_method)glob_quit, gensym("quit"), 0); | ||
182 | class_addmethod(glob_pdobject, (t_method)glob_foo, gensym("foo"), A_GIMME, 0); | ||
183 | class_addmethod(glob_pdobject, (t_method)glob_dsp, gensym("dsp"), A_GIMME, 0); | ||
184 | class_addmethod(glob_pdobject, (t_method)glob_meters, gensym("meters"), | ||
185 | A_FLOAT, 0); | ||
186 | class_addmethod(glob_pdobject, (t_method)glob_key, gensym("key"), A_GIMME, 0); | ||
187 | class_addmethod(glob_pdobject, (t_method)glob_audiostatus, | ||
188 | gensym("audiostatus"), 0); | ||
189 | class_addmethod(glob_pdobject, (t_method)glob_finderror, | ||
190 | gensym("finderror"), 0); | ||
191 | class_addmethod(glob_pdobject, (t_method)glob_audio_properties, | ||
192 | gensym("audio-properties"), A_DEFFLOAT, 0); | ||
193 | class_addmethod(glob_pdobject, (t_method)glob_audio_dialog, | ||
194 | gensym("audio-dialog"), A_GIMME, 0); | ||
195 | class_addmethod(glob_pdobject, (t_method)glob_audio_setapi, | ||
196 | gensym("audio-setapi"), A_FLOAT, 0); | ||
197 | class_addmethod(glob_pdobject, (t_method)glob_midi_properties, | ||
198 | gensym("midi-properties"), A_DEFFLOAT, 0); | ||
199 | class_addmethod(glob_pdobject, (t_method)glob_midi_dialog, | ||
200 | gensym("midi-dialog"), A_GIMME, 0); | ||
201 | class_addmethod(glob_pdobject, (t_method)glob_start_path_dialog, | ||
202 | gensym("start-path-dialog"), A_DEFFLOAT, 0); | ||
203 | class_addmethod(glob_pdobject, (t_method)glob_path_dialog, | ||
204 | gensym("path-dialog"), A_GIMME, 0); | ||
205 | #ifdef __linux__ | ||
206 | class_addmethod(glob_pdobject, (t_method)glob_ping, gensym("ping"), 0); | ||
207 | #endif | ||
208 | class_addanything(glob_pdobject, max_default); | ||
209 | pd_bind(&glob_pdobject, gensym("pd")); | ||
210 | } | ||