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