1#ifndef __SOUND_SFNT_INFO_H
2#define __SOUND_SFNT_INFO_H
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25#include <sound/asound.h>
26
27
28
29
30
31#ifdef SNDRV_BIG_ENDIAN
32#define SNDRV_OSS_PATCHKEY(id) (0xfd00|id)
33#else
34#define SNDRV_OSS_PATCHKEY(id) ((id<<8)|0xfd)
35#endif
36
37
38struct soundfont_patch_info {
39 unsigned short key;
40#define SNDRV_OSS_SOUNDFONT_PATCH SNDRV_OSS_PATCHKEY(0x07)
41
42 short device_no;
43 unsigned short sf_id;
44 short optarg;
45 int len;
46
47 short type;
48#define SNDRV_SFNT_LOAD_INFO 0
49#define SNDRV_SFNT_LOAD_DATA 1
50#define SNDRV_SFNT_OPEN_PATCH 2
51#define SNDRV_SFNT_CLOSE_PATCH 3
52
53#define SNDRV_SFNT_REPLACE_DATA 5
54#define SNDRV_SFNT_MAP_PRESET 6
55
56#define SNDRV_SFNT_PROBE_DATA 8
57#define SNDRV_SFNT_REMOVE_INFO 9
58
59 short reserved;
60
61
62};
63
64
65
66
67
68
69#define SNDRV_SFNT_PATCH_NAME_LEN 32
70
71struct soundfont_open_parm {
72 unsigned short type;
73#define SNDRV_SFNT_PAT_TYPE_MISC 0
74#define SNDRV_SFNT_PAT_TYPE_GUS 6
75#define SNDRV_SFNT_PAT_TYPE_MAP 7
76#define SNDRV_SFNT_PAT_LOCKED 0x100
77#define SNDRV_SFNT_PAT_SHARED 0x200
78
79 short reserved;
80 char name[SNDRV_SFNT_PATCH_NAME_LEN];
81};
82
83
84
85
86
87
88
89struct soundfont_voice_parm {
90 unsigned short moddelay;
91 unsigned short modatkhld;
92 unsigned short moddcysus;
93 unsigned short modrelease;
94 short modkeyhold, modkeydecay;
95 unsigned short voldelay;
96 unsigned short volatkhld;
97 unsigned short voldcysus;
98 unsigned short volrelease;
99 short volkeyhold, volkeydecay;
100 unsigned short lfo1delay;
101 unsigned short lfo2delay;
102 unsigned short pefe;
103 unsigned short fmmod;
104 unsigned short tremfrq;
105 unsigned short fm2frq2;
106 unsigned char cutoff;
107 unsigned char filterQ;
108 unsigned char chorus;
109 unsigned char reverb;
110 unsigned short reserved[4];
111};
112
113
114
115struct soundfont_voice_info {
116 unsigned short sf_id;
117 unsigned short sample;
118 int start, end;
119 int loopstart, loopend;
120 short rate_offset;
121 unsigned short mode;
122#define SNDRV_SFNT_MODE_ROMSOUND 0x8000
123#define SNDRV_SFNT_MODE_STEREO 1
124#define SNDRV_SFNT_MODE_LOOPING 2
125#define SNDRV_SFNT_MODE_NORELEASE 4
126#define SNDRV_SFNT_MODE_INIT_PARM 8
127
128 short root;
129 short tune;
130 unsigned char low, high;
131 unsigned char vellow, velhigh;
132 signed char fixkey, fixvel;
133 signed char pan, fixpan;
134 short exclusiveClass;
135 unsigned char amplitude;
136 unsigned char attenuation;
137 short scaleTuning;
138 struct soundfont_voice_parm parm;
139 unsigned short sample_mode;
140};
141
142
143
144struct soundfont_voice_rec_hdr {
145 unsigned char bank;
146 unsigned char instr;
147 char nvoices;
148 char write_mode;
149#define SNDRV_SFNT_WR_APPEND 0
150#define SNDRV_SFNT_WR_EXCLUSIVE 1
151#define SNDRV_SFNT_WR_REPLACE 2
152};
153
154
155
156
157
158
159
160struct soundfont_sample_info {
161 unsigned short sf_id;
162 unsigned short sample;
163 int start, end;
164 int loopstart, loopend;
165 int size;
166 short dummy;
167 unsigned short mode_flags;
168#define SNDRV_SFNT_SAMPLE_8BITS 1
169#define SNDRV_SFNT_SAMPLE_UNSIGNED 2
170#define SNDRV_SFNT_SAMPLE_NO_BLANK 4
171#define SNDRV_SFNT_SAMPLE_SINGLESHOT 8
172#define SNDRV_SFNT_SAMPLE_BIDIR_LOOP 16
173#define SNDRV_SFNT_SAMPLE_STEREO_LEFT 32
174#define SNDRV_SFNT_SAMPLE_STEREO_RIGHT 64
175#define SNDRV_SFNT_SAMPLE_REVERSE_LOOP 128
176 unsigned int truesize;
177};
178
179
180
181
182
183
184struct soundfont_voice_map {
185 int map_bank, map_instr, map_key;
186 int src_bank, src_instr, src_key;
187};
188
189
190
191
192
193
194#define SNDRV_EMUX_HWDEP_NAME "Emux WaveTable"
195
196#define SNDRV_EMUX_VERSION ((1 << 16) | (0 << 8) | 0)
197
198struct snd_emux_misc_mode {
199 int port;
200 int mode;
201 int value;
202 int value2;
203};
204
205#define SNDRV_EMUX_IOCTL_VERSION _IOR('H', 0x80, unsigned int)
206#define SNDRV_EMUX_IOCTL_LOAD_PATCH _IOWR('H', 0x81, struct soundfont_patch_info)
207#define SNDRV_EMUX_IOCTL_RESET_SAMPLES _IO('H', 0x82)
208#define SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES _IO('H', 0x83)
209#define SNDRV_EMUX_IOCTL_MEM_AVAIL _IOW('H', 0x84, int)
210#define SNDRV_EMUX_IOCTL_MISC_MODE _IOWR('H', 0x84, struct snd_emux_misc_mode)
211
212#endif
213