AGI: MIDI sound - turn sounds off if requested

Makes sound_midi.cpp to respect VM_FLAG_SOUND_ON
This commit is contained in:
Zvika Haramaty 2021-03-14 15:18:34 +02:00 committed by Eugene Sandulenko
parent 3939a7838b
commit 9fbb3f3ff7

View File

@ -102,8 +102,12 @@ void SoundGenMIDI::sendToChannel(byte channel, uint32 b) {
_channelsTable[channel]->volume(_channelsVolume[channel] * _masterVolume / 255);
}
if (_channelsTable[channel])
_channelsTable[channel]->send(b);
if (_channelsTable[channel]) {
if (_vm->getFlag(VM_FLAG_SOUND_ON))
_channelsTable[channel]->send(b);
else
_channelsTable[channel]->send(0x7bb0 + channel); // all notes off
}
}
void SoundGenMIDI::endOfTrack() {