[Bug 42818] MIDI Time Code Quarter Frame messages not passed to ALSA
wine-bugs at winehq.org
wine-bugs at winehq.org
Sat Jul 1 12:53:49 CDT 2017
https://bugs.winehq.org/show_bug.cgi?id=42818
--- Comment #2 from Matt Mayfield <mdmayfield at yahoo.com> ---
(In reply to Bruno Jesus from comment #1)
> Hi, thanks for the bug report. I noticed that other messages were wrong when
> I made that patch but since I had no way to test the other cases I left them
> as is.
>
> Please create a helper function and use it in the 3 cases instead of
> duplicating the code, you can them send it to Wine following the guide at
> https://wiki.winehq.org/Submitting_Patches Otherwise just tell me and I'll
> make the change.
Thanks for the comments. I tried a couple things with a helper function but did
not find a way to get it to work cleanly.
The first case 0x03, Active Sensing) uses snd_midi_event_encode_byte while the
other two use snd_midi_event_encode - but with two different buffer sizes.
Because of that it seemed like a helper function would become overly
complicated (i.e. with switch/case, and/or needing to encode a single byte as
an array of size 1, etc.).
Here is the diff as-is. Please feel free to use it, or to write a helper
function if you decide that's still necessary.
diff --git a/dlls/winealsa.drv/midi.c b/dlls/winealsa.drv/midi.c
index 6ef1976..359b7fc 100644
--- a/dlls/winealsa.drv/midi.c
+++ b/dlls/winealsa.drv/midi.c
@@ -932,7 +932,11 @@ static DWORD modData(WORD wDevID, DWORD dwParam)
BYTE buf[2];
buf[0] = evt;
buf[1] = d1;
- snd_seq_ev_set_sysex(&event, sizeof(buf), buf);
+ snd_midi_event_t *midi_event;
+ snd_midi_event_new(sizeof(buf), &midi_event);
+ snd_midi_event_init(midi_event);
+ snd_midi_event_encode(midi_event, buf, sizeof(buf), &event);
+ snd_midi_event_free(midi_event);
}
break;
case 0x02: /* Song Position Pointer. */
@@ -941,7 +945,11 @@ static DWORD modData(WORD wDevID, DWORD dwParam)
buf[0] = evt;
buf[1] = d1;
buf[2] = d2;
- snd_seq_ev_set_sysex(&event, sizeof(buf), buf);
+ snd_midi_event_t *midi_event;
+ snd_midi_event_new(sizeof(buf), &midi_event);
+ snd_midi_event_init(midi_event);
+ snd_midi_event_encode(midi_event, buf, sizeof(buf), &event);
+ snd_midi_event_free(midi_event);
}
break;
}
--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.
More information about the wine-bugs
mailing list