aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/sound.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2006-03-28 15:15:36 +0000
committerJohannes Schickel2006-03-28 15:15:36 +0000
commitc09d1ea52032be21fed34fa1ca17484af202b547 (patch)
treea1577c4b306fb6b18068dd692cd8c391228e6596 /engines/kyra/sound.cpp
parent46270a5dd7ffd36ba741f54865fa3715e8b5c6e7 (diff)
downloadscummvm-rg350-c09d1ea52032be21fed34fa1ca17484af202b547.tar.gz
scummvm-rg350-c09d1ea52032be21fed34fa1ca17484af202b547.tar.bz2
scummvm-rg350-c09d1ea52032be21fed34fa1ca17484af202b547.zip
- Commits heaviliy modifed patch #1459951 ("KYRA: Combining MIDI music with Adlib sfx") (created a wrapper class for two different sound drivers instead of adding a new variable to the KyraEngine class and chaning stuff there)
- Prevents to play track 0 for non mt-32 midi devices (got ugly sound output with windows midi) svn-id: r21479
Diffstat (limited to 'engines/kyra/sound.cpp')
-rw-r--r--engines/kyra/sound.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp
index 1b37c0a768..482ed96e61 100644
--- a/engines/kyra/sound.cpp
+++ b/engines/kyra/sound.cpp
@@ -247,9 +247,9 @@ void SoundMidiPC::playMusic(uint8 *data, uint32 size) {
return;
}
- _parser->setTrack(0);
_parser->setMidiDriver(this);
_parser->setTimerRate(getBaseTempo());
+ _parser->setTempo(0);
_parser->property(MidiParser::mpAutoLoop, true);
}
@@ -282,9 +282,9 @@ void SoundMidiPC::loadSoundEffectFile(uint8 *data, uint32 size) {
return;
}
- _soundEffect->setTrack(0);
_soundEffect->setMidiDriver(this);
_soundEffect->setTimerRate(getBaseTempo());
+ _soundEffect->setTempo(0);
_soundEffect->property(MidiParser::mpAutoLoop, false);
}
@@ -357,7 +357,7 @@ void SoundMidiPC::onTimer(void *refCon) {
}
void SoundMidiPC::playTrack(uint8 track) {
- if (_parser) {
+ if (_parser && (track != 0 || _nativeMT32)) {
_isPlaying = true;
_fadeMusicOut = false;
_fadeStartTime = 0;
@@ -376,7 +376,7 @@ void SoundMidiPC::haltTrack() {
setVolume(255);
_parser->setTrack(0);
_parser->jumpToTick(0);
- _parser->setTempo(1);
+ _parser->setTempo(0);
}
}
@@ -385,6 +385,7 @@ void SoundMidiPC::playSoundEffect(uint8 track) {
_sfxIsPlaying = true;
_soundEffect->setTrack(track);
_soundEffect->jumpToTick(0);
+ _soundEffect->setTempo(1);
_soundEffect->property(MidiParser::mpAutoLoop, false);
}
}