From bbdff9fce525962e78e09d53b15224851d0334a5 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 8 Jun 2000 10:55:34 +0000 Subject: [PATCH] Bugfix: - dead SMP lock in es1968 (maestro2) driver. Bugfix & enhances of sequencer stuff by Scott McNab : - fix for the insrument list locking in SND_SEQ_EVENT_INSTR_BEGIN and SND_SEQ_EVENT_INSTR_END events. Note that nothing seems to really take notice of the list locking. This is more an issue when we add support for editing instruments anyway. - added new alsa-lib utility function snd_seq_ev_set_varusr() which is similar to snd_seq_ev_set_variable(), but specifies userspace extended event data. This is required in order to use the SND_SEQ_EVENT_INSTR_PUT command (took me bloody ages to work this out btw) - minor correction for gus & trident synth drivers --- include/seqmid.h | 4 +++- src/seq/seqmid.c | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/seqmid.h b/include/seqmid.h index 6caddf27..d47d3646 100644 --- a/include/seqmid.h +++ b/include/seqmid.h @@ -35,11 +35,13 @@ void snd_seq_ev_schedule_real(snd_seq_event_t *ev, int q, int relative, /* set event priority (optional) */ void snd_seq_ev_set_priority(snd_seq_event_t *ev, int high_prior); -/* set event data type - following two macros are exclusive */ +/* set event data type - following three macros are exclusive */ /* fixed size event */ void snd_seq_ev_set_fixed(snd_seq_event_t *ev); /* variable size event */ void snd_seq_ev_set_variable(snd_seq_event_t *ev, int len, void *ptr); + /* variable size event - user memory space */ +void snd_seq_ev_set_varusr(snd_seq_event_t *ev, int len, void *ptr); /* set queue control event data */ /* destination is overwritten to Timer port (0:0) */ diff --git a/src/seq/seqmid.c b/src/seq/seqmid.c index 2d0c68ac..dcef2223 100644 --- a/src/seq/seqmid.c +++ b/src/seq/seqmid.c @@ -81,6 +81,15 @@ void snd_seq_ev_set_variable(snd_seq_event_t *ev, int len, void *ptr) ev->data.ext.ptr = ptr; } +/* set varusr data */ +void snd_seq_ev_set_varusr(snd_seq_event_t *ev, int len, void *ptr) +{ + ev->flags &= ~SND_SEQ_EVENT_LENGTH_MASK; + ev->flags |= SND_SEQ_EVENT_LENGTH_VARUSR; + ev->data.ext.len = len; + ev->data.ext.ptr = ptr; +} + /* use or unuse a queue */ int snd_seq_use_queue(snd_seq_t *seq, int q, int use) -- 2.47.1