Codechange: Use common source for well-known SysEx messages in Windows music drivers

This commit is contained in:
Niels Martin Hansen
2019-07-04 21:14:41 +02:00
parent 9d8a83bf8d
commit 27384486e4
4 changed files with 58 additions and 12 deletions

View File

@@ -98,9 +98,11 @@ static void TransmitSysex(const byte *&msg_start, size_t &remaining)
msg_start = msg_end;
}
static void TransmitSysexConst(const byte *msg_start, size_t length)
static void TransmitStandardSysex(MidiSysexMessage msg)
{
TransmitSysex(msg_start, length);
size_t length = 0;
const byte *data = MidiGetStandardSysexMessage(msg, length);
TransmitSysex(data, length);
}
/**
@@ -370,12 +372,10 @@ const char *MusicDriver_Win32::Start(const char * const *parm)
midiOutReset(_midi.midi_out);
/* Standard "Enable General MIDI" message */
static byte gm_enable_sysex[] = { 0xF0, 0x7E, 0x00, 0x09, 0x01, 0xF7 };
TransmitSysexConst(&gm_enable_sysex[0], sizeof(gm_enable_sysex));
TransmitStandardSysex(MidiSysexMessage::ResetGM);
/* Roland-specific reverb room control, used by the original game */
static byte roland_reverb_sysex[] = { 0xF0, 0x41, 0x10, 0x42, 0x12, 0x40, 0x01, 0x30, 0x02, 0x04, 0x00, 0x40, 0x40, 0x00, 0x00, 0x09, 0xF7 };
TransmitSysexConst(&roland_reverb_sysex[0], sizeof(roland_reverb_sysex));
TransmitStandardSysex(MidiSysexMessage::RolandSetReverb);
/* prepare multimedia timer */
TIMECAPS timecaps;