diff options
author | Jamieson Christian | 2002-11-10 13:44:53 +0000 |
---|---|---|
committer | Jamieson Christian | 2002-11-10 13:44:53 +0000 |
commit | a1954ac31eadfc322c225aa661daf76b67b27862 (patch) | |
tree | 1142650edb63f656ee75ee3424550a6408de7697 /scumm/imuse.cpp | |
parent | 5b7c29e4e623d46b6ddc4eb03d71483e918b3a43 (diff) | |
download | scummvm-rg350-a1954ac31eadfc322c225aa661daf76b67b27862.tar.gz scummvm-rg350-a1954ac31eadfc322c225aa661daf76b67b27862.tar.bz2 scummvm-rg350-a1954ac31eadfc322c225aa661daf76b67b27862.zip |
Fixed IMuseGM device state trackers to prevent inappropriate dropped messages.
svn-id: r5487
Diffstat (limited to 'scumm/imuse.cpp')
-rw-r--r-- | scumm/imuse.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp index a7ec6e72b8..6faa6c31d6 100644 --- a/scumm/imuse.cpp +++ b/scumm/imuse.cpp @@ -690,7 +690,7 @@ class IMuseGM : public IMuseDriver { void midiInit(); public: - IMuseGM(MidiDriver *midi) { _md = midi; } + IMuseGM(MidiDriver *midi); void uninit(); void init(IMuseInternal *eng, OSystem *os); void update_pris(); @@ -4644,6 +4644,28 @@ int IMuseAdlib::part_update_active(Part *part, uint16 *active) //** GENERAL MIDI PART OF IMUSE STARTS HERE ** //******************************************** +IMuseGM::IMuseGM (MidiDriver *midi) +{ + int i; + + // Initialize our "last" trackers with impossible + // values, so that they don't accidentally match + // any changes that are sent (which would cause + // the changes to be ignored). + for (i = 0; i < 16; ++i) { + _midi_program_last [i] = + _midi_pitchbend_factor_last [i] = + _midi_volume_last [i] = + _midi_modwheel_last [i] = + _midi_effectlevel_last [i] = + _midi_chorus_last [i] = 255; + _midi_pan_last [i] = 127; + _midi_pitchbend_last [i] = (int16) -1; + _midi_pedal_last [i] = false; + } + _md = midi; +} + void IMuseGM::midiPitchBend(byte chan, int16 pitchbend) { uint16 tmp; |