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