Skip to content

Commit

Permalink
[ALSA] Remove xxx_t typedefs: Emu-X synth
Browse files Browse the repository at this point in the history
Modules: Common EMU synth,SoundFont,Synth

Remove xxx_t typedefs from the Emu-X synth support.

Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai authored and Jaroslav Kysela committed Jan 3, 2006
1 parent ee42381 commit 03da312
Show file tree
Hide file tree
Showing 15 changed files with 550 additions and 495 deletions.
105 changes: 53 additions & 52 deletions include/sound/emux_synth.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,39 +36,40 @@
*/
#define SNDRV_EMUX_USE_RAW_EFFECT


/*
* typedefs
*/
typedef struct snd_emux_effect_table snd_emux_effect_table_t;
typedef struct snd_emux_port snd_emux_port_t;
typedef struct snd_emux_voice snd_emux_voice_t;
typedef struct snd_emux snd_emux_t;

struct snd_emux;
struct snd_emux_port;
struct snd_emux_voice;
struct snd_emux_effect_table;

/*
* operators
*/
typedef struct snd_emux_operators {
struct snd_emux_operators {
struct module *owner;
snd_emux_voice_t *(*get_voice)(snd_emux_t *emu, snd_emux_port_t *port);
int (*prepare)(snd_emux_voice_t *vp);
void (*trigger)(snd_emux_voice_t *vp);
void (*release)(snd_emux_voice_t *vp);
void (*update)(snd_emux_voice_t *vp, int update);
void (*terminate)(snd_emux_voice_t *vp);
void (*free_voice)(snd_emux_voice_t *vp);
void (*reset)(snd_emux_t *emu, int ch);
/* the first parameters are snd_emux_t */
int (*sample_new)(snd_emux_t *emu, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr, const void __user *data, long count);
int (*sample_free)(snd_emux_t *emu, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr);
void (*sample_reset)(snd_emux_t *emu);
int (*load_fx)(snd_emux_t *emu, int type, int arg, const void __user *data, long count);
void (*sysex)(snd_emux_t *emu, char *buf, int len, int parsed, snd_midi_channel_set_t *chset);
struct snd_emux_voice *(*get_voice)(struct snd_emux *emu,
struct snd_emux_port *port);
int (*prepare)(struct snd_emux_voice *vp);
void (*trigger)(struct snd_emux_voice *vp);
void (*release)(struct snd_emux_voice *vp);
void (*update)(struct snd_emux_voice *vp, int update);
void (*terminate)(struct snd_emux_voice *vp);
void (*free_voice)(struct snd_emux_voice *vp);
void (*reset)(struct snd_emux *emu, int ch);
/* the first parameters are struct snd_emux */
int (*sample_new)(struct snd_emux *emu, struct snd_sf_sample *sp,
struct snd_util_memhdr *hdr,
const void __user *data, long count);
int (*sample_free)(struct snd_emux *emu, struct snd_sf_sample *sp,
struct snd_util_memhdr *hdr);
void (*sample_reset)(struct snd_emux *emu);
int (*load_fx)(struct snd_emux *emu, int type, int arg,
const void __user *data, long count);
void (*sysex)(struct snd_emux *emu, char *buf, int len, int parsed,
struct snd_midi_channel_set *chset);
#ifdef CONFIG_SND_SEQUENCER_OSS
int (*oss_ioctl)(snd_emux_t *emu, int cmd, int p1, int p2);
int (*oss_ioctl)(struct snd_emux *emu, int cmd, int p1, int p2);
#endif
} snd_emux_operators_t;
};


/*
Expand All @@ -90,46 +91,46 @@ typedef struct snd_emux_operators {
*/
struct snd_emux {

snd_card_t *card; /* assigned card */
struct snd_card *card; /* assigned card */

/* following should be initialized before registration */
int max_voices; /* Number of voices */
int mem_size; /* memory size (in byte) */
int num_ports; /* number of ports to be created */
int pitch_shift; /* pitch shift value (for Emu10k1) */
snd_emux_operators_t ops; /* operators */
struct snd_emux_operators ops; /* operators */
void *hw; /* hardware */
unsigned long flags; /* other conditions */
int midi_ports; /* number of virtual midi devices */
int midi_devidx; /* device offset of virtual midi */
unsigned int linear_panning: 1; /* panning is linear (sbawe = 1, emu10k1 = 0) */
int hwdep_idx; /* hwdep device index */
snd_hwdep_t *hwdep; /* hwdep device */
struct snd_hwdep *hwdep; /* hwdep device */

/* private */
int num_voices; /* current number of voices */
snd_sf_list_t *sflist; /* root of SoundFont list */
snd_emux_voice_t *voices; /* Voices (EMU 'channel') */
struct snd_sf_list *sflist; /* root of SoundFont list */
struct snd_emux_voice *voices; /* Voices (EMU 'channel') */
int use_time; /* allocation counter */
spinlock_t voice_lock; /* Lock for voice access */
struct semaphore register_mutex;
int client; /* For the sequencer client */
int ports[SNDRV_EMUX_MAX_PORTS]; /* The ports for this device */
snd_emux_port_t *portptrs[SNDRV_EMUX_MAX_PORTS];
struct snd_emux_port *portptrs[SNDRV_EMUX_MAX_PORTS];
int used; /* use counter */
char *name; /* name of the device (internal) */
snd_rawmidi_t **vmidi;
struct snd_rawmidi **vmidi;
struct timer_list tlist; /* for pending note-offs */
int timer_active;

snd_util_memhdr_t *memhdr; /* memory chunk information */
struct snd_util_memhdr *memhdr; /* memory chunk information */

#ifdef CONFIG_PROC_FS
snd_info_entry_t *proc;
struct snd_info_entry *proc;
#endif

#ifdef CONFIG_SND_SEQUENCER_OSS
snd_seq_device_t *oss_synth;
struct snd_seq_device *oss_synth;
#endif
};

Expand All @@ -139,18 +140,18 @@ struct snd_emux {
*/
struct snd_emux_port {

snd_midi_channel_set_t chset;
snd_emux_t *emu;
struct snd_midi_channel_set chset;
struct snd_emux *emu;

char port_mode; /* operation mode */
int volume_atten; /* emuX raw attenuation */
unsigned long drum_flags; /* drum bitmaps */
int ctrls[EMUX_MD_END]; /* control parameters */
#ifdef SNDRV_EMUX_USE_RAW_EFFECT
snd_emux_effect_table_t *effect;
struct snd_emux_effect_table *effect;
#endif
#ifdef CONFIG_SND_SEQUENCER_OSS
snd_seq_oss_arg_t *oss_arg;
struct snd_seq_oss_arg *oss_arg;
#endif
};

Expand Down Expand Up @@ -179,16 +180,16 @@ struct snd_emux_voice {
unsigned char key;
unsigned char velocity; /* Velocity of current note */

snd_sf_zone_t *zone; /* Zone assigned to this note */
struct snd_sf_zone *zone; /* Zone assigned to this note */
void *block; /* sample block pointer (optional) */
snd_midi_channel_t *chan; /* Midi channel for this note */
snd_emux_port_t *port; /* associated port */
snd_emux_t *emu; /* assigned root info */
void *hw; /* hardware pointer (emu8000_t or emu10k1_t) */
struct snd_midi_channel *chan; /* Midi channel for this note */
struct snd_emux_port *port; /* associated port */
struct snd_emux *emu; /* assigned root info */
void *hw; /* hardware pointer (emu8000 or emu10k1) */
unsigned long ontime; /* jiffies at note triggered */

/* Emu8k/Emu10k1 registers */
soundfont_voice_info_t reg;
struct soundfont_voice_info reg;

/* additional registers */
int avol; /* volume attenuation */
Expand Down Expand Up @@ -229,15 +230,15 @@ struct snd_emux_effect_table {
/*
* prototypes - interface to Emu10k1 and Emu8k routines
*/
int snd_emux_new(snd_emux_t **remu);
int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name);
int snd_emux_free(snd_emux_t *emu);
int snd_emux_new(struct snd_emux **remu);
int snd_emux_register(struct snd_emux *emu, struct snd_card *card, int index, char *name);
int snd_emux_free(struct snd_emux *emu);

/*
* exported functions
*/
void snd_emux_terminate_all(snd_emux_t *emu);
void snd_emux_lock_voice(snd_emux_t *emu, int voice);
void snd_emux_unlock_voice(snd_emux_t *emu, int voice);
void snd_emux_terminate_all(struct snd_emux *emu);
void snd_emux_lock_voice(struct snd_emux *emu, int voice);
void snd_emux_unlock_voice(struct snd_emux *emu, int voice);

#endif /* __SOUND_EMUX_SYNTH_H */
36 changes: 18 additions & 18 deletions include/sound/sfnt_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#endif

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

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

/* the actual patch data begins after this */
} soundfont_patch_info_t;
};


/*
Expand All @@ -68,7 +68,7 @@ typedef struct soundfont_patch_info_t {

#define SNDRV_SFNT_PATCH_NAME_LEN 32

typedef struct soundfont_open_parm_t {
struct soundfont_open_parm {
unsigned short type; /* sample type */
#define SNDRV_SFNT_PAT_TYPE_MISC 0
#define SNDRV_SFNT_PAT_TYPE_GUS 6
Expand All @@ -78,15 +78,15 @@ typedef struct soundfont_open_parm_t {

short reserved;
char name[SNDRV_SFNT_PATCH_NAME_LEN];
} soundfont_open_parm_t;
};


/*
* raw voice information record
*/

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


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


/* instrument info header: 4 bytes */
typedef struct soundfont_voice_rec_hdr_t {
struct soundfont_voice_rec_hdr {
unsigned char bank; /* midi bank number */
unsigned char instr; /* midi preset number */
char nvoices; /* number of voices */
char write_mode; /* write mode; normally 0 */
#define SNDRV_SFNT_WR_APPEND 0 /* append anyway */
#define SNDRV_SFNT_WR_EXCLUSIVE 1 /* skip if already exists */
#define SNDRV_SFNT_WR_REPLACE 2 /* replace if already exists */
} soundfont_voice_rec_hdr_t;
};


/*
* sample wave information
*/

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


/*
* voice preset mapping (aliasing)
*/

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


/*
Expand All @@ -195,7 +195,7 @@ typedef struct soundfont_voice_map_t {

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

struct sndrv_emux_misc_mode {
struct snd_emux_misc_mode {
int port; /* -1 = all */
int mode;
int value;
Expand All @@ -204,11 +204,11 @@ struct sndrv_emux_misc_mode {

enum {
SNDRV_EMUX_IOCTL_VERSION = _IOR('H', 0x80, unsigned int),
SNDRV_EMUX_IOCTL_LOAD_PATCH = _IOWR('H', 0x81, soundfont_patch_info_t),
SNDRV_EMUX_IOCTL_LOAD_PATCH = _IOWR('H', 0x81, struct soundfont_patch_info),
SNDRV_EMUX_IOCTL_RESET_SAMPLES = _IO('H', 0x82),
SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES = _IO('H', 0x83),
SNDRV_EMUX_IOCTL_MEM_AVAIL = _IOW('H', 0x84, int),
SNDRV_EMUX_IOCTL_MISC_MODE = _IOWR('H', 0x84, struct sndrv_emux_misc_mode),
SNDRV_EMUX_IOCTL_MISC_MODE = _IOWR('H', 0x84, struct snd_emux_misc_mode),
};

#endif /* __SOUND_SFNT_INFO_H */
Loading

0 comments on commit 03da312

Please sign in to comment.