aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/ainstr_iw.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sound/ainstr_iw.h')
-rw-r--r--include/sound/ainstr_iw.h115
1 files changed, 63 insertions, 52 deletions
diff --git a/include/sound/ainstr_iw.h b/include/sound/ainstr_iw.h
index 8adf744926ff..251feaf1b388 100644
--- a/include/sound/ainstr_iw.h
+++ b/include/sound/ainstr_iw.h
@@ -54,7 +54,7 @@
54 * Wavetable definitions 54 * Wavetable definitions
55 */ 55 */
56 56
57typedef struct iwffff_wave { 57struct iwffff_wave {
58 unsigned int share_id[4]; /* share id - zero = no sharing */ 58 unsigned int share_id[4]; /* share id - zero = no sharing */
59 unsigned int format; /* wave format */ 59 unsigned int format; /* wave format */
60 60
@@ -76,7 +76,7 @@ typedef struct iwffff_wave {
76 unsigned char pad; 76 unsigned char pad;
77 77
78 struct iwffff_wave *next; 78 struct iwffff_wave *next;
79} iwffff_wave_t; 79};
80 80
81/* 81/*
82 * Layer 82 * Layer
@@ -85,13 +85,13 @@ typedef struct iwffff_wave {
85#define IWFFFF_LFO_SHAPE_TRIANGLE 0 85#define IWFFFF_LFO_SHAPE_TRIANGLE 0
86#define IWFFFF_LFO_SHAPE_POSTRIANGLE 1 86#define IWFFFF_LFO_SHAPE_POSTRIANGLE 1
87 87
88typedef struct iwffff_lfo { 88struct iwffff_lfo {
89 unsigned short freq; /* (0-2047) 0.01Hz - 21.5Hz */ 89 unsigned short freq; /* (0-2047) 0.01Hz - 21.5Hz */
90 signed short depth; /* volume +- (0-255) 0.48675dB/step */ 90 signed short depth; /* volume +- (0-255) 0.48675dB/step */
91 signed short sweep; /* 0 - 950 deciseconds */ 91 signed short sweep; /* 0 - 950 deciseconds */
92 unsigned char shape; /* see to IWFFFF_LFO_SHAPE_XXXX */ 92 unsigned char shape; /* see to IWFFFF_LFO_SHAPE_XXXX */
93 unsigned char delay; /* 0 - 255 deciseconds */ 93 unsigned char delay; /* 0 - 255 deciseconds */
94} iwffff_lfo_t; 94};
95 95
96#define IWFFFF_ENV_FLAG_RETRIGGER 0x0001 /* flag - retrigger */ 96#define IWFFFF_ENV_FLAG_RETRIGGER 0x0001 /* flag - retrigger */
97 97
@@ -102,12 +102,12 @@ typedef struct iwffff_lfo {
102#define IWFFFF_ENV_INDEX_VELOCITY 0x0001 /* index - velocity */ 102#define IWFFFF_ENV_INDEX_VELOCITY 0x0001 /* index - velocity */
103#define IWFFFF_ENV_INDEX_FREQUENCY 0x0002 /* index - frequency */ 103#define IWFFFF_ENV_INDEX_FREQUENCY 0x0002 /* index - frequency */
104 104
105typedef struct iwffff_env_point { 105struct iwffff_env_point {
106 unsigned short offset; 106 unsigned short offset;
107 unsigned short rate; 107 unsigned short rate;
108} iwffff_env_point_t; 108};
109 109
110typedef struct iwffff_env_record { 110struct iwffff_env_record {
111 unsigned short nattack; 111 unsigned short nattack;
112 unsigned short nrelease; 112 unsigned short nrelease;
113 unsigned short sustain_offset; 113 unsigned short sustain_offset;
@@ -118,15 +118,15 @@ typedef struct iwffff_env_record {
118 struct iwffff_env_record *next; 118 struct iwffff_env_record *next;
119 /* points are stored here */ 119 /* points are stored here */
120 /* count of points = nattack + nrelease */ 120 /* count of points = nattack + nrelease */
121} iwffff_env_record_t; 121};
122 122
123typedef struct iwffff_env { 123struct iwffff_env {
124 unsigned char flags; 124 unsigned char flags;
125 unsigned char mode; 125 unsigned char mode;
126 unsigned char index; 126 unsigned char index;
127 unsigned char pad; 127 unsigned char pad;
128 struct iwffff_env_record *record; 128 struct iwffff_env_record *record;
129} iwffff_env_t; 129};
130 130
131#define IWFFFF_LAYER_FLAG_RETRIGGER 0x0001 /* retrigger */ 131#define IWFFFF_LAYER_FLAG_RETRIGGER 0x0001 /* retrigger */
132 132
@@ -138,7 +138,7 @@ typedef struct iwffff_env {
138#define IWFFFF_LAYER_EVENT_RETRIG 0x0002 /* layer event - retrigger */ 138#define IWFFFF_LAYER_EVENT_RETRIG 0x0002 /* layer event - retrigger */
139#define IWFFFF_LAYER_EVENT_LEGATO 0x0003 /* layer event - legato */ 139#define IWFFFF_LAYER_EVENT_LEGATO 0x0003 /* layer event - legato */
140 140
141typedef struct iwffff_layer { 141struct iwffff_layer {
142 unsigned char flags; 142 unsigned char flags;
143 unsigned char velocity_mode; 143 unsigned char velocity_mode;
144 unsigned char layer_event; 144 unsigned char layer_event;
@@ -147,17 +147,17 @@ typedef struct iwffff_layer {
147 unsigned char pan; /* pan offset from CC1 (0 left - 127 right) */ 147 unsigned char pan; /* pan offset from CC1 (0 left - 127 right) */
148 unsigned char pan_freq_scale; /* position based on frequency (0-127) */ 148 unsigned char pan_freq_scale; /* position based on frequency (0-127) */
149 unsigned char attenuation; /* 0-127 (no corresponding midi controller) */ 149 unsigned char attenuation; /* 0-127 (no corresponding midi controller) */
150 iwffff_lfo_t tremolo; /* tremolo effect */ 150 struct iwffff_lfo tremolo; /* tremolo effect */
151 iwffff_lfo_t vibrato; /* vibrato effect */ 151 struct iwffff_lfo vibrato; /* vibrato effect */
152 unsigned short freq_scale; /* 0-2048, 1024 is equal to semitone scaling */ 152 unsigned short freq_scale; /* 0-2048, 1024 is equal to semitone scaling */
153 unsigned char freq_center; /* center for keyboard frequency scaling */ 153 unsigned char freq_center; /* center for keyboard frequency scaling */
154 unsigned char pad; 154 unsigned char pad;
155 iwffff_env_t penv; /* pitch envelope */ 155 struct iwffff_env penv; /* pitch envelope */
156 iwffff_env_t venv; /* volume envelope */ 156 struct iwffff_env venv; /* volume envelope */
157 157
158 iwffff_wave_t *wave; 158 struct iwffff_wave *wave;
159 struct iwffff_layer *next; 159 struct iwffff_layer *next;
160} iwffff_layer_t; 160};
161 161
162/* 162/*
163 * Instrument 163 * Instrument
@@ -177,7 +177,7 @@ typedef struct iwffff_layer {
177#define IWFFFF_EFFECT_CHORUS 2 177#define IWFFFF_EFFECT_CHORUS 2
178#define IWFFFF_EFFECT_ECHO 3 178#define IWFFFF_EFFECT_ECHO 3
179 179
180typedef struct { 180struct iwffff_instrument {
181 unsigned short exclusion; 181 unsigned short exclusion;
182 unsigned short layer_type; 182 unsigned short layer_type;
183 unsigned short exclusion_group; /* 0 - none, 1-65535 */ 183 unsigned short exclusion_group; /* 0 - none, 1-65535 */
@@ -187,8 +187,8 @@ typedef struct {
187 unsigned char effect2; /* effect 2 */ 187 unsigned char effect2; /* effect 2 */
188 unsigned char effect2_depth; /* 0-127 */ 188 unsigned char effect2_depth; /* 0-127 */
189 189
190 iwffff_layer_t *layer; /* first layer */ 190 struct iwffff_layer *layer; /* first layer */
191} iwffff_instrument_t; 191};
192 192
193/* 193/*
194 * 194 *
@@ -216,7 +216,7 @@ typedef struct {
216 * Wavetable definitions 216 * Wavetable definitions
217 */ 217 */
218 218
219typedef struct iwffff_xwave { 219struct iwffff_xwave {
220 __u32 stype; /* structure type */ 220 __u32 stype; /* structure type */
221 221
222 __u32 share_id[4]; /* share id - zero = no sharing */ 222 __u32 share_id[4]; /* share id - zero = no sharing */
@@ -234,26 +234,26 @@ typedef struct iwffff_xwave {
234 __u8 low_note; /* lower frequency range for this waveform */ 234 __u8 low_note; /* lower frequency range for this waveform */
235 __u8 high_note; /* higher frequency range for this waveform */ 235 __u8 high_note; /* higher frequency range for this waveform */
236 __u8 pad; 236 __u8 pad;
237} iwffff_xwave_t; 237};
238 238
239/* 239/*
240 * Layer 240 * Layer
241 */ 241 */
242 242
243typedef struct iwffff_xlfo { 243struct iwffff_xlfo {
244 __u16 freq; /* (0-2047) 0.01Hz - 21.5Hz */ 244 __u16 freq; /* (0-2047) 0.01Hz - 21.5Hz */
245 __s16 depth; /* volume +- (0-255) 0.48675dB/step */ 245 __s16 depth; /* volume +- (0-255) 0.48675dB/step */
246 __s16 sweep; /* 0 - 950 deciseconds */ 246 __s16 sweep; /* 0 - 950 deciseconds */
247 __u8 shape; /* see to ULTRA_IW_LFO_SHAPE_XXXX */ 247 __u8 shape; /* see to ULTRA_IW_LFO_SHAPE_XXXX */
248 __u8 delay; /* 0 - 255 deciseconds */ 248 __u8 delay; /* 0 - 255 deciseconds */
249} iwffff_xlfo_t; 249};
250 250
251typedef struct iwffff_xenv_point { 251struct iwffff_xenv_point {
252 __u16 offset; 252 __u16 offset;
253 __u16 rate; 253 __u16 rate;
254} iwffff_xenv_point_t; 254};
255 255
256typedef struct iwffff_xenv_record { 256struct iwffff_xenv_record {
257 __u32 stype; 257 __u32 stype;
258 __u16 nattack; 258 __u16 nattack;
259 __u16 nrelease; 259 __u16 nrelease;
@@ -264,16 +264,16 @@ typedef struct iwffff_xenv_record {
264 __u8 pad; 264 __u8 pad;
265 /* points are stored here.. */ 265 /* points are stored here.. */
266 /* count of points = nattack + nrelease */ 266 /* count of points = nattack + nrelease */
267} iwffff_xenv_record_t; 267};
268 268
269typedef struct iwffff_xenv { 269struct iwffff_xenv {
270 __u8 flags; 270 __u8 flags;
271 __u8 mode; 271 __u8 mode;
272 __u8 index; 272 __u8 index;
273 __u8 pad; 273 __u8 pad;
274} iwffff_xenv_t; 274};
275 275
276typedef struct iwffff_xlayer { 276struct iwffff_xlayer {
277 __u32 stype; 277 __u32 stype;
278 __u8 flags; 278 __u8 flags;
279 __u8 velocity_mode; 279 __u8 velocity_mode;
@@ -283,20 +283,20 @@ typedef struct iwffff_xlayer {
283 __u8 pan; /* pan offset from CC1 (0 left - 127 right) */ 283 __u8 pan; /* pan offset from CC1 (0 left - 127 right) */
284 __u8 pan_freq_scale; /* position based on frequency (0-127) */ 284 __u8 pan_freq_scale; /* position based on frequency (0-127) */
285 __u8 attenuation; /* 0-127 (no corresponding midi controller) */ 285 __u8 attenuation; /* 0-127 (no corresponding midi controller) */
286 iwffff_xlfo_t tremolo; /* tremolo effect */ 286 struct iwffff_xlfo tremolo; /* tremolo effect */
287 iwffff_xlfo_t vibrato; /* vibrato effect */ 287 struct iwffff_xlfo vibrato; /* vibrato effect */
288 __u16 freq_scale; /* 0-2048, 1024 is equal to semitone scaling */ 288 __u16 freq_scale; /* 0-2048, 1024 is equal to semitone scaling */
289 __u8 freq_center; /* center for keyboard frequency scaling */ 289 __u8 freq_center; /* center for keyboard frequency scaling */
290 __u8 pad; 290 __u8 pad;
291 iwffff_xenv_t penv; /* pitch envelope */ 291 struct iwffff_xenv penv; /* pitch envelope */
292 iwffff_xenv_t venv; /* volume envelope */ 292 struct iwffff_xenv venv; /* volume envelope */
293} iwffff_xlayer_t; 293};
294 294
295/* 295/*
296 * Instrument 296 * Instrument
297 */ 297 */
298 298
299typedef struct iwffff_xinstrument { 299struct iwffff_xinstrument {
300 __u32 stype; 300 __u32 stype;
301 301
302 __u16 exclusion; 302 __u16 exclusion;
@@ -307,7 +307,7 @@ typedef struct iwffff_xinstrument {
307 __u8 effect1_depth; /* 0-127 */ 307 __u8 effect1_depth; /* 0-127 */
308 __u8 effect2; /* effect 2 */ 308 __u8 effect2; /* effect 2 */
309 __u8 effect2_depth; /* 0-127 */ 309 __u8 effect2_depth; /* 0-127 */
310} iwffff_xinstrument_t; 310};
311 311
312/* 312/*
313 * ROM support 313 * ROM support
@@ -316,7 +316,7 @@ typedef struct iwffff_xinstrument {
316 316
317#define IWFFFF_ROM_HDR_SIZE 512 317#define IWFFFF_ROM_HDR_SIZE 512
318 318
319typedef struct { 319struct iwffff_rom_header {
320 __u8 iwave[8]; 320 __u8 iwave[8];
321 __u8 revision; 321 __u8 revision;
322 __u8 series_number; 322 __u8 series_number;
@@ -328,7 +328,7 @@ typedef struct {
328 __u8 copyright[128]; 328 __u8 copyright[128];
329 __u8 vendor_name[64]; 329 __u8 vendor_name[64];
330 __u8 description[128]; 330 __u8 description[128];
331} iwffff_rom_header_t; 331};
332 332
333/* 333/*
334 * Instrument info 334 * Instrument info
@@ -339,35 +339,46 @@ typedef struct {
339#define IWFFFF_INFO_LFO_TREMOLO (1<<2) 339#define IWFFFF_INFO_LFO_TREMOLO (1<<2)
340#define IWFFFF_INFO_LFO_TREMOLO_SHAPE (1<<3) 340#define IWFFFF_INFO_LFO_TREMOLO_SHAPE (1<<3)
341 341
342typedef struct iwffff_info { 342struct iwffff_info {
343 unsigned int format; /* supported format bits */ 343 unsigned int format; /* supported format bits */
344 unsigned int effects; /* supported effects (1 << IWFFFF_EFFECT*) */ 344 unsigned int effects; /* supported effects (1 << IWFFFF_EFFECT*) */
345 unsigned int lfos; /* LFO effects */ 345 unsigned int lfos; /* LFO effects */
346 unsigned int max8_len; /* maximum 8-bit wave length */ 346 unsigned int max8_len; /* maximum 8-bit wave length */
347 unsigned int max16_len; /* maximum 16-bit wave length */ 347 unsigned int max16_len; /* maximum 16-bit wave length */
348} iwffff_info_t; 348};
349 349
350#ifdef __KERNEL__ 350#ifdef __KERNEL__
351 351
352#include "seq_instr.h" 352#include "seq_instr.h"
353 353
354typedef struct { 354struct snd_iwffff_ops {
355 void *private_data; 355 void *private_data;
356 int (*info)(void *private_data, iwffff_info_t *info); 356 int (*info)(void *private_data, struct iwffff_info *info);
357 int (*put_sample)(void *private_data, iwffff_wave_t *wave, 357 int (*put_sample)(void *private_data, struct iwffff_wave *wave,
358 char __user *data, long len, int atomic); 358 char __user *data, long len, int atomic);
359 int (*get_sample)(void *private_data, iwffff_wave_t *wave, 359 int (*get_sample)(void *private_data, struct iwffff_wave *wave,
360 char __user *data, long len, int atomic); 360 char __user *data, long len, int atomic);
361 int (*remove_sample)(void *private_data, iwffff_wave_t *wave, 361 int (*remove_sample)(void *private_data, struct iwffff_wave *wave,
362 int atomic); 362 int atomic);
363 void (*notify)(void *private_data, snd_seq_kinstr_t *instr, int what); 363 void (*notify)(void *private_data, struct snd_seq_kinstr *instr, int what);
364 snd_seq_kinstr_ops_t kops; 364 struct snd_seq_kinstr_ops kops;
365} snd_iwffff_ops_t; 365};
366 366
367int snd_seq_iwffff_init(snd_iwffff_ops_t *ops, 367int snd_seq_iwffff_init(struct snd_iwffff_ops *ops,
368 void *private_data, 368 void *private_data,
369 snd_seq_kinstr_ops_t *next); 369 struct snd_seq_kinstr_ops *next);
370 370
371#endif 371#endif
372 372
373/* typedefs for compatibility to user-space */
374typedef struct iwffff_xwave iwffff_xwave_t;
375typedef struct iwffff_xlfo iwffff_xlfo_t;
376typedef struct iwffff_xenv_point iwffff_xenv_point_t;
377typedef struct iwffff_xenv_record iwffff_xenv_record_t;
378typedef struct iwffff_xenv iwffff_xenv_t;
379typedef struct iwffff_xlayer iwffff_xlayer_t;
380typedef struct iwffff_xinstrument iwffff_xinstrument_t;
381typedef struct iwffff_rom_header iwffff_rom_header_t;
382typedef struct iwffff_info iwffff_info_t;
383
373#endif /* __SOUND_AINSTR_IW_H */ 384#endif /* __SOUND_AINSTR_IW_H */