synth_if.m revision 158979
1#-
2# (c) 2003 Mathew Kanner
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: 1. Redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer. 2.
8# Redistributions in binary form must reproduce the above copyright notice,
9# this list of conditions and the following disclaimer in the documentation
10# and/or other materials provided with the distribution.
11#
12# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
13# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
15# DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
16# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
18# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
19# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22# SUCH DAMAGE.
23#
24# $FreeBSD: head/sys/dev/sound/midi/synth_if.m 158979 2006-05-27 16:32:05Z netchild $
25#
26
27INTERFACE synth;
28
29#include <sys/systm.h>
30
31CODE {
32
33synth_killnote_t nokillnote;
34synth_startnote_t nostartnote;
35synth_setinstr_t nosetinstr;
36synth_hwcontrol_t nohwcontrol;
37synth_aftertouch_t noaftertouch;
38synth_panning_t nopanning;
39synth_controller_t nocontroller;
40synth_volumemethod_t novolumemethod;
41synth_bender_t nobender;
42synth_setupvoice_t nosetupvoice;
43synth_sendsysex_t nosendsysex;
44synth_allocvoice_t noallocvoice;
45synth_writeraw_t nowriteraw;
46synth_reset_t noreset;
47synth_shortname_t noshortname;
48synth_open_t noopen;
49synth_close_t noclose;
50synth_query_t noquery;
51synth_insync_t noinsync;
52synth_alloc_t noalloc;
53
54    int
55	nokillnote(void *_kobj, uint8_t _chn, uint8_t _note, uint8_t _vel)
56	{
57	    printf("nokillnote\n");
58	    return 0;
59	}
60
61    int
62	noopen(void *_kobj, void *_arg, int mode)
63	{
64	    printf("noopen\n");
65	    return 0;
66	}
67
68    int
69	noquery(void *_kboj)
70	{
71	    printf("noquery\n");
72	    return 0;
73	}
74
75    int
76	nostartnote(void *_kb, uint8_t _voice, uint8_t _note, uint8_t _parm)
77	{
78	    printf("nostartnote\n");
79	    return 0;
80	}
81
82    int
83	nosetinstr(void *_kb, uint8_t _chn, uint16_t _patchno)
84	{
85	    printf("nosetinstr\n");
86	    return 0;
87	}
88
89    int
90	nohwcontrol(void *_kb, uint8_t *_event)
91	{
92	    printf("nohwcontrol\n");
93	    return 0;
94	}
95
96    int 
97	noaftertouch ( void /* X */ * _kobj, uint8_t _x1, uint8_t _x2)
98	{
99	    printf("noaftertouch\n");
100	    return 0;
101	}
102
103    int
104	nopanning ( void /* X */ * _kobj, uint8_t _x1, uint8_t _x2)
105	{
106	    printf("nopanning\n");
107	    return 0;
108	}
109
110    int 
111	nocontroller ( void /* X */ * _kobj, uint8_t _x1, uint8_t _x2, uint16_t _x3)
112	{
113	    printf("nocontroller\n");
114	    return 0;
115	}
116
117    int 
118	novolumemethod (
119		void /* X */ * _kobj,
120		uint8_t _x1)
121	{
122	    printf("novolumemethod\n");
123	    return 0;
124	}
125
126    int 
127	nobender ( void /* X */ * _kobj, uint8_t _voice, uint16_t _bend)
128	{
129	    printf("nobender\n");
130	    return 0;
131	}
132
133    int 
134	nosetupvoice ( void /* X */ * _kobj, uint8_t _voice, uint8_t _chn)
135	{
136
137	    printf("nosetupvoice\n");
138	    return 0;
139	}
140
141    int 
142	nosendsysex ( void /* X */ * _kobj, void * _buf, size_t _len)
143	{
144	    printf("nosendsysex\n");
145	    return 0;
146	}
147
148    int 
149	noallocvoice ( void /* X */ * _kobj, uint8_t _chn, uint8_t _note, void *_x)
150	{
151	    printf("noallocvoice\n");
152	    return 0;
153	}
154
155    int 
156	nowriteraw ( void /* X */ * _kobjt, uint8_t * _buf, size_t _len)
157	{
158	    printf("nowriteraw\n");
159	    return 1;
160	}
161
162    int 
163	noreset ( void /* X */ * _kobjt)
164	{
165
166	    printf("noreset\n");
167	    return 0;
168	}
169
170    char *
171	noshortname (void /* X */ * _kobjt)
172	{
173	    printf("noshortname\n");
174	    return "noshortname";
175	}
176
177    int 
178	noclose ( void /* X */ * _kobjt)
179	{
180
181	    printf("noclose\n");
182	    return 0;
183	}
184
185    int
186	noinsync (void /* X */ * _kobjt)
187	{
188
189	    printf("noinsync\n");
190	    return 0;
191	}
192
193    int 
194	noalloc ( void /* x */ * _kbojt, uint8_t _chn, uint8_t _note)
195	{
196	    printf("noalloc\n");
197	    return 0;
198	}
199}
200
201METHOD int killnote {
202    void /* X */ * _kobj;
203    uint8_t _chan;
204    uint8_t _note;
205    uint8_t _vel;
206} DEFAULT nokillnote;
207
208METHOD int startnote {
209    void /* X */ * _kobj;
210    uint8_t _voice;
211    uint8_t _note;
212    uint8_t _parm;
213} DEFAULT nostartnote;
214
215METHOD int setinstr {
216    void /* X */ * _kobj;
217    uint8_t _chn;
218    uint16_t _patchno;
219} DEFAULT nosetinstr;
220
221METHOD int hwcontrol {
222    void /* X */ * _kobj;
223    uint8_t *_event;
224} DEFAULT nohwcontrol;
225
226METHOD int aftertouch {
227    void /* X */ * _kobj;
228    uint8_t _x1;
229    uint8_t _x2;
230} DEFAULT noaftertouch;
231
232METHOD int panning {
233    void /* X */ * _kobj;
234    uint8_t _x1;
235        uint8_t _x2;
236} DEFAULT nopanning;
237
238METHOD int controller {
239    void /* X */ * _kobj;
240    uint8_t _x1;
241    uint8_t _x2;
242    uint16_t _x3;
243} DEFAULT nocontroller;
244
245METHOD int volumemethod {
246    void /* X */ * _kobj;
247    uint8_t _x1;
248} DEFAULT novolumemethod;
249
250METHOD int bender {
251    void /* X */ * _kobj;
252    uint8_t _voice;
253    uint16_t _bend;
254} DEFAULT nobender;
255
256METHOD int setupvoice {
257    void /* X */ * _kobj;
258    uint8_t _voice;
259    uint8_t _chn;
260} DEFAULT nosetupvoice;
261
262METHOD int sendsysex {
263    void /* X */ * _kobj;
264    void * _buf;
265    size_t _len;
266} DEFAULT nosendsysex;
267
268METHOD int allocvoice {
269    void /* X */ * _kobj;
270    uint8_t _chn;
271    uint8_t _note;
272    void *_x;
273} DEFAULT noallocvoice;
274
275METHOD int writeraw {
276    void /* X */ * _kobjt;
277    uint8_t * _buf;
278    size_t _len;
279} DEFAULT nowriteraw;
280
281METHOD int reset {
282    void /* X */ * _kobjt;
283} DEFAULT noreset;
284
285METHOD char * shortname {
286    void /* X */ * _kobjt;
287} DEFAULT noshortname;
288
289METHOD int open {
290    void /* X */ * _kobjt;
291    void * _sythn;
292    int _mode;
293} DEFAULT noopen;
294
295METHOD int close {
296    void /* X */ * _kobjt;
297} DEFAULT noclose;
298
299METHOD int query {
300    void /* X */ * _kobjt;
301} DEFAULT noquery;
302
303METHOD int insync {
304    void /* X */ * _kobjt;
305} DEFAULT noinsync;
306
307METHOD int alloc {
308    void /* x */ * _kbojt;
309    uint8_t _chn;
310    uint8_t _note;
311} DEFAULT noalloc;
312