diff options
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/ainstr_fm.h | 134 | ||||
-rw-r--r-- | include/sound/ainstr_gf1.h | 229 | ||||
-rw-r--r-- | include/sound/ainstr_iw.h | 384 | ||||
-rw-r--r-- | include/sound/ainstr_simple.h | 159 | ||||
-rw-r--r-- | include/sound/asequencer.h | 242 | ||||
-rw-r--r-- | include/sound/gus.h | 63 | ||||
-rw-r--r-- | include/sound/seq_instr.h | 110 | ||||
-rw-r--r-- | include/sound/trident.h | 22 |
8 files changed, 2 insertions, 1341 deletions
diff --git a/include/sound/ainstr_fm.h b/include/sound/ainstr_fm.h deleted file mode 100644 index c4afb1f121fe..000000000000 --- a/include/sound/ainstr_fm.h +++ /dev/null | |||
@@ -1,134 +0,0 @@ | |||
1 | /* | ||
2 | * Advanced Linux Sound Architecture | ||
3 | * | ||
4 | * FM (OPL2/3) Instrument Format | ||
5 | * Copyright (c) 2000 Uros Bizjak <uros@kss-loka.si> | ||
6 | * | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #ifndef __SOUND_AINSTR_FM_H | ||
25 | #define __SOUND_AINSTR_FM_H | ||
26 | |||
27 | #ifndef __KERNEL__ | ||
28 | #include <asm/types.h> | ||
29 | #include <asm/byteorder.h> | ||
30 | #endif | ||
31 | |||
32 | /* | ||
33 | * share types (share ID 1) | ||
34 | */ | ||
35 | |||
36 | #define FM_SHARE_FILE 0 | ||
37 | |||
38 | /* | ||
39 | * FM operator | ||
40 | */ | ||
41 | |||
42 | struct fm_operator { | ||
43 | unsigned char am_vib; | ||
44 | unsigned char ksl_level; | ||
45 | unsigned char attack_decay; | ||
46 | unsigned char sustain_release; | ||
47 | unsigned char wave_select; | ||
48 | }; | ||
49 | |||
50 | /* | ||
51 | * Instrument | ||
52 | */ | ||
53 | |||
54 | #define FM_PATCH_OPL2 0x01 /* OPL2 2 operators FM instrument */ | ||
55 | #define FM_PATCH_OPL3 0x02 /* OPL3 4 operators FM instrument */ | ||
56 | |||
57 | struct fm_instrument { | ||
58 | unsigned int share_id[4]; /* share id - zero = no sharing */ | ||
59 | unsigned char type; /* instrument type */ | ||
60 | |||
61 | struct fm_operator op[4]; | ||
62 | unsigned char feedback_connection[2]; | ||
63 | |||
64 | unsigned char echo_delay; | ||
65 | unsigned char echo_atten; | ||
66 | unsigned char chorus_spread; | ||
67 | unsigned char trnsps; | ||
68 | unsigned char fix_dur; | ||
69 | unsigned char modes; | ||
70 | unsigned char fix_key; | ||
71 | }; | ||
72 | |||
73 | /* | ||
74 | * | ||
75 | * Kernel <-> user space | ||
76 | * Hardware (CPU) independent section | ||
77 | * | ||
78 | * * = zero or more | ||
79 | * + = one or more | ||
80 | * | ||
81 | * fm_xinstrument FM_STRU_INSTR | ||
82 | * | ||
83 | */ | ||
84 | |||
85 | #define FM_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T') | ||
86 | |||
87 | /* | ||
88 | * FM operator | ||
89 | */ | ||
90 | |||
91 | struct fm_xoperator { | ||
92 | __u8 am_vib; | ||
93 | __u8 ksl_level; | ||
94 | __u8 attack_decay; | ||
95 | __u8 sustain_release; | ||
96 | __u8 wave_select; | ||
97 | }; | ||
98 | |||
99 | /* | ||
100 | * Instrument | ||
101 | */ | ||
102 | |||
103 | struct fm_xinstrument { | ||
104 | __u32 stype; /* structure type */ | ||
105 | |||
106 | __u32 share_id[4]; /* share id - zero = no sharing */ | ||
107 | __u8 type; /* instrument type */ | ||
108 | |||
109 | struct fm_xoperator op[4]; /* fm operators */ | ||
110 | __u8 feedback_connection[2]; | ||
111 | |||
112 | __u8 echo_delay; | ||
113 | __u8 echo_atten; | ||
114 | __u8 chorus_spread; | ||
115 | __u8 trnsps; | ||
116 | __u8 fix_dur; | ||
117 | __u8 modes; | ||
118 | __u8 fix_key; | ||
119 | }; | ||
120 | |||
121 | #ifdef __KERNEL__ | ||
122 | |||
123 | #include "seq_instr.h" | ||
124 | |||
125 | int snd_seq_fm_init(struct snd_seq_kinstr_ops * ops, | ||
126 | struct snd_seq_kinstr_ops * next); | ||
127 | |||
128 | #endif | ||
129 | |||
130 | /* typedefs for compatibility to user-space */ | ||
131 | typedef struct fm_xoperator fm_xoperator_t; | ||
132 | typedef struct fm_xinstrument fm_xinstrument_t; | ||
133 | |||
134 | #endif /* __SOUND_AINSTR_FM_H */ | ||
diff --git a/include/sound/ainstr_gf1.h b/include/sound/ainstr_gf1.h deleted file mode 100644 index b62b665c69c6..000000000000 --- a/include/sound/ainstr_gf1.h +++ /dev/null | |||
@@ -1,229 +0,0 @@ | |||
1 | /* | ||
2 | * Advanced Linux Sound Architecture | ||
3 | * | ||
4 | * GF1 (GUS) Patch Instrument Format | ||
5 | * Copyright (c) 1994-99 by Jaroslav Kysela <perex@perex.cz> | ||
6 | * | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #ifndef __SOUND_AINSTR_GF1_H | ||
25 | #define __SOUND_AINSTR_GF1_H | ||
26 | |||
27 | #ifndef __KERNEL__ | ||
28 | #include <asm/types.h> | ||
29 | #include <asm/byteorder.h> | ||
30 | #endif | ||
31 | |||
32 | /* | ||
33 | * share types (share ID 1) | ||
34 | */ | ||
35 | |||
36 | #define GF1_SHARE_FILE 0 | ||
37 | |||
38 | /* | ||
39 | * wave formats | ||
40 | */ | ||
41 | |||
42 | #define GF1_WAVE_16BIT 0x0001 /* 16-bit wave */ | ||
43 | #define GF1_WAVE_UNSIGNED 0x0002 /* unsigned wave */ | ||
44 | #define GF1_WAVE_INVERT 0x0002 /* same as unsigned wave */ | ||
45 | #define GF1_WAVE_BACKWARD 0x0004 /* backward mode (maybe used for reverb or ping-ping loop) */ | ||
46 | #define GF1_WAVE_LOOP 0x0008 /* loop mode */ | ||
47 | #define GF1_WAVE_BIDIR 0x0010 /* bidirectional mode */ | ||
48 | #define GF1_WAVE_STEREO 0x0100 /* stereo mode */ | ||
49 | #define GF1_WAVE_ULAW 0x0200 /* uLaw compression mode */ | ||
50 | |||
51 | /* | ||
52 | * Wavetable definitions | ||
53 | */ | ||
54 | |||
55 | struct gf1_wave { | ||
56 | unsigned int share_id[4]; /* share id - zero = no sharing */ | ||
57 | unsigned int format; /* wave format */ | ||
58 | |||
59 | struct { | ||
60 | unsigned int number; /* some other ID for this instrument */ | ||
61 | unsigned int memory; /* begin of waveform in onboard memory */ | ||
62 | unsigned char *ptr; /* pointer to waveform in system memory */ | ||
63 | } address; | ||
64 | |||
65 | unsigned int size; /* size of waveform in samples */ | ||
66 | unsigned int start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ | ||
67 | unsigned int loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ | ||
68 | unsigned int loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ | ||
69 | unsigned short loop_repeat; /* loop repeat - 0 = forever */ | ||
70 | |||
71 | unsigned char flags; /* GF1 patch flags */ | ||
72 | unsigned char pad; | ||
73 | unsigned int sample_rate; /* sample rate in Hz */ | ||
74 | unsigned int low_frequency; /* low frequency range */ | ||
75 | unsigned int high_frequency; /* high frequency range */ | ||
76 | unsigned int root_frequency; /* root frequency range */ | ||
77 | signed short tune; | ||
78 | unsigned char balance; | ||
79 | unsigned char envelope_rate[6]; | ||
80 | unsigned char envelope_offset[6]; | ||
81 | unsigned char tremolo_sweep; | ||
82 | unsigned char tremolo_rate; | ||
83 | unsigned char tremolo_depth; | ||
84 | unsigned char vibrato_sweep; | ||
85 | unsigned char vibrato_rate; | ||
86 | unsigned char vibrato_depth; | ||
87 | unsigned short scale_frequency; | ||
88 | unsigned short scale_factor; /* 0-2048 or 0-2 */ | ||
89 | |||
90 | struct gf1_wave *next; | ||
91 | }; | ||
92 | |||
93 | /* | ||
94 | * Instrument | ||
95 | */ | ||
96 | |||
97 | #define IWFFFF_EXCLUDE_NONE 0x0000 /* exclusion mode - none */ | ||
98 | #define IWFFFF_EXCLUDE_SINGLE 0x0001 /* exclude single - single note from the instrument group */ | ||
99 | #define IWFFFF_EXCLUDE_MULTIPLE 0x0002 /* exclude multiple - stop only same note from this instrument */ | ||
100 | |||
101 | #define IWFFFF_EFFECT_NONE 0 | ||
102 | #define IWFFFF_EFFECT_REVERB 1 | ||
103 | #define IWFFFF_EFFECT_CHORUS 2 | ||
104 | #define IWFFFF_EFFECT_ECHO 3 | ||
105 | |||
106 | struct gf1_instrument { | ||
107 | unsigned short exclusion; | ||
108 | unsigned short exclusion_group; /* 0 - none, 1-65535 */ | ||
109 | |||
110 | unsigned char effect1; /* effect 1 */ | ||
111 | unsigned char effect1_depth; /* 0-127 */ | ||
112 | unsigned char effect2; /* effect 2 */ | ||
113 | unsigned char effect2_depth; /* 0-127 */ | ||
114 | |||
115 | struct gf1_wave *wave; /* first waveform */ | ||
116 | }; | ||
117 | |||
118 | /* | ||
119 | * | ||
120 | * Kernel <-> user space | ||
121 | * Hardware (CPU) independent section | ||
122 | * | ||
123 | * * = zero or more | ||
124 | * + = one or more | ||
125 | * | ||
126 | * gf1_xinstrument IWFFFF_STRU_INSTR | ||
127 | * +gf1_xwave IWFFFF_STRU_WAVE | ||
128 | * | ||
129 | */ | ||
130 | |||
131 | #define GF1_STRU_WAVE __cpu_to_be32(('W'<<24)|('A'<<16)|('V'<<8)|'E') | ||
132 | #define GF1_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T') | ||
133 | |||
134 | /* | ||
135 | * Wavetable definitions | ||
136 | */ | ||
137 | |||
138 | struct gf1_xwave { | ||
139 | __u32 stype; /* structure type */ | ||
140 | |||
141 | __u32 share_id[4]; /* share id - zero = no sharing */ | ||
142 | __u32 format; /* wave format */ | ||
143 | |||
144 | __u32 size; /* size of waveform in samples */ | ||
145 | __u32 start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ | ||
146 | __u32 loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ | ||
147 | __u32 loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ | ||
148 | __u16 loop_repeat; /* loop repeat - 0 = forever */ | ||
149 | |||
150 | __u8 flags; /* GF1 patch flags */ | ||
151 | __u8 pad; | ||
152 | __u32 sample_rate; /* sample rate in Hz */ | ||
153 | __u32 low_frequency; /* low frequency range */ | ||
154 | __u32 high_frequency; /* high frequency range */ | ||
155 | __u32 root_frequency; /* root frequency range */ | ||
156 | __s16 tune; | ||
157 | __u8 balance; | ||
158 | __u8 envelope_rate[6]; | ||
159 | __u8 envelope_offset[6]; | ||
160 | __u8 tremolo_sweep; | ||
161 | __u8 tremolo_rate; | ||
162 | __u8 tremolo_depth; | ||
163 | __u8 vibrato_sweep; | ||
164 | __u8 vibrato_rate; | ||
165 | __u8 vibrato_depth; | ||
166 | __u16 scale_frequency; | ||
167 | __u16 scale_factor; /* 0-2048 or 0-2 */ | ||
168 | }; | ||
169 | |||
170 | /* | ||
171 | * Instrument | ||
172 | */ | ||
173 | |||
174 | struct gf1_xinstrument { | ||
175 | __u32 stype; | ||
176 | |||
177 | __u16 exclusion; | ||
178 | __u16 exclusion_group; /* 0 - none, 1-65535 */ | ||
179 | |||
180 | __u8 effect1; /* effect 1 */ | ||
181 | __u8 effect1_depth; /* 0-127 */ | ||
182 | __u8 effect2; /* effect 2 */ | ||
183 | __u8 effect2_depth; /* 0-127 */ | ||
184 | }; | ||
185 | |||
186 | /* | ||
187 | * Instrument info | ||
188 | */ | ||
189 | |||
190 | #define GF1_INFO_ENVELOPE (1<<0) | ||
191 | #define GF1_INFO_TREMOLO (1<<1) | ||
192 | #define GF1_INFO_VIBRATO (1<<2) | ||
193 | |||
194 | struct gf1_info { | ||
195 | unsigned char flags; /* supported wave flags */ | ||
196 | unsigned char pad[3]; | ||
197 | unsigned int features; /* supported features */ | ||
198 | unsigned int max8_len; /* maximum 8-bit wave length */ | ||
199 | unsigned int max16_len; /* maximum 16-bit wave length */ | ||
200 | }; | ||
201 | |||
202 | #ifdef __KERNEL__ | ||
203 | |||
204 | #include "seq_instr.h" | ||
205 | |||
206 | struct snd_gf1_ops { | ||
207 | void *private_data; | ||
208 | int (*info)(void *private_data, struct gf1_info *info); | ||
209 | int (*put_sample)(void *private_data, struct gf1_wave *wave, | ||
210 | char __user *data, long len, int atomic); | ||
211 | int (*get_sample)(void *private_data, struct gf1_wave *wave, | ||
212 | char __user *data, long len, int atomic); | ||
213 | int (*remove_sample)(void *private_data, struct gf1_wave *wave, | ||
214 | int atomic); | ||
215 | void (*notify)(void *private_data, struct snd_seq_kinstr *instr, int what); | ||
216 | struct snd_seq_kinstr_ops kops; | ||
217 | }; | ||
218 | |||
219 | int snd_seq_gf1_init(struct snd_gf1_ops *ops, | ||
220 | void *private_data, | ||
221 | struct snd_seq_kinstr_ops *next); | ||
222 | |||
223 | #endif | ||
224 | |||
225 | /* typedefs for compatibility to user-space */ | ||
226 | typedef struct gf1_xwave gf1_xwave_t; | ||
227 | typedef struct gf1_xinstrument gf1_xinstrument_t; | ||
228 | |||
229 | #endif /* __SOUND_AINSTR_GF1_H */ | ||
diff --git a/include/sound/ainstr_iw.h b/include/sound/ainstr_iw.h deleted file mode 100644 index 11bd25082600..000000000000 --- a/include/sound/ainstr_iw.h +++ /dev/null | |||
@@ -1,384 +0,0 @@ | |||
1 | /* | ||
2 | * Advanced Linux Sound Architecture | ||
3 | * | ||
4 | * InterWave FFFF Instrument Format | ||
5 | * Copyright (c) 1994-99 by Jaroslav Kysela <perex@perex.cz> | ||
6 | * | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #ifndef __SOUND_AINSTR_IW_H | ||
25 | #define __SOUND_AINSTR_IW_H | ||
26 | |||
27 | #ifndef __KERNEL__ | ||
28 | #include <asm/types.h> | ||
29 | #include <asm/byteorder.h> | ||
30 | #endif | ||
31 | |||
32 | /* | ||
33 | * share types (share ID 1) | ||
34 | */ | ||
35 | |||
36 | #define IWFFFF_SHARE_FILE 0 | ||
37 | |||
38 | /* | ||
39 | * wave formats | ||
40 | */ | ||
41 | |||
42 | #define IWFFFF_WAVE_16BIT 0x0001 /* 16-bit wave */ | ||
43 | #define IWFFFF_WAVE_UNSIGNED 0x0002 /* unsigned wave */ | ||
44 | #define IWFFFF_WAVE_INVERT 0x0002 /* same as unsigned wave */ | ||
45 | #define IWFFFF_WAVE_BACKWARD 0x0004 /* backward mode (maybe used for reverb or ping-ping loop) */ | ||
46 | #define IWFFFF_WAVE_LOOP 0x0008 /* loop mode */ | ||
47 | #define IWFFFF_WAVE_BIDIR 0x0010 /* bidirectional mode */ | ||
48 | #define IWFFFF_WAVE_ULAW 0x0020 /* uLaw compressed wave */ | ||
49 | #define IWFFFF_WAVE_RAM 0x0040 /* wave is _preloaded_ in RAM (it is used for ROM simulation) */ | ||
50 | #define IWFFFF_WAVE_ROM 0x0080 /* wave is in ROM */ | ||
51 | #define IWFFFF_WAVE_STEREO 0x0100 /* wave is stereo */ | ||
52 | |||
53 | /* | ||
54 | * Wavetable definitions | ||
55 | */ | ||
56 | |||
57 | struct iwffff_wave { | ||
58 | unsigned int share_id[4]; /* share id - zero = no sharing */ | ||
59 | unsigned int format; /* wave format */ | ||
60 | |||
61 | struct { | ||
62 | unsigned int number; /* some other ID for this wave */ | ||
63 | unsigned int memory; /* begin of waveform in onboard memory */ | ||
64 | unsigned char *ptr; /* pointer to waveform in system memory */ | ||
65 | } address; | ||
66 | |||
67 | unsigned int size; /* size of waveform in samples */ | ||
68 | unsigned int start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ | ||
69 | unsigned int loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ | ||
70 | unsigned int loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ | ||
71 | unsigned short loop_repeat; /* loop repeat - 0 = forever */ | ||
72 | unsigned int sample_ratio; /* sample ratio (44100 * 1024 / rate) */ | ||
73 | unsigned char attenuation; /* 0 - 127 (no corresponding midi controller) */ | ||
74 | unsigned char low_note; /* lower frequency range for this waveform */ | ||
75 | unsigned char high_note; /* higher frequency range for this waveform */ | ||
76 | unsigned char pad; | ||
77 | |||
78 | struct iwffff_wave *next; | ||
79 | }; | ||
80 | |||
81 | /* | ||
82 | * Layer | ||
83 | */ | ||
84 | |||
85 | #define IWFFFF_LFO_SHAPE_TRIANGLE 0 | ||
86 | #define IWFFFF_LFO_SHAPE_POSTRIANGLE 1 | ||
87 | |||
88 | struct iwffff_lfo { | ||
89 | unsigned short freq; /* (0-2047) 0.01Hz - 21.5Hz */ | ||
90 | signed short depth; /* volume +- (0-255) 0.48675dB/step */ | ||
91 | signed short sweep; /* 0 - 950 deciseconds */ | ||
92 | unsigned char shape; /* see to IWFFFF_LFO_SHAPE_XXXX */ | ||
93 | unsigned char delay; /* 0 - 255 deciseconds */ | ||
94 | }; | ||
95 | |||
96 | #define IWFFFF_ENV_FLAG_RETRIGGER 0x0001 /* flag - retrigger */ | ||
97 | |||
98 | #define IWFFFF_ENV_MODE_ONE_SHOT 0x0001 /* mode - one shot */ | ||
99 | #define IWFFFF_ENV_MODE_SUSTAIN 0x0002 /* mode - sustain */ | ||
100 | #define IWFFFF_ENV_MODE_NO_SUSTAIN 0x0003 /* mode - no sustain */ | ||
101 | |||
102 | #define IWFFFF_ENV_INDEX_VELOCITY 0x0001 /* index - velocity */ | ||
103 | #define IWFFFF_ENV_INDEX_FREQUENCY 0x0002 /* index - frequency */ | ||
104 | |||
105 | struct iwffff_env_point { | ||
106 | unsigned short offset; | ||
107 | unsigned short rate; | ||
108 | }; | ||
109 | |||
110 | struct iwffff_env_record { | ||
111 | unsigned short nattack; | ||
112 | unsigned short nrelease; | ||
113 | unsigned short sustain_offset; | ||
114 | unsigned short sustain_rate; | ||
115 | unsigned short release_rate; | ||
116 | unsigned char hirange; | ||
117 | unsigned char pad; | ||
118 | struct iwffff_env_record *next; | ||
119 | /* points are stored here */ | ||
120 | /* count of points = nattack + nrelease */ | ||
121 | }; | ||
122 | |||
123 | struct iwffff_env { | ||
124 | unsigned char flags; | ||
125 | unsigned char mode; | ||
126 | unsigned char index; | ||
127 | unsigned char pad; | ||
128 | struct iwffff_env_record *record; | ||
129 | }; | ||
130 | |||
131 | #define IWFFFF_LAYER_FLAG_RETRIGGER 0x0001 /* retrigger */ | ||
132 | |||
133 | #define IWFFFF_LAYER_VELOCITY_TIME 0x0000 /* velocity mode = time */ | ||
134 | #define IWFFFF_LAYER_VELOCITY_RATE 0x0001 /* velocity mode = rate */ | ||
135 | |||
136 | #define IWFFFF_LAYER_EVENT_KUP 0x0000 /* layer event - key up */ | ||
137 | #define IWFFFF_LAYER_EVENT_KDOWN 0x0001 /* layer event - key down */ | ||
138 | #define IWFFFF_LAYER_EVENT_RETRIG 0x0002 /* layer event - retrigger */ | ||
139 | #define IWFFFF_LAYER_EVENT_LEGATO 0x0003 /* layer event - legato */ | ||
140 | |||
141 | struct iwffff_layer { | ||
142 | unsigned char flags; | ||
143 | unsigned char velocity_mode; | ||
144 | unsigned char layer_event; | ||
145 | unsigned char low_range; /* range for layer based */ | ||
146 | unsigned char high_range; /* on either velocity or frequency */ | ||
147 | unsigned char pan; /* pan offset from CC1 (0 left - 127 right) */ | ||
148 | unsigned char pan_freq_scale; /* position based on frequency (0-127) */ | ||
149 | unsigned char attenuation; /* 0-127 (no corresponding midi controller) */ | ||
150 | struct iwffff_lfo tremolo; /* tremolo effect */ | ||
151 | struct iwffff_lfo vibrato; /* vibrato effect */ | ||
152 | unsigned short freq_scale; /* 0-2048, 1024 is equal to semitone scaling */ | ||
153 | unsigned char freq_center; /* center for keyboard frequency scaling */ | ||
154 | unsigned char pad; | ||
155 | struct iwffff_env penv; /* pitch envelope */ | ||
156 | struct iwffff_env venv; /* volume envelope */ | ||
157 | |||
158 | struct iwffff_wave *wave; | ||
159 | struct iwffff_layer *next; | ||
160 | }; | ||
161 | |||
162 | /* | ||
163 | * Instrument | ||
164 | */ | ||
165 | |||
166 | #define IWFFFF_EXCLUDE_NONE 0x0000 /* exclusion mode - none */ | ||
167 | #define IWFFFF_EXCLUDE_SINGLE 0x0001 /* exclude single - single note from the instrument group */ | ||
168 | #define IWFFFF_EXCLUDE_MULTIPLE 0x0002 /* exclude multiple - stop only same note from this instrument */ | ||
169 | |||
170 | #define IWFFFF_LAYER_NONE 0x0000 /* not layered */ | ||
171 | #define IWFFFF_LAYER_ON 0x0001 /* layered */ | ||
172 | #define IWFFFF_LAYER_VELOCITY 0x0002 /* layered by velocity */ | ||
173 | #define IWFFFF_LAYER_FREQUENCY 0x0003 /* layered by frequency */ | ||
174 | |||
175 | #define IWFFFF_EFFECT_NONE 0 | ||
176 | #define IWFFFF_EFFECT_REVERB 1 | ||
177 | #define IWFFFF_EFFECT_CHORUS 2 | ||
178 | #define IWFFFF_EFFECT_ECHO 3 | ||
179 | |||
180 | struct iwffff_instrument { | ||
181 | unsigned short exclusion; | ||
182 | unsigned short layer_type; | ||
183 | unsigned short exclusion_group; /* 0 - none, 1-65535 */ | ||
184 | |||
185 | unsigned char effect1; /* effect 1 */ | ||
186 | unsigned char effect1_depth; /* 0-127 */ | ||
187 | unsigned char effect2; /* effect 2 */ | ||
188 | unsigned char effect2_depth; /* 0-127 */ | ||
189 | |||
190 | struct iwffff_layer *layer; /* first layer */ | ||
191 | }; | ||
192 | |||
193 | /* | ||
194 | * | ||
195 | * Kernel <-> user space | ||
196 | * Hardware (CPU) independent section | ||
197 | * | ||
198 | * * = zero or more | ||
199 | * + = one or more | ||
200 | * | ||
201 | * iwffff_xinstrument IWFFFF_STRU_INSTR | ||
202 | * +iwffff_xlayer IWFFFF_STRU_LAYER | ||
203 | * *iwffff_xenv_record IWFFFF_STRU_ENV_RECT (tremolo) | ||
204 | * *iwffff_xenv_record IWFFFF_STRU_EVN_RECT (vibrato) | ||
205 | * +iwffff_xwave IWFFFF_STRU_WAVE | ||
206 | * | ||
207 | */ | ||
208 | |||
209 | #define IWFFFF_STRU_WAVE __cpu_to_be32(('W'<<24)|('A'<<16)|('V'<<8)|'E') | ||
210 | #define IWFFFF_STRU_ENV_RECP __cpu_to_be32(('E'<<24)|('N'<<16)|('R'<<8)|'P') | ||
211 | #define IWFFFF_STRU_ENV_RECV __cpu_to_be32(('E'<<24)|('N'<<16)|('R'<<8)|'V') | ||
212 | #define IWFFFF_STRU_LAYER __cpu_to_be32(('L'<<24)|('A'<<16)|('Y'<<8)|'R') | ||
213 | #define IWFFFF_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T') | ||
214 | |||
215 | /* | ||
216 | * Wavetable definitions | ||
217 | */ | ||
218 | |||
219 | struct iwffff_xwave { | ||
220 | __u32 stype; /* structure type */ | ||
221 | |||
222 | __u32 share_id[4]; /* share id - zero = no sharing */ | ||
223 | |||
224 | __u32 format; /* wave format */ | ||
225 | __u32 offset; /* offset to ROM (address) */ | ||
226 | |||
227 | __u32 size; /* size of waveform in samples */ | ||
228 | __u32 start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ | ||
229 | __u32 loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ | ||
230 | __u32 loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ | ||
231 | __u16 loop_repeat; /* loop repeat - 0 = forever */ | ||
232 | __u32 sample_ratio; /* sample ratio (44100 * 1024 / rate) */ | ||
233 | __u8 attenuation; /* 0 - 127 (no corresponding midi controller) */ | ||
234 | __u8 low_note; /* lower frequency range for this waveform */ | ||
235 | __u8 high_note; /* higher frequency range for this waveform */ | ||
236 | __u8 pad; | ||
237 | }; | ||
238 | |||
239 | /* | ||
240 | * Layer | ||
241 | */ | ||
242 | |||
243 | struct iwffff_xlfo { | ||
244 | __u16 freq; /* (0-2047) 0.01Hz - 21.5Hz */ | ||
245 | __s16 depth; /* volume +- (0-255) 0.48675dB/step */ | ||
246 | __s16 sweep; /* 0 - 950 deciseconds */ | ||
247 | __u8 shape; /* see to ULTRA_IW_LFO_SHAPE_XXXX */ | ||
248 | __u8 delay; /* 0 - 255 deciseconds */ | ||
249 | }; | ||
250 | |||
251 | struct iwffff_xenv_point { | ||
252 | __u16 offset; | ||
253 | __u16 rate; | ||
254 | }; | ||
255 | |||
256 | struct iwffff_xenv_record { | ||
257 | __u32 stype; | ||
258 | __u16 nattack; | ||
259 | __u16 nrelease; | ||
260 | __u16 sustain_offset; | ||
261 | __u16 sustain_rate; | ||
262 | __u16 release_rate; | ||
263 | __u8 hirange; | ||
264 | __u8 pad; | ||
265 | /* points are stored here.. */ | ||
266 | /* count of points = nattack + nrelease */ | ||
267 | }; | ||
268 | |||
269 | struct iwffff_xenv { | ||
270 | __u8 flags; | ||
271 | __u8 mode; | ||
272 | __u8 index; | ||
273 | __u8 pad; | ||
274 | }; | ||
275 | |||
276 | struct iwffff_xlayer { | ||
277 | __u32 stype; | ||
278 | __u8 flags; | ||
279 | __u8 velocity_mode; | ||
280 | __u8 layer_event; | ||
281 | __u8 low_range; /* range for layer based */ | ||
282 | __u8 high_range; /* on either velocity or frequency */ | ||
283 | __u8 pan; /* pan offset from CC1 (0 left - 127 right) */ | ||
284 | __u8 pan_freq_scale; /* position based on frequency (0-127) */ | ||
285 | __u8 attenuation; /* 0-127 (no corresponding midi controller) */ | ||
286 | struct iwffff_xlfo tremolo; /* tremolo effect */ | ||
287 | struct iwffff_xlfo vibrato; /* vibrato effect */ | ||
288 | __u16 freq_scale; /* 0-2048, 1024 is equal to semitone scaling */ | ||
289 | __u8 freq_center; /* center for keyboard frequency scaling */ | ||
290 | __u8 pad; | ||
291 | struct iwffff_xenv penv; /* pitch envelope */ | ||
292 | struct iwffff_xenv venv; /* volume envelope */ | ||
293 | }; | ||
294 | |||
295 | /* | ||
296 | * Instrument | ||
297 | */ | ||
298 | |||
299 | struct iwffff_xinstrument { | ||
300 | __u32 stype; | ||
301 | |||
302 | __u16 exclusion; | ||
303 | __u16 layer_type; | ||
304 | __u16 exclusion_group; /* 0 - none, 1-65535 */ | ||
305 | |||
306 | __u8 effect1; /* effect 1 */ | ||
307 | __u8 effect1_depth; /* 0-127 */ | ||
308 | __u8 effect2; /* effect 2 */ | ||
309 | __u8 effect2_depth; /* 0-127 */ | ||
310 | }; | ||
311 | |||
312 | /* | ||
313 | * ROM support | ||
314 | * InterWave ROMs are Little-Endian (x86) | ||
315 | */ | ||
316 | |||
317 | #define IWFFFF_ROM_HDR_SIZE 512 | ||
318 | |||
319 | struct iwffff_rom_header { | ||
320 | __u8 iwave[8]; | ||
321 | __u8 revision; | ||
322 | __u8 series_number; | ||
323 | __u8 series_name[16]; | ||
324 | __u8 date[10]; | ||
325 | __u16 vendor_revision_major; | ||
326 | __u16 vendor_revision_minor; | ||
327 | __u32 rom_size; | ||
328 | __u8 copyright[128]; | ||
329 | __u8 vendor_name[64]; | ||
330 | __u8 description[128]; | ||
331 | }; | ||
332 | |||
333 | /* | ||
334 | * Instrument info | ||
335 | */ | ||
336 | |||
337 | #define IWFFFF_INFO_LFO_VIBRATO (1<<0) | ||
338 | #define IWFFFF_INFO_LFO_VIBRATO_SHAPE (1<<1) | ||
339 | #define IWFFFF_INFO_LFO_TREMOLO (1<<2) | ||
340 | #define IWFFFF_INFO_LFO_TREMOLO_SHAPE (1<<3) | ||
341 | |||
342 | struct iwffff_info { | ||
343 | unsigned int format; /* supported format bits */ | ||
344 | unsigned int effects; /* supported effects (1 << IWFFFF_EFFECT*) */ | ||
345 | unsigned int lfos; /* LFO effects */ | ||
346 | unsigned int max8_len; /* maximum 8-bit wave length */ | ||
347 | unsigned int max16_len; /* maximum 16-bit wave length */ | ||
348 | }; | ||
349 | |||
350 | #ifdef __KERNEL__ | ||
351 | |||
352 | #include "seq_instr.h" | ||
353 | |||
354 | struct snd_iwffff_ops { | ||
355 | void *private_data; | ||
356 | int (*info)(void *private_data, struct iwffff_info *info); | ||
357 | int (*put_sample)(void *private_data, struct iwffff_wave *wave, | ||
358 | char __user *data, long len, int atomic); | ||
359 | int (*get_sample)(void *private_data, struct iwffff_wave *wave, | ||
360 | char __user *data, long len, int atomic); | ||
361 | int (*remove_sample)(void *private_data, struct iwffff_wave *wave, | ||
362 | int atomic); | ||
363 | void (*notify)(void *private_data, struct snd_seq_kinstr *instr, int what); | ||
364 | struct snd_seq_kinstr_ops kops; | ||
365 | }; | ||
366 | |||
367 | int snd_seq_iwffff_init(struct snd_iwffff_ops *ops, | ||
368 | void *private_data, | ||
369 | struct snd_seq_kinstr_ops *next); | ||
370 | |||
371 | #endif | ||
372 | |||
373 | /* typedefs for compatibility to user-space */ | ||
374 | typedef struct iwffff_xwave iwffff_xwave_t; | ||
375 | typedef struct iwffff_xlfo iwffff_xlfo_t; | ||
376 | typedef struct iwffff_xenv_point iwffff_xenv_point_t; | ||
377 | typedef struct iwffff_xenv_record iwffff_xenv_record_t; | ||
378 | typedef struct iwffff_xenv iwffff_xenv_t; | ||
379 | typedef struct iwffff_xlayer iwffff_xlayer_t; | ||
380 | typedef struct iwffff_xinstrument iwffff_xinstrument_t; | ||
381 | typedef struct iwffff_rom_header iwffff_rom_header_t; | ||
382 | typedef struct iwffff_info iwffff_info_t; | ||
383 | |||
384 | #endif /* __SOUND_AINSTR_IW_H */ | ||
diff --git a/include/sound/ainstr_simple.h b/include/sound/ainstr_simple.h deleted file mode 100644 index da08e7287557..000000000000 --- a/include/sound/ainstr_simple.h +++ /dev/null | |||
@@ -1,159 +0,0 @@ | |||
1 | /* | ||
2 | * Advanced Linux Sound Architecture | ||
3 | * | ||
4 | * Simple (MOD player) Instrument Format | ||
5 | * Copyright (c) 1994-99 by Jaroslav Kysela <perex@perex.cz> | ||
6 | * | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #ifndef __SOUND_AINSTR_SIMPLE_H | ||
25 | #define __SOUND_AINSTR_SIMPLE_H | ||
26 | |||
27 | #ifndef __KERNEL__ | ||
28 | #include <asm/types.h> | ||
29 | #include <asm/byteorder.h> | ||
30 | #endif | ||
31 | |||
32 | /* | ||
33 | * share types (share ID 1) | ||
34 | */ | ||
35 | |||
36 | #define SIMPLE_SHARE_FILE 0 | ||
37 | |||
38 | /* | ||
39 | * wave formats | ||
40 | */ | ||
41 | |||
42 | #define SIMPLE_WAVE_16BIT 0x0001 /* 16-bit wave */ | ||
43 | #define SIMPLE_WAVE_UNSIGNED 0x0002 /* unsigned wave */ | ||
44 | #define SIMPLE_WAVE_INVERT 0x0002 /* same as unsigned wave */ | ||
45 | #define SIMPLE_WAVE_BACKWARD 0x0004 /* backward mode (maybe used for reverb or ping-ping loop) */ | ||
46 | #define SIMPLE_WAVE_LOOP 0x0008 /* loop mode */ | ||
47 | #define SIMPLE_WAVE_BIDIR 0x0010 /* bidirectional mode */ | ||
48 | #define SIMPLE_WAVE_STEREO 0x0100 /* stereo wave */ | ||
49 | #define SIMPLE_WAVE_ULAW 0x0200 /* uLaw compression mode */ | ||
50 | |||
51 | /* | ||
52 | * instrument effects | ||
53 | */ | ||
54 | |||
55 | #define SIMPLE_EFFECT_NONE 0 | ||
56 | #define SIMPLE_EFFECT_REVERB 1 | ||
57 | #define SIMPLE_EFFECT_CHORUS 2 | ||
58 | #define SIMPLE_EFFECT_ECHO 3 | ||
59 | |||
60 | /* | ||
61 | * instrument info | ||
62 | */ | ||
63 | |||
64 | struct simple_instrument_info { | ||
65 | unsigned int format; /* supported format bits */ | ||
66 | unsigned int effects; /* supported effects (1 << SIMPLE_EFFECT_*) */ | ||
67 | unsigned int max8_len; /* maximum 8-bit wave length */ | ||
68 | unsigned int max16_len; /* maximum 16-bit wave length */ | ||
69 | }; | ||
70 | |||
71 | /* | ||
72 | * Instrument | ||
73 | */ | ||
74 | |||
75 | struct simple_instrument { | ||
76 | unsigned int share_id[4]; /* share id - zero = no sharing */ | ||
77 | unsigned int format; /* wave format */ | ||
78 | |||
79 | struct { | ||
80 | unsigned int number; /* some other ID for this instrument */ | ||
81 | unsigned int memory; /* begin of waveform in onboard memory */ | ||
82 | unsigned char *ptr; /* pointer to waveform in system memory */ | ||
83 | } address; | ||
84 | |||
85 | unsigned int size; /* size of waveform in samples */ | ||
86 | unsigned int start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ | ||
87 | unsigned int loop_start; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ | ||
88 | unsigned int loop_end; /* loop end offset in samples * 16 (lowest 4 bits - fraction) */ | ||
89 | unsigned short loop_repeat; /* loop repeat - 0 = forever */ | ||
90 | |||
91 | unsigned char effect1; /* effect 1 */ | ||
92 | unsigned char effect1_depth; /* 0-127 */ | ||
93 | unsigned char effect2; /* effect 2 */ | ||
94 | unsigned char effect2_depth; /* 0-127 */ | ||
95 | }; | ||
96 | |||
97 | /* | ||
98 | * | ||
99 | * Kernel <-> user space | ||
100 | * Hardware (CPU) independent section | ||
101 | * | ||
102 | * * = zero or more | ||
103 | * + = one or more | ||
104 | * | ||
105 | * simple_xinstrument SIMPLE_STRU_INSTR | ||
106 | * | ||
107 | */ | ||
108 | |||
109 | #define SIMPLE_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T') | ||
110 | |||
111 | /* | ||
112 | * Instrument | ||
113 | */ | ||
114 | |||
115 | struct simple_xinstrument { | ||
116 | __u32 stype; | ||
117 | |||
118 | __u32 share_id[4]; /* share id - zero = no sharing */ | ||
119 | __u32 format; /* wave format */ | ||
120 | |||
121 | __u32 size; /* size of waveform in samples */ | ||
122 | __u32 start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ | ||
123 | __u32 loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ | ||
124 | __u32 loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ | ||
125 | __u16 loop_repeat; /* loop repeat - 0 = forever */ | ||
126 | |||
127 | __u8 effect1; /* effect 1 */ | ||
128 | __u8 effect1_depth; /* 0-127 */ | ||
129 | __u8 effect2; /* effect 2 */ | ||
130 | __u8 effect2_depth; /* 0-127 */ | ||
131 | }; | ||
132 | |||
133 | #ifdef __KERNEL__ | ||
134 | |||
135 | #include "seq_instr.h" | ||
136 | |||
137 | struct snd_simple_ops { | ||
138 | void *private_data; | ||
139 | int (*info)(void *private_data, struct simple_instrument_info *info); | ||
140 | int (*put_sample)(void *private_data, struct simple_instrument *instr, | ||
141 | char __user *data, long len, int atomic); | ||
142 | int (*get_sample)(void *private_data, struct simple_instrument *instr, | ||
143 | char __user *data, long len, int atomic); | ||
144 | int (*remove_sample)(void *private_data, struct simple_instrument *instr, | ||
145 | int atomic); | ||
146 | void (*notify)(void *private_data, struct snd_seq_kinstr *instr, int what); | ||
147 | struct snd_seq_kinstr_ops kops; | ||
148 | }; | ||
149 | |||
150 | int snd_seq_simple_init(struct snd_simple_ops *ops, | ||
151 | void *private_data, | ||
152 | struct snd_seq_kinstr_ops *next); | ||
153 | |||
154 | #endif | ||
155 | |||
156 | /* typedefs for compatibility to user-space */ | ||
157 | typedef struct simple_xinstrument simple_xinstrument_t; | ||
158 | |||
159 | #endif /* __SOUND_AINSTR_SIMPLE_H */ | ||
diff --git a/include/sound/asequencer.h b/include/sound/asequencer.h index 64daccbe8b29..1505e6d5ef82 100644 --- a/include/sound/asequencer.h +++ b/include/sound/asequencer.h | |||
@@ -110,18 +110,7 @@ | |||
110 | #define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */ | 110 | #define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */ |
111 | #define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */ | 111 | #define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */ |
112 | 112 | ||
113 | /** synthesizer events | 113 | /* 70-89: synthesizer events - obsoleted */ |
114 | * event data type = snd_seq_eve_sample_control | ||
115 | */ | ||
116 | #define SNDRV_SEQ_EVENT_SAMPLE 70 /* sample select */ | ||
117 | #define SNDRV_SEQ_EVENT_SAMPLE_CLUSTER 71 /* sample cluster select */ | ||
118 | #define SNDRV_SEQ_EVENT_SAMPLE_START 72 /* voice start */ | ||
119 | #define SNDRV_SEQ_EVENT_SAMPLE_STOP 73 /* voice stop */ | ||
120 | #define SNDRV_SEQ_EVENT_SAMPLE_FREQ 74 /* playback frequency */ | ||
121 | #define SNDRV_SEQ_EVENT_SAMPLE_VOLUME 75 /* volume and balance */ | ||
122 | #define SNDRV_SEQ_EVENT_SAMPLE_LOOP 76 /* sample loop */ | ||
123 | #define SNDRV_SEQ_EVENT_SAMPLE_POSITION 77 /* sample position */ | ||
124 | #define SNDRV_SEQ_EVENT_SAMPLE_PRIVATE1 78 /* private (hardware dependent) event */ | ||
125 | 114 | ||
126 | /** user-defined events with fixed length | 115 | /** user-defined events with fixed length |
127 | * event data type = any | 116 | * event data type = any |
@@ -137,28 +126,7 @@ | |||
137 | #define SNDRV_SEQ_EVENT_USR8 98 | 126 | #define SNDRV_SEQ_EVENT_USR8 98 |
138 | #define SNDRV_SEQ_EVENT_USR9 99 | 127 | #define SNDRV_SEQ_EVENT_USR9 99 |
139 | 128 | ||
140 | /** instrument layer | 129 | /* 100-118: instrument layer - obsoleted */ |
141 | * variable length data can be passed directly to the driver | ||
142 | */ | ||
143 | #define SNDRV_SEQ_EVENT_INSTR_BEGIN 100 /* begin of instrument management */ | ||
144 | #define SNDRV_SEQ_EVENT_INSTR_END 101 /* end of instrument management */ | ||
145 | #define SNDRV_SEQ_EVENT_INSTR_INFO 102 /* instrument interface info */ | ||
146 | #define SNDRV_SEQ_EVENT_INSTR_INFO_RESULT 103 /* result */ | ||
147 | #define SNDRV_SEQ_EVENT_INSTR_FINFO 104 /* get format info */ | ||
148 | #define SNDRV_SEQ_EVENT_INSTR_FINFO_RESULT 105 /* get format info */ | ||
149 | #define SNDRV_SEQ_EVENT_INSTR_RESET 106 /* reset instrument memory */ | ||
150 | #define SNDRV_SEQ_EVENT_INSTR_STATUS 107 /* instrument interface status */ | ||
151 | #define SNDRV_SEQ_EVENT_INSTR_STATUS_RESULT 108 /* result */ | ||
152 | #define SNDRV_SEQ_EVENT_INSTR_PUT 109 /* put instrument to port */ | ||
153 | #define SNDRV_SEQ_EVENT_INSTR_GET 110 /* get instrument from port */ | ||
154 | #define SNDRV_SEQ_EVENT_INSTR_GET_RESULT 111 /* result */ | ||
155 | #define SNDRV_SEQ_EVENT_INSTR_FREE 112 /* free instrument(s) */ | ||
156 | #define SNDRV_SEQ_EVENT_INSTR_LIST 113 /* instrument list */ | ||
157 | #define SNDRV_SEQ_EVENT_INSTR_LIST_RESULT 114 /* result */ | ||
158 | #define SNDRV_SEQ_EVENT_INSTR_CLUSTER 115 /* cluster parameters */ | ||
159 | #define SNDRV_SEQ_EVENT_INSTR_CLUSTER_GET 116 /* get cluster parameters */ | ||
160 | #define SNDRV_SEQ_EVENT_INSTR_CLUSTER_RESULT 117 /* result */ | ||
161 | #define SNDRV_SEQ_EVENT_INSTR_CHANGE 118 /* instrument change */ | ||
162 | /* 119-129: reserved */ | 130 | /* 119-129: reserved */ |
163 | 131 | ||
164 | /* 130-139: variable length events | 132 | /* 130-139: variable length events |
@@ -258,78 +226,6 @@ struct snd_seq_ev_ext { | |||
258 | void *ptr; /* pointer to data (note: maybe 64-bit) */ | 226 | void *ptr; /* pointer to data (note: maybe 64-bit) */ |
259 | } __attribute__((packed)); | 227 | } __attribute__((packed)); |
260 | 228 | ||
261 | /* Instrument cluster type */ | ||
262 | typedef unsigned int snd_seq_instr_cluster_t; | ||
263 | |||
264 | /* Instrument type */ | ||
265 | struct snd_seq_instr { | ||
266 | snd_seq_instr_cluster_t cluster; | ||
267 | unsigned int std; /* the upper byte means a private instrument (owner - client #) */ | ||
268 | unsigned short bank; | ||
269 | unsigned short prg; | ||
270 | }; | ||
271 | |||
272 | /* sample number */ | ||
273 | struct snd_seq_ev_sample { | ||
274 | unsigned int std; | ||
275 | unsigned short bank; | ||
276 | unsigned short prg; | ||
277 | }; | ||
278 | |||
279 | /* sample cluster */ | ||
280 | struct snd_seq_ev_cluster { | ||
281 | snd_seq_instr_cluster_t cluster; | ||
282 | }; | ||
283 | |||
284 | /* sample position */ | ||
285 | typedef unsigned int snd_seq_position_t; /* playback position (in samples) * 16 */ | ||
286 | |||
287 | /* sample stop mode */ | ||
288 | enum { | ||
289 | SAMPLE_STOP_IMMEDIATELY = 0, /* terminate playing immediately */ | ||
290 | SAMPLE_STOP_VENVELOPE = 1, /* finish volume envelope */ | ||
291 | SAMPLE_STOP_LOOP = 2 /* terminate loop and finish wave */ | ||
292 | }; | ||
293 | |||
294 | /* sample frequency */ | ||
295 | typedef int snd_seq_frequency_t; /* playback frequency in HZ * 16 */ | ||
296 | |||
297 | /* sample volume control; if any value is set to -1 == do not change */ | ||
298 | struct snd_seq_ev_volume { | ||
299 | signed short volume; /* range: 0-16383 */ | ||
300 | signed short lr; /* left-right balance; range: 0-16383 */ | ||
301 | signed short fr; /* front-rear balance; range: 0-16383 */ | ||
302 | signed short du; /* down-up balance; range: 0-16383 */ | ||
303 | }; | ||
304 | |||
305 | /* simple loop redefinition */ | ||
306 | struct snd_seq_ev_loop { | ||
307 | unsigned int start; /* loop start (in samples) * 16 */ | ||
308 | unsigned int end; /* loop end (in samples) * 16 */ | ||
309 | }; | ||
310 | |||
311 | struct snd_seq_ev_sample_control { | ||
312 | unsigned char channel; | ||
313 | unsigned char unused1, unused2, unused3; /* pad */ | ||
314 | union { | ||
315 | struct snd_seq_ev_sample sample; | ||
316 | struct snd_seq_ev_cluster cluster; | ||
317 | snd_seq_position_t position; | ||
318 | int stop_mode; | ||
319 | snd_seq_frequency_t frequency; | ||
320 | struct snd_seq_ev_volume volume; | ||
321 | struct snd_seq_ev_loop loop; | ||
322 | unsigned char raw8[8]; | ||
323 | } param; | ||
324 | }; | ||
325 | |||
326 | |||
327 | |||
328 | /* INSTR_BEGIN event */ | ||
329 | struct snd_seq_ev_instr_begin { | ||
330 | int timeout; /* zero = forever, otherwise timeout in ms */ | ||
331 | }; | ||
332 | |||
333 | struct snd_seq_result { | 229 | struct snd_seq_result { |
334 | int event; /* processed event type */ | 230 | int event; /* processed event type */ |
335 | int result; | 231 | int result; |
@@ -399,8 +295,6 @@ struct snd_seq_event { | |||
399 | struct snd_seq_addr addr; | 295 | struct snd_seq_addr addr; |
400 | struct snd_seq_connect connect; | 296 | struct snd_seq_connect connect; |
401 | struct snd_seq_result result; | 297 | struct snd_seq_result result; |
402 | struct snd_seq_ev_instr_begin instr_begin; | ||
403 | struct snd_seq_ev_sample_control sample; | ||
404 | struct snd_seq_ev_quote quote; | 298 | struct snd_seq_ev_quote quote; |
405 | } data; | 299 | } data; |
406 | }; | 300 | }; |
@@ -441,8 +335,6 @@ struct snd_seq_event_bounce { | |||
441 | #define snd_seq_ev_is_user_type(ev) ((ev)->type >= 90 && (ev)->type < 99) | 335 | #define snd_seq_ev_is_user_type(ev) ((ev)->type >= 90 && (ev)->type < 99) |
442 | /* fixed length events: 0-99 */ | 336 | /* fixed length events: 0-99 */ |
443 | #define snd_seq_ev_is_fixed_type(ev) ((ev)->type < 100) | 337 | #define snd_seq_ev_is_fixed_type(ev) ((ev)->type < 100) |
444 | /* instrument layer events: 100-129 */ | ||
445 | #define snd_seq_ev_is_instr_type(ev) ((ev)->type >= 100 && (ev)->type < 130) | ||
446 | /* variable length events: 130-139 */ | 338 | /* variable length events: 130-139 */ |
447 | #define snd_seq_ev_is_variable_type(ev) ((ev)->type >= 130 && (ev)->type < 140) | 339 | #define snd_seq_ev_is_variable_type(ev) ((ev)->type >= 130 && (ev)->type < 140) |
448 | /* reserved for kernel */ | 340 | /* reserved for kernel */ |
@@ -738,136 +630,6 @@ struct snd_seq_query_subs { | |||
738 | 630 | ||
739 | 631 | ||
740 | /* | 632 | /* |
741 | * Instrument abstraction layer | ||
742 | * - based on events | ||
743 | */ | ||
744 | |||
745 | /* instrument types */ | ||
746 | #define SNDRV_SEQ_INSTR_ATYPE_DATA 0 /* instrument data */ | ||
747 | #define SNDRV_SEQ_INSTR_ATYPE_ALIAS 1 /* instrument alias */ | ||
748 | |||
749 | /* instrument ASCII identifiers */ | ||
750 | #define SNDRV_SEQ_INSTR_ID_DLS1 "DLS1" | ||
751 | #define SNDRV_SEQ_INSTR_ID_DLS2 "DLS2" | ||
752 | #define SNDRV_SEQ_INSTR_ID_SIMPLE "Simple Wave" | ||
753 | #define SNDRV_SEQ_INSTR_ID_SOUNDFONT "SoundFont" | ||
754 | #define SNDRV_SEQ_INSTR_ID_GUS_PATCH "GUS Patch" | ||
755 | #define SNDRV_SEQ_INSTR_ID_INTERWAVE "InterWave FFFF" | ||
756 | #define SNDRV_SEQ_INSTR_ID_OPL2_3 "OPL2/3 FM" | ||
757 | #define SNDRV_SEQ_INSTR_ID_OPL4 "OPL4" | ||
758 | |||
759 | /* instrument types */ | ||
760 | #define SNDRV_SEQ_INSTR_TYPE0_DLS1 (1<<0) /* MIDI DLS v1 */ | ||
761 | #define SNDRV_SEQ_INSTR_TYPE0_DLS2 (1<<1) /* MIDI DLS v2 */ | ||
762 | #define SNDRV_SEQ_INSTR_TYPE1_SIMPLE (1<<0) /* Simple Wave */ | ||
763 | #define SNDRV_SEQ_INSTR_TYPE1_SOUNDFONT (1<<1) /* EMU SoundFont */ | ||
764 | #define SNDRV_SEQ_INSTR_TYPE1_GUS_PATCH (1<<2) /* Gravis UltraSound Patch */ | ||
765 | #define SNDRV_SEQ_INSTR_TYPE1_INTERWAVE (1<<3) /* InterWave FFFF */ | ||
766 | #define SNDRV_SEQ_INSTR_TYPE2_OPL2_3 (1<<0) /* Yamaha OPL2/3 FM */ | ||
767 | #define SNDRV_SEQ_INSTR_TYPE2_OPL4 (1<<1) /* Yamaha OPL4 */ | ||
768 | |||
769 | /* put commands */ | ||
770 | #define SNDRV_SEQ_INSTR_PUT_CMD_CREATE 0 | ||
771 | #define SNDRV_SEQ_INSTR_PUT_CMD_REPLACE 1 | ||
772 | #define SNDRV_SEQ_INSTR_PUT_CMD_MODIFY 2 | ||
773 | #define SNDRV_SEQ_INSTR_PUT_CMD_ADD 3 | ||
774 | #define SNDRV_SEQ_INSTR_PUT_CMD_REMOVE 4 | ||
775 | |||
776 | /* get commands */ | ||
777 | #define SNDRV_SEQ_INSTR_GET_CMD_FULL 0 | ||
778 | #define SNDRV_SEQ_INSTR_GET_CMD_PARTIAL 1 | ||
779 | |||
780 | /* query flags */ | ||
781 | #define SNDRV_SEQ_INSTR_QUERY_FOLLOW_ALIAS (1<<0) | ||
782 | |||
783 | /* free commands */ | ||
784 | #define SNDRV_SEQ_INSTR_FREE_CMD_ALL 0 | ||
785 | #define SNDRV_SEQ_INSTR_FREE_CMD_PRIVATE 1 | ||
786 | #define SNDRV_SEQ_INSTR_FREE_CMD_CLUSTER 2 | ||
787 | #define SNDRV_SEQ_INSTR_FREE_CMD_SINGLE 3 | ||
788 | |||
789 | /* size of ROM/RAM */ | ||
790 | typedef unsigned int snd_seq_instr_size_t; | ||
791 | |||
792 | /* INSTR_INFO */ | ||
793 | |||
794 | struct snd_seq_instr_info { | ||
795 | int result; /* operation result */ | ||
796 | unsigned int formats[8]; /* bitmap of supported formats */ | ||
797 | int ram_count; /* count of RAM banks */ | ||
798 | snd_seq_instr_size_t ram_sizes[16]; /* size of RAM banks */ | ||
799 | int rom_count; /* count of ROM banks */ | ||
800 | snd_seq_instr_size_t rom_sizes[8]; /* size of ROM banks */ | ||
801 | char reserved[128]; | ||
802 | }; | ||
803 | |||
804 | /* INSTR_STATUS */ | ||
805 | |||
806 | struct snd_seq_instr_status { | ||
807 | int result; /* operation result */ | ||
808 | snd_seq_instr_size_t free_ram[16]; /* free RAM in banks */ | ||
809 | int instrument_count; /* count of downloaded instruments */ | ||
810 | char reserved[128]; | ||
811 | }; | ||
812 | |||
813 | /* INSTR_FORMAT_INFO */ | ||
814 | |||
815 | struct snd_seq_instr_format_info { | ||
816 | char format[16]; /* format identifier - SNDRV_SEQ_INSTR_ID_* */ | ||
817 | unsigned int len; /* max data length (without this structure) */ | ||
818 | }; | ||
819 | |||
820 | struct snd_seq_instr_format_info_result { | ||
821 | int result; /* operation result */ | ||
822 | char format[16]; /* format identifier */ | ||
823 | unsigned int len; /* filled data length (without this structure) */ | ||
824 | }; | ||
825 | |||
826 | /* instrument data */ | ||
827 | struct snd_seq_instr_data { | ||
828 | char name[32]; /* instrument name */ | ||
829 | char reserved[16]; /* for the future use */ | ||
830 | int type; /* instrument type */ | ||
831 | union { | ||
832 | char format[16]; /* format identifier */ | ||
833 | struct snd_seq_instr alias; | ||
834 | } data; | ||
835 | }; | ||
836 | |||
837 | /* INSTR_PUT/GET, data are stored in one block (extended), header + data */ | ||
838 | |||
839 | struct snd_seq_instr_header { | ||
840 | union { | ||
841 | struct snd_seq_instr instr; | ||
842 | snd_seq_instr_cluster_t cluster; | ||
843 | } id; /* instrument identifier */ | ||
844 | unsigned int cmd; /* get/put/free command */ | ||
845 | unsigned int flags; /* query flags (only for get) */ | ||
846 | unsigned int len; /* real instrument data length (without header) */ | ||
847 | int result; /* operation result */ | ||
848 | char reserved[16]; /* for the future */ | ||
849 | struct snd_seq_instr_data data; /* instrument data (for put/get result) */ | ||
850 | }; | ||
851 | |||
852 | /* INSTR_CLUSTER_SET */ | ||
853 | |||
854 | struct snd_seq_instr_cluster_set { | ||
855 | snd_seq_instr_cluster_t cluster; /* cluster identifier */ | ||
856 | char name[32]; /* cluster name */ | ||
857 | int priority; /* cluster priority */ | ||
858 | char reserved[64]; /* for the future use */ | ||
859 | }; | ||
860 | |||
861 | /* INSTR_CLUSTER_GET */ | ||
862 | |||
863 | struct snd_seq_instr_cluster_get { | ||
864 | snd_seq_instr_cluster_t cluster; /* cluster identifier */ | ||
865 | char name[32]; /* cluster name */ | ||
866 | int priority; /* cluster priority */ | ||
867 | char reserved[64]; /* for the future use */ | ||
868 | }; | ||
869 | |||
870 | /* | ||
871 | * IOCTL commands | 633 | * IOCTL commands |
872 | */ | 634 | */ |
873 | 635 | ||
diff --git a/include/sound/gus.h b/include/sound/gus.h index e5433d8b78bc..841bb8df38c1 100644 --- a/include/sound/gus.h +++ b/include/sound/gus.h | |||
@@ -27,13 +27,8 @@ | |||
27 | #include "timer.h" | 27 | #include "timer.h" |
28 | #include "seq_midi_emul.h" | 28 | #include "seq_midi_emul.h" |
29 | #include "seq_device.h" | 29 | #include "seq_device.h" |
30 | #include "ainstr_iw.h" | ||
31 | #include "ainstr_gf1.h" | ||
32 | #include "ainstr_simple.h" | ||
33 | #include <asm/io.h> | 30 | #include <asm/io.h> |
34 | 31 | ||
35 | #define SNDRV_SEQ_DEV_ID_GUS "gus-synth" | ||
36 | |||
37 | /* IO ports */ | 32 | /* IO ports */ |
38 | 33 | ||
39 | #define GUSP(gus, x) ((gus)->gf1.port + SNDRV_g_u_s_##x) | 34 | #define GUSP(gus, x) ((gus)->gf1.port + SNDRV_g_u_s_##x) |
@@ -234,16 +229,6 @@ struct snd_gus_port { | |||
234 | 229 | ||
235 | struct snd_gus_voice; | 230 | struct snd_gus_voice; |
236 | 231 | ||
237 | struct snd_gus_sample_ops { | ||
238 | void (*sample_start)(struct snd_gus_card *gus, struct snd_gus_voice *voice, snd_seq_position_t position); | ||
239 | void (*sample_stop)(struct snd_gus_card *gus, struct snd_gus_voice *voice, int mode); | ||
240 | void (*sample_freq)(struct snd_gus_card *gus, struct snd_gus_voice *voice, snd_seq_frequency_t freq); | ||
241 | void (*sample_volume)(struct snd_gus_card *gus, struct snd_gus_voice *voice, struct snd_seq_ev_volume *volume); | ||
242 | void (*sample_loop)(struct snd_gus_card *card, struct snd_gus_voice *voice, struct snd_seq_ev_loop *loop); | ||
243 | void (*sample_pos)(struct snd_gus_card *card, struct snd_gus_voice *voice, snd_seq_position_t position); | ||
244 | void (*sample_private1)(struct snd_gus_card *card, struct snd_gus_voice *voice, unsigned char *data); | ||
245 | }; | ||
246 | |||
247 | #define SNDRV_GF1_VOICE_TYPE_PCM 0 | 232 | #define SNDRV_GF1_VOICE_TYPE_PCM 0 |
248 | #define SNDRV_GF1_VOICE_TYPE_SYNTH 1 | 233 | #define SNDRV_GF1_VOICE_TYPE_SYNTH 1 |
249 | #define SNDRV_GF1_VOICE_TYPE_MIDI 2 | 234 | #define SNDRV_GF1_VOICE_TYPE_MIDI 2 |
@@ -284,12 +269,8 @@ struct snd_gus_voice { | |||
284 | 269 | ||
285 | struct snd_gus_sample_ops *sample_ops; | 270 | struct snd_gus_sample_ops *sample_ops; |
286 | 271 | ||
287 | struct snd_seq_instr instr; | ||
288 | |||
289 | /* running status / registers */ | 272 | /* running status / registers */ |
290 | 273 | ||
291 | struct snd_seq_ev_volume sample_volume; | ||
292 | |||
293 | unsigned short fc_register; | 274 | unsigned short fc_register; |
294 | unsigned short fc_lfo; | 275 | unsigned short fc_lfo; |
295 | unsigned short gf1_volume; | 276 | unsigned short gf1_volume; |
@@ -382,10 +363,6 @@ struct snd_gf1 { | |||
382 | 363 | ||
383 | int seq_client; | 364 | int seq_client; |
384 | struct snd_gus_port seq_ports[4]; | 365 | struct snd_gus_port seq_ports[4]; |
385 | struct snd_seq_kinstr_list *ilist; | ||
386 | struct snd_iwffff_ops iwffff_ops; | ||
387 | struct snd_gf1_ops gf1_ops; | ||
388 | struct snd_simple_ops simple_ops; | ||
389 | 366 | ||
390 | /* timer */ | 367 | /* timer */ |
391 | 368 | ||
@@ -458,8 +435,6 @@ struct snd_gus_card { | |||
458 | struct snd_rawmidi_substream *midi_substream_output; | 435 | struct snd_rawmidi_substream *midi_substream_output; |
459 | struct snd_rawmidi_substream *midi_substream_input; | 436 | struct snd_rawmidi_substream *midi_substream_input; |
460 | 437 | ||
461 | struct snd_seq_device *seq_dev; | ||
462 | |||
463 | spinlock_t reg_lock; | 438 | spinlock_t reg_lock; |
464 | spinlock_t voice_alloc; | 439 | spinlock_t voice_alloc; |
465 | spinlock_t active_voice_lock; | 440 | spinlock_t active_voice_lock; |
@@ -647,48 +622,10 @@ void snd_gus_irq_profile_init(struct snd_gus_card *gus); | |||
647 | 622 | ||
648 | int snd_gf1_rawmidi_new(struct snd_gus_card * gus, int device, struct snd_rawmidi **rrawmidi); | 623 | int snd_gf1_rawmidi_new(struct snd_gus_card * gus, int device, struct snd_rawmidi **rrawmidi); |
649 | 624 | ||
650 | #if 0 | ||
651 | extern void snd_engine_instrument_register(unsigned short mode, | ||
652 | struct _SND_INSTRUMENT_VOICE_COMMANDS *voice_cmds, | ||
653 | struct _SND_INSTRUMENT_NOTE_COMMANDS *note_cmds, | ||
654 | struct _SND_INSTRUMENT_CHANNEL_COMMANDS *channel_cmds); | ||
655 | extern int snd_engine_instrument_register_ask(unsigned short mode); | ||
656 | #endif | ||
657 | |||
658 | /* gus_dram.c */ | 625 | /* gus_dram.c */ |
659 | int snd_gus_dram_write(struct snd_gus_card *gus, char __user *ptr, | 626 | int snd_gus_dram_write(struct snd_gus_card *gus, char __user *ptr, |
660 | unsigned int addr, unsigned int size); | 627 | unsigned int addr, unsigned int size); |
661 | int snd_gus_dram_read(struct snd_gus_card *gus, char __user *ptr, | 628 | int snd_gus_dram_read(struct snd_gus_card *gus, char __user *ptr, |
662 | unsigned int addr, unsigned int size, int rom); | 629 | unsigned int addr, unsigned int size, int rom); |
663 | 630 | ||
664 | #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) | ||
665 | |||
666 | /* gus_sample.c */ | ||
667 | void snd_gus_sample_event(struct snd_seq_event *ev, struct snd_gus_port *p); | ||
668 | |||
669 | /* gus_simple.c */ | ||
670 | void snd_gf1_simple_init(struct snd_gus_voice *voice); | ||
671 | |||
672 | /* gus_instr.c */ | ||
673 | int snd_gus_iwffff_put_sample(void *private_data, struct iwffff_wave *wave, | ||
674 | char __user *data, long len, int atomic); | ||
675 | int snd_gus_iwffff_get_sample(void *private_data, struct iwffff_wave *wave, | ||
676 | char __user *data, long len, int atomic); | ||
677 | int snd_gus_iwffff_remove_sample(void *private_data, struct iwffff_wave *wave, | ||
678 | int atomic); | ||
679 | int snd_gus_gf1_put_sample(void *private_data, struct gf1_wave *wave, | ||
680 | char __user *data, long len, int atomic); | ||
681 | int snd_gus_gf1_get_sample(void *private_data, struct gf1_wave *wave, | ||
682 | char __user *data, long len, int atomic); | ||
683 | int snd_gus_gf1_remove_sample(void *private_data, struct gf1_wave *wave, | ||
684 | int atomic); | ||
685 | int snd_gus_simple_put_sample(void *private_data, struct simple_instrument *instr, | ||
686 | char __user *data, long len, int atomic); | ||
687 | int snd_gus_simple_get_sample(void *private_data, struct simple_instrument *instr, | ||
688 | char __user *data, long len, int atomic); | ||
689 | int snd_gus_simple_remove_sample(void *private_data, struct simple_instrument *instr, | ||
690 | int atomic); | ||
691 | |||
692 | #endif /* CONFIG_SND_SEQUENCER */ | ||
693 | |||
694 | #endif /* __SOUND_GUS_H */ | 631 | #endif /* __SOUND_GUS_H */ |
diff --git a/include/sound/seq_instr.h b/include/sound/seq_instr.h deleted file mode 100644 index 93b0c51df5b0..000000000000 --- a/include/sound/seq_instr.h +++ /dev/null | |||
@@ -1,110 +0,0 @@ | |||
1 | #ifndef __SOUND_SEQ_INSTR_H | ||
2 | #define __SOUND_SEQ_INSTR_H | ||
3 | |||
4 | /* | ||
5 | * Main kernel header file for the ALSA sequencer | ||
6 | * Copyright (c) 1999 by Jaroslav Kysela <perex@perex.cz> | ||
7 | * | ||
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 | #include "seq_kernel.h" | ||
25 | |||
26 | /* Instrument cluster */ | ||
27 | struct snd_seq_kcluster { | ||
28 | snd_seq_instr_cluster_t cluster; | ||
29 | char name[32]; | ||
30 | int priority; | ||
31 | struct snd_seq_kcluster *next; | ||
32 | }; | ||
33 | |||
34 | /* return pointer to private data */ | ||
35 | #define KINSTR_DATA(kinstr) (void *)(((char *)kinstr) + sizeof(struct snd_seq_kinstr)) | ||
36 | |||
37 | /* Instrument structure */ | ||
38 | struct snd_seq_kinstr { | ||
39 | struct snd_seq_instr instr; | ||
40 | char name[32]; | ||
41 | int type; /* instrument type */ | ||
42 | int use; /* use count */ | ||
43 | int busy; /* not useable */ | ||
44 | int add_len; /* additional length */ | ||
45 | struct snd_seq_kinstr_ops *ops; /* operations */ | ||
46 | struct snd_seq_kinstr *next; | ||
47 | }; | ||
48 | |||
49 | #define SNDRV_SEQ_INSTR_HASH_SIZE 32 | ||
50 | |||
51 | /* Instrument flags */ | ||
52 | #define SNDRV_SEQ_INSTR_FLG_DIRECT (1<<0) /* accept only direct events */ | ||
53 | |||
54 | /* List of all instruments */ | ||
55 | struct snd_seq_kinstr_list { | ||
56 | struct snd_seq_kinstr *hash[SNDRV_SEQ_INSTR_HASH_SIZE]; | ||
57 | int count; /* count of all instruments */ | ||
58 | |||
59 | struct snd_seq_kcluster *chash[SNDRV_SEQ_INSTR_HASH_SIZE]; | ||
60 | int ccount; /* count of all clusters */ | ||
61 | |||
62 | int owner; /* current owner of the instrument list */ | ||
63 | unsigned int flags; | ||
64 | |||
65 | spinlock_t lock; | ||
66 | spinlock_t ops_lock; | ||
67 | struct mutex ops_mutex; | ||
68 | unsigned long ops_flags; | ||
69 | }; | ||
70 | |||
71 | #define SNDRV_SEQ_INSTR_NOTIFY_REMOVE 0 | ||
72 | #define SNDRV_SEQ_INSTR_NOTIFY_CHANGE 1 | ||
73 | |||
74 | struct snd_seq_kinstr_ops { | ||
75 | void *private_data; | ||
76 | long add_len; /* additional length */ | ||
77 | char *instr_type; | ||
78 | int (*info)(void *private_data, char *info_data, long len); | ||
79 | int (*put)(void *private_data, struct snd_seq_kinstr *kinstr, | ||
80 | char __user *instr_data, long len, int atomic, int cmd); | ||
81 | int (*get)(void *private_data, struct snd_seq_kinstr *kinstr, | ||
82 | char __user *instr_data, long len, int atomic, int cmd); | ||
83 | int (*get_size)(void *private_data, struct snd_seq_kinstr *kinstr, long *size); | ||
84 | int (*remove)(void *private_data, struct snd_seq_kinstr *kinstr, int atomic); | ||
85 | void (*notify)(void *private_data, struct snd_seq_kinstr *kinstr, int what); | ||
86 | struct snd_seq_kinstr_ops *next; | ||
87 | }; | ||
88 | |||
89 | |||
90 | /* instrument operations */ | ||
91 | struct snd_seq_kinstr_list *snd_seq_instr_list_new(void); | ||
92 | void snd_seq_instr_list_free(struct snd_seq_kinstr_list **list); | ||
93 | int snd_seq_instr_list_free_cond(struct snd_seq_kinstr_list *list, | ||
94 | struct snd_seq_instr_header *ifree, | ||
95 | int client, | ||
96 | int atomic); | ||
97 | struct snd_seq_kinstr *snd_seq_instr_find(struct snd_seq_kinstr_list *list, | ||
98 | struct snd_seq_instr *instr, | ||
99 | int exact, | ||
100 | int follow_alias); | ||
101 | void snd_seq_instr_free_use(struct snd_seq_kinstr_list *list, | ||
102 | struct snd_seq_kinstr *instr); | ||
103 | int snd_seq_instr_event(struct snd_seq_kinstr_ops *ops, | ||
104 | struct snd_seq_kinstr_list *list, | ||
105 | struct snd_seq_event *ev, | ||
106 | int client, | ||
107 | int atomic, | ||
108 | int hop); | ||
109 | |||
110 | #endif /* __SOUND_SEQ_INSTR_H */ | ||
diff --git a/include/sound/trident.h b/include/sound/trident.h index 9752243241e5..9f191a0a1e19 100644 --- a/include/sound/trident.h +++ b/include/sound/trident.h | |||
@@ -26,19 +26,12 @@ | |||
26 | #include "pcm.h" | 26 | #include "pcm.h" |
27 | #include "mpu401.h" | 27 | #include "mpu401.h" |
28 | #include "ac97_codec.h" | 28 | #include "ac97_codec.h" |
29 | #include "seq_midi_emul.h" | ||
30 | #include "seq_device.h" | ||
31 | #include "util_mem.h" | 29 | #include "util_mem.h" |
32 | //#include "ainstr_iw.h" | ||
33 | //#include "ainstr_gf1.h" | ||
34 | #include "ainstr_simple.h" | ||
35 | 30 | ||
36 | #define TRIDENT_DEVICE_ID_DX ((PCI_VENDOR_ID_TRIDENT<<16)|PCI_DEVICE_ID_TRIDENT_4DWAVE_DX) | 31 | #define TRIDENT_DEVICE_ID_DX ((PCI_VENDOR_ID_TRIDENT<<16)|PCI_DEVICE_ID_TRIDENT_4DWAVE_DX) |
37 | #define TRIDENT_DEVICE_ID_NX ((PCI_VENDOR_ID_TRIDENT<<16)|PCI_DEVICE_ID_TRIDENT_4DWAVE_NX) | 32 | #define TRIDENT_DEVICE_ID_NX ((PCI_VENDOR_ID_TRIDENT<<16)|PCI_DEVICE_ID_TRIDENT_4DWAVE_NX) |
38 | #define TRIDENT_DEVICE_ID_SI7018 ((PCI_VENDOR_ID_SI<<16)|PCI_DEVICE_ID_SI_7018) | 33 | #define TRIDENT_DEVICE_ID_SI7018 ((PCI_VENDOR_ID_SI<<16)|PCI_DEVICE_ID_SI_7018) |
39 | 34 | ||
40 | #define SNDRV_SEQ_DEV_ID_TRIDENT "trident-synth" | ||
41 | |||
42 | #define SNDRV_TRIDENT_VOICE_TYPE_PCM 0 | 35 | #define SNDRV_TRIDENT_VOICE_TYPE_PCM 0 |
43 | #define SNDRV_TRIDENT_VOICE_TYPE_SYNTH 1 | 36 | #define SNDRV_TRIDENT_VOICE_TYPE_SYNTH 1 |
44 | #define SNDRV_TRIDENT_VOICE_TYPE_MIDI 2 | 37 | #define SNDRV_TRIDENT_VOICE_TYPE_MIDI 2 |
@@ -257,16 +250,6 @@ struct snd_trident; | |||
257 | struct snd_trident_voice; | 250 | struct snd_trident_voice; |
258 | struct snd_trident_pcm_mixer; | 251 | struct snd_trident_pcm_mixer; |
259 | 252 | ||
260 | struct snd_trident_sample_ops { | ||
261 | void (*sample_start)(struct snd_trident *gus, struct snd_trident_voice *voice, snd_seq_position_t position); | ||
262 | void (*sample_stop)(struct snd_trident *gus, struct snd_trident_voice *voice, int mode); | ||
263 | void (*sample_freq)(struct snd_trident *gus, struct snd_trident_voice *voice, snd_seq_frequency_t freq); | ||
264 | void (*sample_volume)(struct snd_trident *gus, struct snd_trident_voice *voice, struct snd_seq_ev_volume *volume); | ||
265 | void (*sample_loop)(struct snd_trident *card, struct snd_trident_voice *voice, struct snd_seq_ev_loop *loop); | ||
266 | void (*sample_pos)(struct snd_trident *card, struct snd_trident_voice *voice, snd_seq_position_t position); | ||
267 | void (*sample_private1)(struct snd_trident *card, struct snd_trident_voice *voice, unsigned char *data); | ||
268 | }; | ||
269 | |||
270 | struct snd_trident_port { | 253 | struct snd_trident_port { |
271 | struct snd_midi_channel_set * chset; | 254 | struct snd_midi_channel_set * chset; |
272 | struct snd_trident * trident; | 255 | struct snd_trident * trident; |
@@ -300,7 +283,6 @@ struct snd_trident_voice { | |||
300 | unsigned char port; | 283 | unsigned char port; |
301 | unsigned char index; | 284 | unsigned char index; |
302 | 285 | ||
303 | struct snd_seq_instr instr; | ||
304 | struct snd_trident_sample_ops *sample_ops; | 286 | struct snd_trident_sample_ops *sample_ops; |
305 | 287 | ||
306 | /* channel parameters */ | 288 | /* channel parameters */ |
@@ -354,9 +336,6 @@ struct snd_4dwave { | |||
354 | int seq_client; | 336 | int seq_client; |
355 | 337 | ||
356 | struct snd_trident_port seq_ports[4]; | 338 | struct snd_trident_port seq_ports[4]; |
357 | struct snd_simple_ops simple_ops; | ||
358 | struct snd_seq_kinstr_list *ilist; | ||
359 | |||
360 | struct snd_trident_voice voices[64]; | 339 | struct snd_trident_voice voices[64]; |
361 | 340 | ||
362 | int ChanSynthCount; /* number of allocated synth channels */ | 341 | int ChanSynthCount; /* number of allocated synth channels */ |
@@ -416,7 +395,6 @@ struct snd_trident { | |||
416 | struct snd_pcm *foldback; /* Foldback PCM */ | 395 | struct snd_pcm *foldback; /* Foldback PCM */ |
417 | struct snd_pcm *spdif; /* SPDIF PCM */ | 396 | struct snd_pcm *spdif; /* SPDIF PCM */ |
418 | struct snd_rawmidi *rmidi; | 397 | struct snd_rawmidi *rmidi; |
419 | struct snd_seq_device *seq_dev; | ||
420 | 398 | ||
421 | struct snd_ac97_bus *ac97_bus; | 399 | struct snd_ac97_bus *ac97_bus; |
422 | struct snd_ac97 *ac97; | 400 | struct snd_ac97 *ac97; |