From 6e81216bbd18a476fdd2b7498741b8b7e0990c7c Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sat, 4 Aug 2012 02:14:32 +0000 Subject: [PATCH] - Fixed: The softsynths did not reset the tempo to its initial value when restarting a song. SVN r3804 (trunk) --- src/sound/music_midistream.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sound/music_midistream.cpp b/src/sound/music_midistream.cpp index 08edc2961..ba0077903 100644 --- a/src/sound/music_midistream.cpp +++ b/src/sound/music_midistream.cpp @@ -944,7 +944,13 @@ int MIDIStreamer::FillBuffer(int buffer_num, int max_events, DWORD max_time) if (Restarting) { Restarting = false; - events = WriteStopNotes(events); // Stop all notes in case any were left hanging. + // Reset the tempo to the inital value. + events[0] = 0; // dwDeltaTime + events[1] = 0; // dwStreamID + events[2] = (MEVT_TEMPO << 24) | InitialTempo; // dwEvent + events += 3; + // Stop all notes in case any were left hanging. + events = WriteStopNotes(events); DoRestart(); } events = MakeEvents(events, max_event_p, max_time);