diff options
author | Len Brown <len.brown@intel.com> | 2006-01-07 03:50:18 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-01-07 03:50:18 -0500 |
commit | ed03f430cdc8c802652467e9097606fedc2c7abc (patch) | |
tree | 30941ec1e6f93e99358fefe18175e5dd800a4379 /sound/core/seq/seq_midi_emul.c | |
parent | ed349a8a0a780ed27e2a765f16cee54d9b63bfee (diff) | |
parent | 6f957eaf79356a32e838f5f262ee9a60544b1d5b (diff) | |
download | op-kernel-dev-ed03f430cdc8c802652467e9097606fedc2c7abc.zip op-kernel-dev-ed03f430cdc8c802652467e9097606fedc2c7abc.tar.gz |
Pull pnpacpi into acpica branch
Diffstat (limited to 'sound/core/seq/seq_midi_emul.c')
-rw-r--r-- | sound/core/seq/seq_midi_emul.c | 86 |
1 files changed, 49 insertions, 37 deletions
diff --git a/sound/core/seq/seq_midi_emul.c b/sound/core/seq/seq_midi_emul.c index 35fe8a7..d7c4fb8 100644 --- a/sound/core/seq/seq_midi_emul.c +++ b/sound/core/seq/seq_midi_emul.c @@ -44,17 +44,25 @@ MODULE_DESCRIPTION("Advanced Linux Sound Architecture sequencer MIDI emulation." MODULE_LICENSE("GPL"); /* Prototypes for static functions */ -static void note_off(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan, int note, int vel); -static void do_control(snd_midi_op_t *ops, void *private, - snd_midi_channel_set_t *chset, snd_midi_channel_t *chan, +static void note_off(struct snd_midi_op *ops, void *drv, + struct snd_midi_channel *chan, + int note, int vel); +static void do_control(struct snd_midi_op *ops, void *private, + struct snd_midi_channel_set *chset, + struct snd_midi_channel *chan, int control, int value); -static void rpn(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan, snd_midi_channel_set_t *chset); -static void nrpn(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan, snd_midi_channel_set_t *chset); -static void sysex(snd_midi_op_t *ops, void *private, unsigned char *sysex, int len, snd_midi_channel_set_t *chset); -static void all_sounds_off(snd_midi_op_t *ops, void *private, snd_midi_channel_t *chan); -static void all_notes_off(snd_midi_op_t *ops, void *private, snd_midi_channel_t *chan); -static void snd_midi_reset_controllers(snd_midi_channel_t *chan); -static void reset_all_channels(snd_midi_channel_set_t *chset); +static void rpn(struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan, + struct snd_midi_channel_set *chset); +static void nrpn(struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan, + struct snd_midi_channel_set *chset); +static void sysex(struct snd_midi_op *ops, void *private, unsigned char *sysex, + int len, struct snd_midi_channel_set *chset); +static void all_sounds_off(struct snd_midi_op *ops, void *private, + struct snd_midi_channel *chan); +static void all_notes_off(struct snd_midi_op *ops, void *private, + struct snd_midi_channel *chan); +static void snd_midi_reset_controllers(struct snd_midi_channel *chan); +static void reset_all_channels(struct snd_midi_channel_set *chset); /* @@ -72,10 +80,11 @@ static void reset_all_channels(snd_midi_channel_set_t *chset); * be interpreted. */ void -snd_midi_process_event(snd_midi_op_t *ops, - snd_seq_event_t *ev, snd_midi_channel_set_t *chanset) +snd_midi_process_event(struct snd_midi_op *ops, + struct snd_seq_event *ev, + struct snd_midi_channel_set *chanset) { - snd_midi_channel_t *chan; + struct snd_midi_channel *chan; void *drv; int dest_channel = 0; @@ -89,7 +98,8 @@ snd_midi_process_event(snd_midi_op_t *ops, if (snd_seq_ev_is_channel_type(ev)) { dest_channel = ev->data.note.channel; if (dest_channel >= chanset->max_channels) { - snd_printd("dest channel is %d, max is %d\n", dest_channel, chanset->max_channels); + snd_printd("dest channel is %d, max is %d\n", + dest_channel, chanset->max_channels); return; } } @@ -239,7 +249,8 @@ snd_midi_process_event(snd_midi_op_t *ops, * release note */ static void -note_off(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan, int note, int vel) +note_off(struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan, + int note, int vel) { if (chan->gm_hold) { /* Hold this note until pedal is turned off */ @@ -260,8 +271,8 @@ note_off(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan, int note, int * events that need to take place immediately to the driver. */ static void -do_control(snd_midi_op_t *ops, void *drv, snd_midi_channel_set_t *chset, - snd_midi_channel_t *chan, int control, int value) +do_control(struct snd_midi_op *ops, void *drv, struct snd_midi_channel_set *chset, + struct snd_midi_channel *chan, int control, int value) { int i; @@ -376,7 +387,7 @@ do_control(snd_midi_op_t *ops, void *drv, snd_midi_channel_set_t *chset, * initialize the MIDI status */ void -snd_midi_channel_set_clear(snd_midi_channel_set_t *chset) +snd_midi_channel_set_clear(struct snd_midi_channel_set *chset) { int i; @@ -384,7 +395,7 @@ snd_midi_channel_set_clear(snd_midi_channel_set_t *chset) chset->gs_master_volume = 127; for (i = 0; i < chset->max_channels; i++) { - snd_midi_channel_t *chan = chset->channels + i; + struct snd_midi_channel *chan = chset->channels + i; memset(chan->note, 0, sizeof(chan->note)); chan->midi_aftertouch = 0; @@ -407,8 +418,8 @@ snd_midi_channel_set_clear(snd_midi_channel_set_t *chset) * Process a rpn message. */ static void -rpn(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan, - snd_midi_channel_set_t *chset) +rpn(struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan, + struct snd_midi_channel_set *chset) { int type; int val; @@ -447,8 +458,8 @@ rpn(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan, * Process an nrpn message. */ static void -nrpn(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan, - snd_midi_channel_set_t *chset) +nrpn(struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan, + struct snd_midi_channel_set *chset) { /* parse XG NRPNs here if possible */ if (ops->nrpn) @@ -475,7 +486,8 @@ get_channel(unsigned char cmd) * Process a sysex message. */ static void -sysex(snd_midi_op_t *ops, void *private, unsigned char *buf, int len, snd_midi_channel_set_t *chset) +sysex(struct snd_midi_op *ops, void *private, unsigned char *buf, int len, + struct snd_midi_channel_set *chset) { /* GM on */ static unsigned char gm_on_macro[] = { @@ -588,7 +600,7 @@ sysex(snd_midi_op_t *ops, void *private, unsigned char *buf, int len, snd_midi_c * all sound off */ static void -all_sounds_off(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan) +all_sounds_off(struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan) { int n; @@ -606,7 +618,7 @@ all_sounds_off(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan) * all notes off */ static void -all_notes_off(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan) +all_notes_off(struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan) { int n; @@ -621,12 +633,12 @@ all_notes_off(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan) /* * Initialise a single midi channel control block. */ -static void snd_midi_channel_init(snd_midi_channel_t *p, int n) +static void snd_midi_channel_init(struct snd_midi_channel *p, int n) { if (p == NULL) return; - memset(p, 0, sizeof(snd_midi_channel_t)); + memset(p, 0, sizeof(struct snd_midi_channel)); p->private = NULL; p->number = n; @@ -642,12 +654,12 @@ static void snd_midi_channel_init(snd_midi_channel_t *p, int n) /* * Allocate and initialise a set of midi channel control blocks. */ -static snd_midi_channel_t *snd_midi_channel_init_set(int n) +static struct snd_midi_channel *snd_midi_channel_init_set(int n) { - snd_midi_channel_t *chan; + struct snd_midi_channel *chan; int i; - chan = kmalloc(n * sizeof(snd_midi_channel_t), GFP_KERNEL); + chan = kmalloc(n * sizeof(struct snd_midi_channel), GFP_KERNEL); if (chan) { for (i = 0; i < n; i++) snd_midi_channel_init(chan+i, i); @@ -660,11 +672,11 @@ static snd_midi_channel_t *snd_midi_channel_init_set(int n) * reset all midi channels */ static void -reset_all_channels(snd_midi_channel_set_t *chset) +reset_all_channels(struct snd_midi_channel_set *chset) { int ch; for (ch = 0; ch < chset->max_channels; ch++) { - snd_midi_channel_t *chan = chset->channels + ch; + struct snd_midi_channel *chan = chset->channels + ch; snd_midi_reset_controllers(chan); chan->gm_rpn_pitch_bend_range = 256; /* 2 semitones */ chan->gm_rpn_fine_tuning = 0; @@ -681,9 +693,9 @@ reset_all_channels(snd_midi_channel_set_t *chset) /* * Allocate and initialise a midi channel set. */ -snd_midi_channel_set_t *snd_midi_channel_alloc_set(int n) +struct snd_midi_channel_set *snd_midi_channel_alloc_set(int n) { - snd_midi_channel_set_t *chset; + struct snd_midi_channel_set *chset; chset = kmalloc(sizeof(*chset), GFP_KERNEL); if (chset) { @@ -697,7 +709,7 @@ snd_midi_channel_set_t *snd_midi_channel_alloc_set(int n) /* * Reset the midi controllers on a particular channel to default values. */ -static void snd_midi_reset_controllers(snd_midi_channel_t *chan) +static void snd_midi_reset_controllers(struct snd_midi_channel *chan) { memset(chan->control, 0, sizeof(chan->control)); chan->gm_volume = 127; @@ -709,7 +721,7 @@ static void snd_midi_reset_controllers(snd_midi_channel_t *chan) /* * Free a midi channel set. */ -void snd_midi_channel_free_set(snd_midi_channel_set_t *chset) +void snd_midi_channel_free_set(struct snd_midi_channel_set *chset) { if (chset == NULL) return; |