Skip to content

Commit 03da312

Browse files
tiwaiJaroslav Kysela
authored andcommitted
[ALSA] Remove xxx_t typedefs: Emu-X synth
Modules: Common EMU synth,SoundFont,Synth Remove xxx_t typedefs from the Emu-X synth support. Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent ee42381 commit 03da312

15 files changed

Lines changed: 550 additions & 495 deletions

File tree

‎include/sound/emux_synth.h‎

Lines changed: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -36,39 +36,40 @@
3636
*/
3737
#define SNDRV_EMUX_USE_RAW_EFFECT
3838

39-
40-
/*
41-
* typedefs
42-
*/
43-
typedef struct snd_emux_effect_table snd_emux_effect_table_t;
44-
typedef struct snd_emux_port snd_emux_port_t;
45-
typedef struct snd_emux_voice snd_emux_voice_t;
46-
typedef struct snd_emux snd_emux_t;
47-
39+
struct snd_emux;
40+
struct snd_emux_port;
41+
struct snd_emux_voice;
42+
struct snd_emux_effect_table;
4843

4944
/*
5045
* operators
5146
*/
52-
typedef struct snd_emux_operators {
47+
struct snd_emux_operators {
5348
struct module *owner;
54-
snd_emux_voice_t *(*get_voice)(snd_emux_t *emu, snd_emux_port_t *port);
55-
int (*prepare)(snd_emux_voice_t *vp);
56-
void (*trigger)(snd_emux_voice_t *vp);
57-
void (*release)(snd_emux_voice_t *vp);
58-
void (*update)(snd_emux_voice_t *vp, int update);
59-
void (*terminate)(snd_emux_voice_t *vp);
60-
void (*free_voice)(snd_emux_voice_t *vp);
61-
void (*reset)(snd_emux_t *emu, int ch);
62-
/* the first parameters are snd_emux_t */
63-
int (*sample_new)(snd_emux_t *emu, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr, const void __user *data, long count);
64-
int (*sample_free)(snd_emux_t *emu, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr);
65-
void (*sample_reset)(snd_emux_t *emu);
66-
int (*load_fx)(snd_emux_t *emu, int type, int arg, const void __user *data, long count);
67-
void (*sysex)(snd_emux_t *emu, char *buf, int len, int parsed, snd_midi_channel_set_t *chset);
49+
struct snd_emux_voice *(*get_voice)(struct snd_emux *emu,
50+
struct snd_emux_port *port);
51+
int (*prepare)(struct snd_emux_voice *vp);
52+
void (*trigger)(struct snd_emux_voice *vp);
53+
void (*release)(struct snd_emux_voice *vp);
54+
void (*update)(struct snd_emux_voice *vp, int update);
55+
void (*terminate)(struct snd_emux_voice *vp);
56+
void (*free_voice)(struct snd_emux_voice *vp);
57+
void (*reset)(struct snd_emux *emu, int ch);
58+
/* the first parameters are struct snd_emux */
59+
int (*sample_new)(struct snd_emux *emu, struct snd_sf_sample *sp,
60+
struct snd_util_memhdr *hdr,
61+
const void __user *data, long count);
62+
int (*sample_free)(struct snd_emux *emu, struct snd_sf_sample *sp,
63+
struct snd_util_memhdr *hdr);
64+
void (*sample_reset)(struct snd_emux *emu);
65+
int (*load_fx)(struct snd_emux *emu, int type, int arg,
66+
const void __user *data, long count);
67+
void (*sysex)(struct snd_emux *emu, char *buf, int len, int parsed,
68+
struct snd_midi_channel_set *chset);
6869
#ifdef CONFIG_SND_SEQUENCER_OSS
69-
int (*oss_ioctl)(snd_emux_t *emu, int cmd, int p1, int p2);
70+
int (*oss_ioctl)(struct snd_emux *emu, int cmd, int p1, int p2);
7071
#endif
71-
} snd_emux_operators_t;
72+
};
7273

7374

7475
/*
@@ -90,46 +91,46 @@ typedef struct snd_emux_operators {
9091
*/
9192
struct snd_emux {
9293

93-
snd_card_t *card; /* assigned card */
94+
struct snd_card *card; /* assigned card */
9495

9596
/* following should be initialized before registration */
9697
int max_voices; /* Number of voices */
9798
int mem_size; /* memory size (in byte) */
9899
int num_ports; /* number of ports to be created */
99100
int pitch_shift; /* pitch shift value (for Emu10k1) */
100-
snd_emux_operators_t ops; /* operators */
101+
struct snd_emux_operators ops; /* operators */
101102
void *hw; /* hardware */
102103
unsigned long flags; /* other conditions */
103104
int midi_ports; /* number of virtual midi devices */
104105
int midi_devidx; /* device offset of virtual midi */
105106
unsigned int linear_panning: 1; /* panning is linear (sbawe = 1, emu10k1 = 0) */
106107
int hwdep_idx; /* hwdep device index */
107-
snd_hwdep_t *hwdep; /* hwdep device */
108+
struct snd_hwdep *hwdep; /* hwdep device */
108109

109110
/* private */
110111
int num_voices; /* current number of voices */
111-
snd_sf_list_t *sflist; /* root of SoundFont list */
112-
snd_emux_voice_t *voices; /* Voices (EMU 'channel') */
112+
struct snd_sf_list *sflist; /* root of SoundFont list */
113+
struct snd_emux_voice *voices; /* Voices (EMU 'channel') */
113114
int use_time; /* allocation counter */
114115
spinlock_t voice_lock; /* Lock for voice access */
115116
struct semaphore register_mutex;
116117
int client; /* For the sequencer client */
117118
int ports[SNDRV_EMUX_MAX_PORTS]; /* The ports for this device */
118-
snd_emux_port_t *portptrs[SNDRV_EMUX_MAX_PORTS];
119+
struct snd_emux_port *portptrs[SNDRV_EMUX_MAX_PORTS];
119120
int used; /* use counter */
120121
char *name; /* name of the device (internal) */
121-
snd_rawmidi_t **vmidi;
122+
struct snd_rawmidi **vmidi;
122123
struct timer_list tlist; /* for pending note-offs */
123124
int timer_active;
124125

125-
snd_util_memhdr_t *memhdr; /* memory chunk information */
126+
struct snd_util_memhdr *memhdr; /* memory chunk information */
126127

127128
#ifdef CONFIG_PROC_FS
128-
snd_info_entry_t *proc;
129+
struct snd_info_entry *proc;
129130
#endif
130131

131132
#ifdef CONFIG_SND_SEQUENCER_OSS
132-
snd_seq_device_t *oss_synth;
133+
struct snd_seq_device *oss_synth;
133134
#endif
134135
};
135136

@@ -139,18 +140,18 @@ struct snd_emux {
139140
*/
140141
struct snd_emux_port {
141142

142-
snd_midi_channel_set_t chset;
143-
snd_emux_t *emu;
143+
struct snd_midi_channel_set chset;
144+
struct snd_emux *emu;
144145

145146
char port_mode; /* operation mode */
146147
int volume_atten; /* emuX raw attenuation */
147148
unsigned long drum_flags; /* drum bitmaps */
148149
int ctrls[EMUX_MD_END]; /* control parameters */
149150
#ifdef SNDRV_EMUX_USE_RAW_EFFECT
150-
snd_emux_effect_table_t *effect;
151+
struct snd_emux_effect_table *effect;
151152
#endif
152153
#ifdef CONFIG_SND_SEQUENCER_OSS
153-
snd_seq_oss_arg_t *oss_arg;
154+
struct snd_seq_oss_arg *oss_arg;
154155
#endif
155156
};
156157

@@ -179,16 +180,16 @@ struct snd_emux_voice {
179180
unsigned char key;
180181
unsigned char velocity; /* Velocity of current note */
181182

182-
snd_sf_zone_t *zone; /* Zone assigned to this note */
183+
struct snd_sf_zone *zone; /* Zone assigned to this note */
183184
void *block; /* sample block pointer (optional) */
184-
snd_midi_channel_t *chan; /* Midi channel for this note */
185-
snd_emux_port_t *port; /* associated port */
186-
snd_emux_t *emu; /* assigned root info */
187-
void *hw; /* hardware pointer (emu8000_t or emu10k1_t) */
185+
struct snd_midi_channel *chan; /* Midi channel for this note */
186+
struct snd_emux_port *port; /* associated port */
187+
struct snd_emux *emu; /* assigned root info */
188+
void *hw; /* hardware pointer (emu8000 or emu10k1) */
188189
unsigned long ontime; /* jiffies at note triggered */
189190

190191
/* Emu8k/Emu10k1 registers */
191-
soundfont_voice_info_t reg;
192+
struct soundfont_voice_info reg;
192193

193194
/* additional registers */
194195
int avol; /* volume attenuation */
@@ -229,15 +230,15 @@ struct snd_emux_effect_table {
229230
/*
230231
* prototypes - interface to Emu10k1 and Emu8k routines
231232
*/
232-
int snd_emux_new(snd_emux_t **remu);
233-
int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name);
234-
int snd_emux_free(snd_emux_t *emu);
233+
int snd_emux_new(struct snd_emux **remu);
234+
int snd_emux_register(struct snd_emux *emu, struct snd_card *card, int index, char *name);
235+
int snd_emux_free(struct snd_emux *emu);
235236

236237
/*
237238
* exported functions
238239
*/
239-
void snd_emux_terminate_all(snd_emux_t *emu);
240-
void snd_emux_lock_voice(snd_emux_t *emu, int voice);
241-
void snd_emux_unlock_voice(snd_emux_t *emu, int voice);
240+
void snd_emux_terminate_all(struct snd_emux *emu);
241+
void snd_emux_lock_voice(struct snd_emux *emu, int voice);
242+
void snd_emux_unlock_voice(struct snd_emux *emu, int voice);
242243

243244
#endif /* __SOUND_EMUX_SYNTH_H */

‎include/sound/sfnt_info.h‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#endif
3636

3737
/* patch interface header: 16 bytes */
38-
typedef struct soundfont_patch_info_t {
38+
struct soundfont_patch_info {
3939
unsigned short key; /* use the key below */
4040
#define SNDRV_OSS_SOUNDFONT_PATCH SNDRV_OSS_PATCHKEY(0x07)
4141

@@ -59,7 +59,7 @@ typedef struct soundfont_patch_info_t {
5959
short reserved; /* word alignment data */
6060

6161
/* the actual patch data begins after this */
62-
} soundfont_patch_info_t;
62+
};
6363

6464

6565
/*
@@ -68,7 +68,7 @@ typedef struct soundfont_patch_info_t {
6868

6969
#define SNDRV_SFNT_PATCH_NAME_LEN 32
7070

71-
typedef struct soundfont_open_parm_t {
71+
struct soundfont_open_parm {
7272
unsigned short type; /* sample type */
7373
#define SNDRV_SFNT_PAT_TYPE_MISC 0
7474
#define SNDRV_SFNT_PAT_TYPE_GUS 6
@@ -78,15 +78,15 @@ typedef struct soundfont_open_parm_t {
7878

7979
short reserved;
8080
char name[SNDRV_SFNT_PATCH_NAME_LEN];
81-
} soundfont_open_parm_t;
81+
};
8282

8383

8484
/*
8585
* raw voice information record
8686
*/
8787

8888
/* wave table envelope & effect parameters to control EMU8000 */
89-
typedef struct soundfont_voice_parm_t {
89+
struct soundfont_voice_parm {
9090
unsigned short moddelay; /* modulation delay (0x8000) */
9191
unsigned short modatkhld; /* modulation attack & hold time (0x7f7f) */
9292
unsigned short moddcysus; /* modulation decay & sustain (0x7f7f) */
@@ -108,11 +108,11 @@ typedef struct soundfont_voice_parm_t {
108108
unsigned char chorus; /* chorus send (0x00) */
109109
unsigned char reverb; /* reverb send (0x00) */
110110
unsigned short reserved[4]; /* not used */
111-
} soundfont_voice_parm_t;
111+
};
112112

113113

114114
/* wave table parameters: 92 bytes */
115-
typedef struct soundfont_voice_info_t {
115+
struct soundfont_voice_info {
116116
unsigned short sf_id; /* file id (should be zero) */
117117
unsigned short sample; /* sample id */
118118
int start, end; /* sample offset correction */
@@ -135,29 +135,29 @@ typedef struct soundfont_voice_info_t {
135135
unsigned char amplitude; /* sample volume (127 max) */
136136
unsigned char attenuation; /* attenuation (0.375dB) */
137137
short scaleTuning; /* pitch scale tuning(%), normally 100 */
138-
soundfont_voice_parm_t parm; /* voice envelope parameters */
138+
struct soundfont_voice_parm parm; /* voice envelope parameters */
139139
unsigned short sample_mode; /* sample mode_flag (set by driver) */
140-
} soundfont_voice_info_t;
140+
};
141141

142142

143143
/* instrument info header: 4 bytes */
144-
typedef struct soundfont_voice_rec_hdr_t {
144+
struct soundfont_voice_rec_hdr {
145145
unsigned char bank; /* midi bank number */
146146
unsigned char instr; /* midi preset number */
147147
char nvoices; /* number of voices */
148148
char write_mode; /* write mode; normally 0 */
149149
#define SNDRV_SFNT_WR_APPEND 0 /* append anyway */
150150
#define SNDRV_SFNT_WR_EXCLUSIVE 1 /* skip if already exists */
151151
#define SNDRV_SFNT_WR_REPLACE 2 /* replace if already exists */
152-
} soundfont_voice_rec_hdr_t;
152+
};
153153

154154

155155
/*
156156
* sample wave information
157157
*/
158158

159159
/* wave table sample header: 32 bytes */
160-
typedef struct soundfont_sample_info_t {
160+
struct soundfont_sample_info {
161161
unsigned short sf_id; /* file id (should be zero) */
162162
unsigned short sample; /* sample id */
163163
int start, end; /* start & end offset */
@@ -174,17 +174,17 @@ typedef struct soundfont_sample_info_t {
174174
#define SNDRV_SFNT_SAMPLE_STEREO_RIGHT 64 /* stereo right sound */
175175
#define SNDRV_SFNT_SAMPLE_REVERSE_LOOP 128 /* reverse looping */
176176
unsigned int truesize; /* used memory size (set by driver) */
177-
} soundfont_sample_info_t;
177+
};
178178

179179

180180
/*
181181
* voice preset mapping (aliasing)
182182
*/
183183

184-
typedef struct soundfont_voice_map_t {
184+
struct soundfont_voice_map {
185185
int map_bank, map_instr, map_key; /* key = -1 means all keys */
186186
int src_bank, src_instr, src_key;
187-
} soundfont_voice_map_t;
187+
};
188188

189189

190190
/*
@@ -195,7 +195,7 @@ typedef struct soundfont_voice_map_t {
195195

196196
#define SNDRV_EMUX_VERSION ((1 << 16) | (0 << 8) | 0) /* 1.0.0 */
197197

198-
struct sndrv_emux_misc_mode {
198+
struct snd_emux_misc_mode {
199199
int port; /* -1 = all */
200200
int mode;
201201
int value;
@@ -204,11 +204,11 @@ struct sndrv_emux_misc_mode {
204204

205205
enum {
206206
SNDRV_EMUX_IOCTL_VERSION = _IOR('H', 0x80, unsigned int),
207-
SNDRV_EMUX_IOCTL_LOAD_PATCH = _IOWR('H', 0x81, soundfont_patch_info_t),
207+
SNDRV_EMUX_IOCTL_LOAD_PATCH = _IOWR('H', 0x81, struct soundfont_patch_info),
208208
SNDRV_EMUX_IOCTL_RESET_SAMPLES = _IO('H', 0x82),
209209
SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES = _IO('H', 0x83),
210210
SNDRV_EMUX_IOCTL_MEM_AVAIL = _IOW('H', 0x84, int),
211-
SNDRV_EMUX_IOCTL_MISC_MODE = _IOWR('H', 0x84, struct sndrv_emux_misc_mode),
211+
SNDRV_EMUX_IOCTL_MISC_MODE = _IOWR('H', 0x84, struct snd_emux_misc_mode),
212212
};
213213

214214
#endif /* __SOUND_SFNT_INFO_H */

0 commit comments

Comments
 (0)