]>
Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | #ifndef __SOUND_WAVEFRONT_H__ |
2 | #define __SOUND_WAVEFRONT_H__ | |
3 | ||
4 | /* | |
5 | * Driver for Turtle Beach Wavefront cards (Maui,Tropez,Tropez+) | |
6 | * | |
7 | * Copyright (c) by Paul Barton-Davis <[email protected]> | |
8 | * | |
9 | * This program is free software; you can redistribute it and/or modify | |
10 | * it under the terms of the GNU General Public License as published by | |
11 | * the Free Software Foundation; either version 2 of the License, or | |
12 | * (at your option) any later version. | |
13 | * | |
14 | * This program is distributed in the hope that it will be useful, | |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | * GNU General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
20 | * along with this program; if not, write to the Free Software | |
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
22 | */ | |
23 | ||
24 | #if (!defined(__GNUC__) && !defined(__GNUG__)) | |
25 | ||
26 | You will not be able to compile this file correctly without gcc, because | |
27 | it is necessary to pack the "wavefront_alias" structure to a size | |
28 | of 22 bytes, corresponding to 16-bit alignment (as would have been | |
29 | the case on the original platform, MS-DOS). If this is not done, | |
30 | then WavePatch-format files cannot be read/written correctly. | |
31 | The method used to do this here ("__attribute__((packed)") is | |
32 | completely compiler dependent. | |
33 | ||
34 | All other wavefront_* types end up aligned to 32 bit values and | |
35 | still have the same (correct) size. | |
36 | ||
37 | #else | |
38 | ||
39 | /* However, note that as of G++ 2.7.3.2, g++ was unable to | |
40 | correctly parse *type* __attribute__ tags. It will do the | |
41 | right thing if we use the "packed" attribute on each struct | |
42 | member, which has the same semantics anyway. | |
43 | */ | |
44 | ||
45 | #endif /* __GNUC__ */ | |
46 | ||
47 | /***************************** WARNING ******************************** | |
48 | PLEASE DO NOT MODIFY THIS FILE IN ANY WAY THAT AFFECTS ITS ABILITY TO | |
49 | BE USED WITH EITHER C *OR* C++. | |
50 | **********************************************************************/ | |
51 | ||
52 | #ifndef NUM_MIDIKEYS | |
53 | #define NUM_MIDIKEYS 128 | |
54 | #endif /* NUM_MIDIKEYS */ | |
55 | ||
56 | #ifndef NUM_MIDICHANNELS | |
57 | #define NUM_MIDICHANNELS 16 | |
58 | #endif /* NUM_MIDICHANNELS */ | |
59 | ||
60 | /* These are very useful/important. the original wavefront interface | |
61 | was developed on a 16 bit system, where sizeof(int) = 2 | |
62 | bytes. Defining things like this makes the code much more portable, and | |
63 | easier to understand without having to toggle back and forth | |
64 | between a 16-bit view of the world and a 32-bit one. | |
65 | */ | |
66 | ||
67 | #ifndef __KERNEL__ | |
68 | /* keep them for compatibility */ | |
69 | typedef short s16; | |
70 | typedef unsigned short u16; | |
71 | typedef int s32; | |
72 | typedef unsigned int u32; | |
73 | typedef char s8; | |
74 | typedef unsigned char u8; | |
75 | typedef s16 INT16; | |
76 | typedef u16 UINT16; | |
77 | typedef s32 INT32; | |
78 | typedef u32 UINT32; | |
79 | typedef s8 CHAR8; | |
80 | typedef u8 UCHAR8; | |
81 | #endif | |
82 | ||
83 | /* Pseudo-commands not part of the WaveFront command set. | |
84 | These are used for various driver controls and direct | |
85 | hardware control. | |
86 | */ | |
87 | ||
88 | #define WFC_DEBUG_DRIVER 0 | |
89 | #define WFC_FX_IOCTL 1 | |
90 | #define WFC_PATCH_STATUS 2 | |
91 | #define WFC_PROGRAM_STATUS 3 | |
92 | #define WFC_SAMPLE_STATUS 4 | |
93 | #define WFC_DISABLE_INTERRUPTS 5 | |
94 | #define WFC_ENABLE_INTERRUPTS 6 | |
95 | #define WFC_INTERRUPT_STATUS 7 | |
96 | #define WFC_ROMSAMPLES_RDONLY 8 | |
97 | #define WFC_IDENTIFY_SLOT_TYPE 9 | |
98 | ||
99 | /* Wavefront synth commands | |
100 | */ | |
101 | ||
102 | #define WFC_DOWNLOAD_SAMPLE 0x80 | |
103 | #define WFC_DOWNLOAD_BLOCK 0x81 | |
104 | #define WFC_DOWNLOAD_MULTISAMPLE 0x82 | |
105 | #define WFC_DOWNLOAD_SAMPLE_ALIAS 0x83 | |
106 | #define WFC_DELETE_SAMPLE 0x84 | |
107 | #define WFC_REPORT_FREE_MEMORY 0x85 | |
108 | #define WFC_DOWNLOAD_PATCH 0x86 | |
109 | #define WFC_DOWNLOAD_PROGRAM 0x87 | |
110 | #define WFC_SET_SYNTHVOL 0x89 | |
111 | #define WFC_SET_NVOICES 0x8B | |
112 | #define WFC_DOWNLOAD_DRUM 0x90 | |
113 | #define WFC_GET_SYNTHVOL 0x92 | |
114 | #define WFC_GET_NVOICES 0x94 | |
115 | #define WFC_DISABLE_CHANNEL 0x9A | |
116 | #define WFC_ENABLE_CHANNEL 0x9B | |
117 | #define WFC_MISYNTH_OFF 0x9D | |
118 | #define WFC_MISYNTH_ON 0x9E | |
119 | #define WFC_FIRMWARE_VERSION 0x9F | |
120 | #define WFC_GET_NSAMPLES 0xA0 | |
121 | #define WFC_DISABLE_DRUM_PROGRAM 0xA2 | |
122 | #define WFC_UPLOAD_PATCH 0xA3 | |
123 | #define WFC_UPLOAD_PROGRAM 0xA4 | |
124 | #define WFC_SET_TUNING 0xA6 | |
125 | #define WFC_GET_TUNING 0xA7 | |
126 | #define WFC_VMIDI_ON 0xA8 | |
127 | #define WFC_VMIDI_OFF 0xA9 | |
128 | #define WFC_MIDI_STATUS 0xAA | |
129 | #define WFC_GET_CHANNEL_STATUS 0xAB | |
130 | #define WFC_DOWNLOAD_SAMPLE_HEADER 0xAC | |
131 | #define WFC_UPLOAD_SAMPLE_HEADER 0xAD | |
132 | #define WFC_UPLOAD_MULTISAMPLE 0xAE | |
133 | #define WFC_UPLOAD_SAMPLE_ALIAS 0xAF | |
134 | #define WFC_IDENTIFY_SAMPLE_TYPE 0xB0 | |
135 | #define WFC_DOWNLOAD_EDRUM_PROGRAM 0xB1 | |
136 | #define WFC_UPLOAD_EDRUM_PROGRAM 0xB2 | |
137 | #define WFC_SET_EDRUM_CHANNEL 0xB3 | |
138 | #define WFC_INSTOUT_LEVELS 0xB4 | |
139 | #define WFC_PEAKOUT_LEVELS 0xB5 | |
140 | #define WFC_REPORT_CHANNEL_PROGRAMS 0xB6 | |
141 | #define WFC_HARDWARE_VERSION 0xCF | |
142 | #define WFC_UPLOAD_SAMPLE_PARAMS 0xD7 | |
143 | #define WFC_DOWNLOAD_OS 0xF1 | |
144 | #define WFC_NOOP 0xFF | |
145 | ||
146 | #define WF_MAX_SAMPLE 512 | |
147 | #define WF_MAX_PATCH 256 | |
148 | #define WF_MAX_PROGRAM 128 | |
149 | ||
150 | #define WF_SECTION_MAX 44 /* longest OS section length */ | |
151 | ||
152 | /* # of bytes we send to the board when sending it various kinds of | |
153 | substantive data, such as samples, patches and programs. | |
154 | */ | |
155 | ||
156 | #define WF_PROGRAM_BYTES 32 | |
157 | #define WF_PATCH_BYTES 132 | |
158 | #define WF_SAMPLE_BYTES 27 | |
159 | #define WF_SAMPLE_HDR_BYTES 25 | |
160 | #define WF_ALIAS_BYTES 25 | |
161 | #define WF_DRUM_BYTES 9 | |
162 | #define WF_MSAMPLE_BYTES 259 /* (MIDI_KEYS * 2) + 3 */ | |
163 | ||
164 | #define WF_ACK 0x80 | |
165 | #define WF_DMA_ACK 0x81 | |
166 | ||
167 | /* OR-values for MIDI status bits */ | |
168 | ||
169 | #define WF_MIDI_VIRTUAL_ENABLED 0x1 | |
170 | #define WF_MIDI_VIRTUAL_IS_EXTERNAL 0x2 | |
171 | #define WF_MIDI_IN_TO_SYNTH_DISABLED 0x4 | |
172 | ||
173 | /* slot indexes for struct address_info: makes code a little more mnemonic */ | |
174 | ||
175 | #define WF_SYNTH_SLOT 0 | |
176 | #define WF_INTERNAL_MIDI_SLOT 1 | |
177 | #define WF_EXTERNAL_MIDI_SLOT 2 | |
178 | ||
179 | /* Magic MIDI bytes used to switch I/O streams on the ICS2115 MPU401 | |
180 | emulation. Note these NEVER show up in output from the device and | |
181 | should NEVER be used in input unless Virtual MIDI mode has been | |
182 | disabled. If they do show up as input, the results are unpredictable. | |
183 | */ | |
184 | ||
185 | #define WF_EXTERNAL_SWITCH 0xFD | |
186 | #define WF_INTERNAL_SWITCH 0xF9 | |
187 | ||
188 | /* Debugging flags */ | |
189 | ||
190 | #define WF_DEBUG_CMD 0x1 | |
191 | #define WF_DEBUG_DATA 0x2 | |
192 | #define WF_DEBUG_LOAD_PATCH 0x4 | |
193 | #define WF_DEBUG_IO 0x8 | |
194 | ||
195 | /* WavePatch file format stuff */ | |
196 | ||
197 | #define WF_WAVEPATCH_VERSION 120; /* Current version number (1.2) */ | |
198 | #define WF_MAX_COMMENT 64 /* Comment length */ | |
199 | #define WF_NUM_LAYERS 4 | |
200 | #define WF_NAME_LENGTH 32 | |
201 | #define WF_SOURCE_LENGTH 260 | |
202 | ||
203 | #define BankFileID "Bank" | |
204 | #define DrumkitFileID "DrumKit" | |
205 | #define ProgramFileID "Program" | |
206 | ||
207 | struct wf_envelope | |
208 | { | |
209 | u8 attack_time:7; | |
210 | u8 Unused1:1; | |
211 | ||
212 | u8 decay1_time:7; | |
213 | u8 Unused2:1; | |
214 | ||
215 | u8 decay2_time:7; | |
216 | u8 Unused3:1; | |
217 | ||
218 | u8 sustain_time:7; | |
219 | u8 Unused4:1; | |
220 | ||
221 | u8 release_time:7; | |
222 | u8 Unused5:1; | |
223 | ||
224 | u8 release2_time:7; | |
225 | u8 Unused6:1; | |
226 | ||
227 | s8 attack_level; | |
228 | s8 decay1_level; | |
229 | s8 decay2_level; | |
230 | s8 sustain_level; | |
231 | s8 release_level; | |
232 | ||
233 | u8 attack_velocity:7; | |
234 | u8 Unused7:1; | |
235 | ||
236 | u8 volume_velocity:7; | |
237 | u8 Unused8:1; | |
238 | ||
239 | u8 keyboard_scaling:7; | |
240 | u8 Unused9:1; | |
241 | }; | |
242 | typedef struct wf_envelope wavefront_envelope; | |
243 | ||
244 | struct wf_lfo | |
245 | { | |
246 | u8 sample_number; | |
247 | ||
248 | u8 frequency:7; | |
249 | u8 Unused1:1; | |
250 | ||
251 | u8 am_src:4; | |
252 | u8 fm_src:4; | |
253 | ||
254 | s8 fm_amount; | |
255 | s8 am_amount; | |
256 | s8 start_level; | |
257 | s8 end_level; | |
258 | ||
259 | u8 ramp_delay:7; | |
260 | u8 wave_restart:1; /* for LFO2 only */ | |
261 | ||
262 | u8 ramp_time:7; | |
263 | u8 Unused2:1; | |
264 | }; | |
265 | typedef struct wf_lfo wavefront_lfo; | |
266 | ||
267 | struct wf_patch | |
268 | { | |
269 | s16 frequency_bias; /* ** THIS IS IN MOTOROLA FORMAT!! ** */ | |
270 | ||
271 | u8 amplitude_bias:7; | |
272 | u8 Unused1:1; | |
273 | ||
274 | u8 portamento:7; | |
275 | u8 Unused2:1; | |
276 | ||
277 | u8 sample_number; | |
278 | ||
279 | u8 pitch_bend:4; | |
280 | u8 sample_msb:1; | |
281 | u8 Unused3:3; | |
282 | ||
283 | u8 mono:1; | |
284 | u8 retrigger:1; | |
285 | u8 nohold:1; | |
286 | u8 restart:1; | |
287 | u8 filterconfig:2; /* SDK says "not used" */ | |
288 | u8 reuse:1; | |
289 | u8 reset_lfo:1; | |
290 | ||
291 | u8 fm_src2:4; | |
292 | u8 fm_src1:4; | |
293 | ||
294 | s8 fm_amount1; | |
295 | s8 fm_amount2; | |
296 | ||
297 | u8 am_src:4; | |
298 | u8 Unused4:4; | |
299 | ||
300 | s8 am_amount; | |
301 | ||
302 | u8 fc1_mode:4; | |
303 | u8 fc2_mode:4; | |
304 | ||
305 | s8 fc1_mod_amount; | |
306 | s8 fc1_keyboard_scaling; | |
307 | s8 fc1_bias; | |
308 | s8 fc2_mod_amount; | |
309 | s8 fc2_keyboard_scaling; | |
310 | s8 fc2_bias; | |
311 | ||
312 | u8 randomizer:7; | |
313 | u8 Unused5:1; | |
314 | ||
315 | struct wf_envelope envelope1; | |
316 | struct wf_envelope envelope2; | |
317 | struct wf_lfo lfo1; | |
318 | struct wf_lfo lfo2; | |
319 | }; | |
320 | typedef struct wf_patch wavefront_patch; | |
321 | ||
322 | struct wf_layer | |
323 | { | |
324 | u8 patch_number; | |
325 | ||
326 | u8 mix_level:7; | |
327 | u8 mute:1; | |
328 | ||
329 | u8 split_point:7; | |
330 | u8 play_below:1; | |
331 | ||
332 | u8 pan_mod_src:2; | |
333 | u8 pan_or_mod:1; | |
334 | u8 pan:4; | |
335 | u8 split_type:1; | |
336 | }; | |
337 | typedef struct wf_layer wavefront_layer; | |
338 | ||
339 | struct wf_program | |
340 | { | |
341 | struct wf_layer layer[WF_NUM_LAYERS]; | |
342 | }; | |
343 | typedef struct wf_program wavefront_program; | |
344 | ||
345 | struct wf_sample_offset | |
346 | { | |
347 | s32 Fraction:4; | |
348 | s32 Integer:20; | |
349 | s32 Unused:8; | |
350 | }; | |
351 | typedef struct wf_sample_offset wavefront_sample_offset; | |
352 | ||
353 | /* Sample slot types */ | |
354 | ||
355 | #define WF_ST_SAMPLE 0 | |
356 | #define WF_ST_MULTISAMPLE 1 | |
357 | #define WF_ST_ALIAS 2 | |
358 | #define WF_ST_EMPTY 3 | |
359 | ||
360 | /* pseudo's */ | |
361 | ||
362 | #define WF_ST_DRUM 4 | |
363 | #define WF_ST_PROGRAM 5 | |
364 | #define WF_ST_PATCH 6 | |
365 | #define WF_ST_SAMPLEHDR 7 | |
366 | ||
367 | #define WF_ST_MASK 0xf | |
368 | ||
369 | /* Flags for slot status. These occupy the upper bits of the same byte | |
370 | as a sample type. | |
371 | */ | |
372 | ||
373 | #define WF_SLOT_USED 0x80 /* XXX don't rely on this being accurate */ | |
374 | #define WF_SLOT_FILLED 0x40 | |
375 | #define WF_SLOT_ROM 0x20 | |
376 | ||
377 | #define WF_SLOT_MASK 0xf0 | |
378 | ||
379 | /* channel constants */ | |
380 | ||
381 | #define WF_CH_MONO 0 | |
382 | #define WF_CH_LEFT 1 | |
383 | #define WF_CH_RIGHT 2 | |
384 | ||
385 | /* Sample formats */ | |
386 | ||
387 | #define LINEAR_16BIT 0 | |
388 | #define WHITE_NOISE 1 | |
389 | #define LINEAR_8BIT 2 | |
390 | #define MULAW_8BIT 3 | |
391 | ||
392 | #define WF_SAMPLE_IS_8BIT(smpl) ((smpl)->SampleResolution&2) | |
393 | ||
394 | ||
395 | /* | |
396 | ||
397 | Because most/all of the sample data we pass in via pointers has | |
398 | never been copied (just mmap-ed into user space straight from the | |
399 | disk), it would be nice to allow handling of multi-channel sample | |
400 | data without forcing user-level extraction of the relevant bytes. | |
401 | ||
402 | So, we need a way of specifying which channel to use (the WaveFront | |
403 | only handles mono samples in a given slot), and the only way to do | |
404 | this without using some struct other than wavefront_sample as the | |
405 | interface is the awful hack of using the unused bits in a | |
406 | wavefront_sample: | |
407 | ||
408 | Val Meaning | |
409 | --- ------- | |
410 | 0 no channel selection (use channel 1, sample is MONO) | |
411 | 1 use first channel, and skip one | |
412 | 2 use second channel, and skip one | |
413 | 3 use third channel, and skip two | |
414 | 4 use fourth channel, skip three | |
415 | 5 use fifth channel, skip four | |
416 | 6 use six channel, skip five | |
417 | ||
418 | ||
419 | This can handle up to 4 channels, and anyone downloading >4 channels | |
420 | of sample data just to select one of them needs to find some tools | |
421 | like sox ... | |
422 | ||
423 | NOTE: values 0, 1 and 2 correspond to WF_CH_* above. This is | |
424 | important. | |
425 | ||
426 | */ | |
427 | ||
428 | #define WF_SET_CHANNEL(samp,chn) \ | |
429 | (samp)->Unused1 = chn & 0x1; \ | |
430 | (samp)->Unused2 = chn & 0x2; \ | |
431 | (samp)->Unused3 = chn & 0x4 | |
432 | ||
433 | #define WF_GET_CHANNEL(samp) \ | |
434 | (((samp)->Unused3 << 2)|((samp)->Unused2<<1)|(samp)->Unused1) | |
435 | ||
436 | typedef struct wf_sample { | |
437 | struct wf_sample_offset sampleStartOffset; | |
438 | struct wf_sample_offset loopStartOffset; | |
439 | struct wf_sample_offset loopEndOffset; | |
440 | struct wf_sample_offset sampleEndOffset; | |
441 | s16 FrequencyBias; | |
442 | u8 SampleResolution:2; /* sample_format */ | |
443 | u8 Unused1:1; | |
444 | u8 Loop:1; | |
445 | u8 Bidirectional:1; | |
446 | u8 Unused2:1; | |
447 | u8 Reverse:1; | |
448 | u8 Unused3:1; | |
449 | } wavefront_sample; | |
450 | ||
451 | typedef struct wf_multisample { | |
452 | s16 NumberOfSamples; /* log2 of the number of samples */ | |
453 | s16 SampleNumber[NUM_MIDIKEYS]; | |
454 | } wavefront_multisample; | |
455 | ||
456 | typedef struct wf_alias { | |
6a878184 JB |
457 | s16 OriginalSample; |
458 | ||
459 | struct wf_sample_offset sampleStartOffset; | |
460 | struct wf_sample_offset loopStartOffset; | |
461 | struct wf_sample_offset sampleEndOffset; | |
462 | struct wf_sample_offset loopEndOffset; | |
463 | ||
464 | s16 FrequencyBias; | |
465 | ||
466 | u8 SampleResolution:2; | |
467 | u8 Unused1:1; | |
468 | u8 Loop:1; | |
469 | u8 Bidirectional:1; | |
470 | u8 Unused2:1; | |
471 | u8 Reverse:1; | |
472 | u8 Unused3:1; | |
1da177e4 LT |
473 | |
474 | /* This structure is meant to be padded only to 16 bits on their | |
475 | original. Of course, whoever wrote their documentation didn't | |
476 | realize that sizeof(struct) can be >= | |
477 | sum(sizeof(struct-fields)) and so thought that giving a C level | |
478 | description of the structs used in WavePatch files was | |
479 | sufficient. I suppose it was, as long as you remember the | |
480 | standard 16->32 bit issues. | |
481 | */ | |
482 | ||
6a878184 JB |
483 | u8 sixteen_bit_padding; |
484 | } __attribute__((packed)) wavefront_alias; | |
1da177e4 LT |
485 | |
486 | typedef struct wf_drum { | |
487 | u8 PatchNumber; | |
488 | u8 MixLevel:7; | |
489 | u8 Unmute:1; | |
490 | u8 Group:4; | |
491 | u8 Unused1:4; | |
492 | u8 PanModSource:2; | |
493 | u8 PanModulated:1; | |
494 | u8 PanAmount:4; | |
495 | u8 Unused2:1; | |
496 | } wavefront_drum; | |
497 | ||
498 | typedef struct wf_drumkit { | |
499 | struct wf_drum drum[NUM_MIDIKEYS]; | |
500 | } wavefront_drumkit; | |
501 | ||
502 | typedef struct wf_channel_programs { | |
503 | u8 Program[NUM_MIDICHANNELS]; | |
504 | } wavefront_channel_programs; | |
505 | ||
506 | /* How to get MIDI channel status from the data returned by | |
507 | a WFC_GET_CHANNEL_STATUS command (a struct wf_channel_programs) | |
508 | */ | |
509 | ||
510 | #define WF_CHANNEL_STATUS(ch,wcp) (wcp)[(ch/7)] & (1<<((ch)%7)) | |
511 | ||
512 | typedef union wf_any { | |
513 | wavefront_sample s; | |
514 | wavefront_multisample ms; | |
515 | wavefront_alias a; | |
516 | wavefront_program pr; | |
517 | wavefront_patch p; | |
518 | wavefront_drum d; | |
519 | } wavefront_any; | |
520 | ||
521 | /* Hannu Solvainen hoped that his "patch_info" struct in soundcard.h | |
522 | might work for other wave-table based patch loading situations. | |
523 | Alas, his fears were correct. The WaveFront doesn't even come with | |
524 | just "patches", but several different kind of structures that | |
525 | control the sound generation process. | |
526 | */ | |
527 | ||
528 | typedef struct wf_patch_info { | |
529 | ||
530 | /* the first two fields are used by the OSS "patch loading" interface | |
531 | only, and are unused by the current user-level library. | |
532 | */ | |
533 | ||
534 | s16 key; /* Use WAVEFRONT_PATCH here */ | |
535 | u16 devno; /* fill in when sending */ | |
536 | u8 subkey; /* WF_ST_{SAMPLE,ALIAS,etc.} */ | |
537 | ||
538 | #define WAVEFRONT_FIND_FREE_SAMPLE_SLOT 999 | |
539 | ||
540 | u16 number; /* patch/sample/prog number */ | |
541 | ||
542 | u32 size; /* size of any data included in | |
543 | one of the fields in `hdrptr', or | |
544 | as `dataptr'. | |
545 | ||
546 | NOTE: for actual samples, this is | |
547 | the size of the *SELECTED CHANNEL* | |
548 | even if more data is actually available. | |
549 | ||
550 | So, a stereo sample (2 channels) of | |
551 | 6000 bytes total has `size' = 3000. | |
552 | ||
553 | See the macros and comments for | |
554 | WF_{GET,SET}_CHANNEL above. | |
555 | ||
556 | */ | |
557 | wavefront_any __user *hdrptr; /* user-space ptr to hdr bytes */ | |
558 | u16 __user *dataptr; /* actual sample data */ | |
559 | ||
560 | wavefront_any hdr; /* kernel-space copy of hdr bytes */ | |
561 | } wavefront_patch_info; | |
562 | ||
563 | /* The maximum number of bytes we will ever move to or from user space | |
564 | in response to a WFC_* command. This obviously doesn't cover | |
565 | actual sample data. | |
566 | */ | |
567 | ||
568 | #define WF_MAX_READ sizeof(wavefront_multisample) | |
569 | #define WF_MAX_WRITE sizeof(wavefront_multisample) | |
570 | ||
571 | /* | |
572 | This allows us to execute any WF command except the download/upload | |
573 | ones, which are handled differently due to copyin/copyout issues as | |
574 | well as data-nybbling to/from the card. | |
575 | */ | |
576 | ||
577 | typedef struct wavefront_control { | |
578 | int cmd; /* WFC_* */ | |
579 | char status; /* return status to user-space */ | |
580 | unsigned char rbuf[WF_MAX_READ]; /* bytes read from card */ | |
581 | unsigned char wbuf[WF_MAX_WRITE]; /* bytes written to card */ | |
582 | } wavefront_control; | |
583 | ||
584 | #define WFCTL_WFCMD 0x1 | |
585 | #define WFCTL_LOAD_SPP 0x2 | |
586 | ||
587 | /* Modulator table */ | |
588 | ||
589 | #define WF_MOD_LFO1 0 | |
590 | #define WF_MOD_LFO2 1 | |
591 | #define WF_MOD_ENV1 2 | |
592 | #define WF_MOD_ENV2 3 | |
593 | #define WF_MOD_KEYBOARD 4 | |
594 | #define WF_MOD_LOGKEY 5 | |
595 | #define WF_MOD_VELOCITY 6 | |
596 | #define WF_MOD_LOGVEL 7 | |
597 | #define WF_MOD_RANDOM 8 | |
598 | #define WF_MOD_PRESSURE 9 | |
599 | #define WF_MOD_MOD_WHEEL 10 | |
600 | #define WF_MOD_1 WF_MOD_MOD_WHEEL | |
601 | #define WF_MOD_BREATH 11 | |
602 | #define WF_MOD_2 WF_MOD_BREATH | |
603 | #define WF_MOD_FOOT 12 | |
604 | #define WF_MOD_4 WF_MOD_FOOT | |
605 | #define WF_MOD_VOLUME 13 | |
606 | #define WF_MOD_7 WF_MOD_VOLUME | |
607 | #define WF_MOD_PAN 14 | |
608 | #define WF_MOD_10 WF_MOD_PAN | |
609 | #define WF_MOD_EXPR 15 | |
610 | #define WF_MOD_11 WF_MOD_EXPR | |
611 | ||
612 | /* FX-related material */ | |
613 | ||
614 | typedef struct wf_fx_info { | |
615 | int request; /* see list below */ | |
616 | long data[4]; /* we don't need much */ | |
617 | } wavefront_fx_info; | |
618 | ||
619 | /* support for each of these will be forthcoming once I or someone | |
620 | else has figured out which of the addresses on page 6 and page 7 of | |
621 | the YSS225 control each parameter. Incidentally, these come from | |
622 | the Windows driver interface, but again, Turtle Beach didn't | |
623 | document the API to use them. | |
624 | */ | |
625 | ||
626 | #define WFFX_SETOUTGAIN 0 | |
627 | #define WFFX_SETSTEREOOUTGAIN 1 | |
628 | #define WFFX_SETREVERBIN1GAIN 2 | |
629 | #define WFFX_SETREVERBIN2GAIN 3 | |
630 | #define WFFX_SETREVERBIN3GAIN 4 | |
631 | #define WFFX_SETCHORUSINPORT 5 | |
632 | #define WFFX_SETREVERBIN1PORT 6 | |
633 | #define WFFX_SETREVERBIN2PORT 7 | |
634 | #define WFFX_SETREVERBIN3PORT 8 | |
635 | #define WFFX_SETEFFECTPORT 9 | |
636 | #define WFFX_SETAUXPORT 10 | |
637 | #define WFFX_SETREVERBTYPE 11 | |
638 | #define WFFX_SETREVERBDELAY 12 | |
639 | #define WFFX_SETCHORUSLFO 13 | |
640 | #define WFFX_SETCHORUSPMD 14 | |
641 | #define WFFX_SETCHORUSAMD 15 | |
642 | #define WFFX_SETEFFECT 16 | |
643 | #define WFFX_SETBASEALL 17 | |
644 | #define WFFX_SETREVERBALL 18 | |
645 | #define WFFX_SETCHORUSALL 20 | |
646 | #define WFFX_SETREVERBDEF 22 | |
647 | #define WFFX_SETCHORUSDEF 23 | |
648 | #define WFFX_DELAYSETINGAIN 24 | |
649 | #define WFFX_DELAYSETFBGAIN 25 | |
650 | #define WFFX_DELAYSETFBLPF 26 | |
651 | #define WFFX_DELAYSETGAIN 27 | |
652 | #define WFFX_DELAYSETTIME 28 | |
653 | #define WFFX_DELAYSETFBTIME 29 | |
654 | #define WFFX_DELAYSETALL 30 | |
655 | #define WFFX_DELAYSETDEF 32 | |
656 | #define WFFX_SDELAYSETINGAIN 33 | |
657 | #define WFFX_SDELAYSETFBGAIN 34 | |
658 | #define WFFX_SDELAYSETFBLPF 35 | |
659 | #define WFFX_SDELAYSETGAIN 36 | |
660 | #define WFFX_SDELAYSETTIME 37 | |
661 | #define WFFX_SDELAYSETFBTIME 38 | |
662 | #define WFFX_SDELAYSETALL 39 | |
663 | #define WFFX_SDELAYSETDEF 41 | |
664 | #define WFFX_DEQSETINGAIN 42 | |
665 | #define WFFX_DEQSETFILTER 43 | |
666 | #define WFFX_DEQSETALL 44 | |
667 | #define WFFX_DEQSETDEF 46 | |
668 | #define WFFX_MUTE 47 | |
669 | #define WFFX_FLANGESETBALANCE 48 | |
670 | #define WFFX_FLANGESETDELAY 49 | |
671 | #define WFFX_FLANGESETDWFFX_TH 50 | |
672 | #define WFFX_FLANGESETFBGAIN 51 | |
673 | #define WFFX_FLANGESETINGAIN 52 | |
674 | #define WFFX_FLANGESETLFO 53 | |
675 | #define WFFX_FLANGESETALL 54 | |
676 | #define WFFX_FLANGESETDEF 56 | |
677 | #define WFFX_PITCHSETSHIFT 57 | |
678 | #define WFFX_PITCHSETBALANCE 58 | |
679 | #define WFFX_PITCHSETALL 59 | |
680 | #define WFFX_PITCHSETDEF 61 | |
681 | #define WFFX_SRSSETINGAIN 62 | |
682 | #define WFFX_SRSSETSPACE 63 | |
683 | #define WFFX_SRSSETCENTER 64 | |
684 | #define WFFX_SRSSETGAIN 65 | |
685 | #define WFFX_SRSSETMODE 66 | |
686 | #define WFFX_SRSSETDEF 68 | |
687 | ||
688 | /* Allow direct user-space control over FX memory/coefficient data. | |
689 | In theory this could be used to download the FX microprogram, | |
690 | but it would be a little slower, and involve some weird code. | |
691 | */ | |
692 | ||
693 | #define WFFX_MEMSET 69 | |
694 | ||
695 | #endif /* __SOUND_WAVEFRONT_H__ */ |