From 41762892e03695bbc0fa0cc556cf4cb83ec3768f Mon Sep 17 00:00:00 2001 From: dhewg Date: Sat, 26 Mar 2011 10:32:07 +0100 Subject: ANDROID: Fix MIDI packet size Instruments are now not reset to the grand piano due to trailing zeroes. Thanks to waltervn for noticing this. --- audio/softsynth/eas.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'audio/softsynth/eas.cpp') diff --git a/audio/softsynth/eas.cpp b/audio/softsynth/eas.cpp index c5c60b253d..9d6cf97297 100644 --- a/audio/softsynth/eas.cpp +++ b/audio/softsynth/eas.cpp @@ -304,9 +304,13 @@ void MidiDriver_EAS::close() { void MidiDriver_EAS::send(uint32 b) { byte buf[4]; - WRITE_UINT32(buf, b); + WRITE_LE_UINT32(buf, b); - int32 res = _writeStreamFunc(_EASHandle, _midiStream, buf, 4); + int32 len = 3; + if ((buf[0] >> 4) == 0xC || (buf[0] >> 4) == 0xD) + len = 2; + + int32 res = _writeStreamFunc(_EASHandle, _midiStream, buf, len); if (res) warning("error writing to EAS MIDI stream: %d", res); } -- cgit v1.2.3