diff options
author | Dmitry Iskrich | 2016-06-14 19:47:17 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | bd05d98fa5a60b10831d0356d93a6c22755ddf5e (patch) | |
tree | 74d2e2b17f83814acfa36ab71fbae547d6370b86 | |
parent | 2387e721040335db27a1f8f46a73cdf047c27a6e (diff) | |
download | scummvm-rg350-bd05d98fa5a60b10831d0356d93a6c22755ddf5e.tar.gz scummvm-rg350-bd05d98fa5a60b10831d0356d93a6c22755ddf5e.tar.bz2 scummvm-rg350-bd05d98fa5a60b10831d0356d93a6c22755ddf5e.zip |
DIRECTOR: Add support for to/from MCI play options
-rw-r--r-- | engines/director/lingo/lingo-funcs.cpp | 5 | ||||
-rw-r--r-- | engines/director/sound.cpp | 6 | ||||
-rw-r--r-- | engines/director/sound.h | 2 |
3 files changed, 8 insertions, 5 deletions
diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp index 059671b04d..6f4b1b22e9 100644 --- a/engines/director/lingo/lingo-funcs.cpp +++ b/engines/director/lingo/lingo-funcs.cpp @@ -142,8 +142,9 @@ int Lingo::func_mci(Common::String *s) { warning("Unknown alias %s", params[0].c_str()); return 0; } - //TODO seek - _vm->getSoundManager()->playMCI(*_audioAliases[params[0]]); + uint32 from = strtol(params[1].c_str(), 0, 10); + uint32 to = strtol(params[2].c_str(), 0, 10); + _vm->getSoundManager()->playMCI(*_audioAliases[params[0]], from, to); } break; default: diff --git a/engines/director/sound.cpp b/engines/director/sound.cpp index ea8b78e1a4..5e32972248 100644 --- a/engines/director/sound.cpp +++ b/engines/director/sound.cpp @@ -67,8 +67,10 @@ void DirectorSound::playAIFF(Common::String filename, uint8 soundChannel) { _mixer->playStream(Audio::Mixer::kSFXSoundType, _sound2, sound); } -void DirectorSound::playMCI(Audio::AudioStream &stream) { - _mixer->playStream(Audio::Mixer::kSFXSoundType, _scriptSound, &stream); +void DirectorSound::playMCI(Audio::AudioStream &stream, uint32 from, uint32 to) { + Audio::SeekableAudioStream *seekStream = dynamic_cast<Audio::SeekableAudioStream *>(&stream); + Audio::SubSeekableAudioStream *subSeekStream = new Audio::SubSeekableAudioStream(seekStream, Audio::Timestamp(from, seekStream->getRate()), Audio::Timestamp(to, seekStream->getRate())); + _mixer->playStream(Audio::Mixer::kSFXSoundType, _scriptSound, subSeekStream); } bool DirectorSound::isChannelActive(uint8 channelID) { diff --git a/engines/director/sound.h b/engines/director/sound.h index 3a56c989a6..87fd04d1a0 100644 --- a/engines/director/sound.h +++ b/engines/director/sound.h @@ -42,7 +42,7 @@ public: void playWAV(Common::String filename, uint8 channelID); void playAIFF(Common::String filename, uint8 channelID); - void playMCI(Audio::AudioStream &stream); + void playMCI(Audio::AudioStream &stream, uint32 from, uint32 to); bool isChannelActive(uint8 channelID); void stopSound(); }; |