Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev Make the raw midi device pass through received syste...



details:   https://anonhg.NetBSD.org/src/rev/68be7363480e
branches:  trunk
changeset: 555597:68be7363480e
user:      gson <gson%NetBSD.org@localhost>
date:      Sun Nov 23 01:25:59 2003 +0000

description:
Make the raw midi device pass through received system exclusive
messages rather than discard them.

diffstat:

 sys/dev/midi.c |  16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diffs (53 lines):

diff -r 4449599f7937 -r 68be7363480e sys/dev/midi.c
--- a/sys/dev/midi.c    Sun Nov 23 00:09:11 2003 +0000
+++ b/sys/dev/midi.c    Sun Nov 23 01:25:59 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: midi.c,v 1.35 2003/11/02 11:56:36 gson Exp $   */
+/*     $NetBSD: midi.c,v 1.36 2003/11/23 01:25:59 gson Exp $   */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: midi.c,v 1.35 2003/11/02 11:56:36 gson Exp $");
+__KERNEL_RCSID(0, "$NetBSD: midi.c,v 1.36 2003/11/23 01:25:59 gson Exp $");
 
 #include "midi.h"
 #include "sequencer.h"
@@ -293,7 +293,10 @@
                        switch(data) {
                        case 0xf0: /* Sysex */
                                sc->in_state = MIDI_IN_SYSEX;
-                               break;
+                               sc->in_msg[0] = data;
+                               sc->in_pos = 1;
+                               sc->in_left = 0;
+                               goto deliver_raw;
                        case 0xf1: /* MTC quarter frame */
                        case 0xf3: /* Song select */
                                sc->in_state = MIDI_IN_DATA;
@@ -340,9 +343,12 @@
                        break;  /* deliver data */
                return;
        case MIDI_IN_SYSEX:
+               sc->in_msg[0] = data;
+               sc->in_pos = 1;
+               sc->in_left = 0;
                if (data == MIDI_SYSEX_END)
                        sc->in_state = MIDI_IN_START;
-               return;
+               goto deliver_raw;
        }
 deliver:
        sc->in_state = MIDI_IN_START;
@@ -353,7 +359,7 @@
                return;
        }
 #endif
-
+ deliver_raw:
        if (mb->used + sc->in_pos > mb->usedhigh) {
                DPRINTF(("midi_in: buffer full, discard data=0x%02x\n", 
                         sc->in_msg[0]));



Home | Main Index | Thread Index | Old Index