diff options
Diffstat (limited to 'engines/scumm/smush/smush_player.cpp')
-rw-r--r-- | engines/scumm/smush/smush_player.cpp | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp index 05c7ff2d9a..42ee0115c7 100644 --- a/engines/scumm/smush/smush_player.cpp +++ b/engines/scumm/smush/smush_player.cpp @@ -20,24 +20,21 @@ * */ -#include "engines/engine.h" - #include "common/config-manager.h" #include "common/file.h" #include "common/system.h" #include "common/util.h" +#include "audio/mixer.h" + #include "graphics/cursorman.h" #include "graphics/palette.h" -#include "scumm/bomp.h" #include "scumm/file.h" #include "scumm/imuse_digi/dimuse.h" -#include "scumm/imuse/imuse.h" #include "scumm/scumm.h" #include "scumm/scumm_v7.h" #include "scumm/sound.h" -#include "scumm/util.h" #include "scumm/smush/channel.h" #include "scumm/smush/codec37.h" #include "scumm/smush/codec47.h" @@ -47,6 +44,7 @@ #include "scumm/insane/insane.h" +#include "audio/audiostream.h" #include "audio/mixer.h" #include "audio/decoders/mp3.h" #include "audio/decoders/raw.h" @@ -246,9 +244,15 @@ SmushPlayer::SmushPlayer(ScummEngine_v7 *scumm) { _paused = false; _pauseStartTime = 0; _pauseTime = 0; + + + _IACTchannel = new Audio::SoundHandle(); + _compressedFileSoundHandle = new Audio::SoundHandle(); } SmushPlayer::~SmushPlayer() { + delete _IACTchannel; + delete _compressedFileSoundHandle; } void SmushPlayer::init(int32 speed) { @@ -275,8 +279,8 @@ void SmushPlayer::init(int32 speed) { vs->pitch = vs->w; _vm->_gdi->_numStrips = vs->w / 8; - _vm->_mixer->stopHandle(_compressedFileSoundHandle); - _vm->_mixer->stopHandle(_IACTchannel); + _vm->_mixer->stopHandle(*_compressedFileSoundHandle); + _vm->_mixer->stopHandle(*_IACTchannel); _IACTpos = 0; _vm->_smixer->stop(); } @@ -474,7 +478,7 @@ void SmushPlayer::handleIACT(int32 subSize, Common::SeekableReadStream &b) { if (!_IACTstream) { _IACTstream = Audio::makeQueuingAudioStream(22050, true); - _vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, &_IACTchannel, _IACTstream); + _vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, _IACTchannel, _IACTstream); } _IACTstream->queueBuffer(output_data, 0x1000, DisposeAfterUse::YES, Audio::FLAG_STEREO | Audio::FLAG_16BITS); @@ -1095,7 +1099,7 @@ void SmushPlayer::seekSan(const char *file, int32 pos, int32 contFrame) { } void SmushPlayer::tryCmpFile(const char *filename) { - _vm->_mixer->stopHandle(_compressedFileSoundHandle); + _vm->_mixer->stopHandle(*_compressedFileSoundHandle); _compressedFileMode = false; const char *i = strrchr(filename, '.'); @@ -1114,7 +1118,7 @@ void SmushPlayer::tryCmpFile(const char *filename) { strcpy(fname + (i - filename), ".ogg"); if (file->open(fname)) { _compressedFileMode = true; - _vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, &_compressedFileSoundHandle, Audio::makeVorbisStream(file, DisposeAfterUse::YES)); + _vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, _compressedFileSoundHandle, Audio::makeVorbisStream(file, DisposeAfterUse::YES)); return; } #endif @@ -1123,7 +1127,7 @@ void SmushPlayer::tryCmpFile(const char *filename) { strcpy(fname + (i - filename), ".mp3"); if (file->open(fname)) { _compressedFileMode = true; - _vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, &_compressedFileSoundHandle, Audio::makeMP3Stream(file, DisposeAfterUse::YES)); + _vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, _compressedFileSoundHandle, Audio::makeMP3Stream(file, DisposeAfterUse::YES)); return; } #endif @@ -1189,12 +1193,12 @@ void SmushPlayer::play(const char *filename, int32 speed, int32 offset, int32 st // the sound. Synt to time instead. now = _vm->_system->getMillis() - _pauseTime; elapsed = now - _startTime; - } else if (_vm->_mixer->isSoundHandleActive(_compressedFileSoundHandle)) { + } else if (_vm->_mixer->isSoundHandleActive(*_compressedFileSoundHandle)) { // Compressed SMUSH files. - elapsed = _vm->_mixer->getSoundElapsedTime(_compressedFileSoundHandle); - } else if (_vm->_mixer->isSoundHandleActive(_IACTchannel)) { + elapsed = _vm->_mixer->getSoundElapsedTime(*_compressedFileSoundHandle); + } else if (_vm->_mixer->isSoundHandleActive(*_IACTchannel)) { // Curse of Monkey Island SMUSH files. - elapsed = _vm->_mixer->getSoundElapsedTime(_IACTchannel); + elapsed = _vm->_mixer->getSoundElapsedTime(*_IACTchannel); } else { // For other SMUSH files, we don't necessarily have any // one channel to sync against, so we have to use @@ -1249,8 +1253,8 @@ void SmushPlayer::play(const char *filename, int32 speed, int32 offset, int32 st break; if (_vm->shouldQuit() || _vm->_saveLoadFlag || _vm->_smushVideoShouldFinish) { _smixer->stop(); - _vm->_mixer->stopHandle(_compressedFileSoundHandle); - _vm->_mixer->stopHandle(_IACTchannel); + _vm->_mixer->stopHandle(*_compressedFileSoundHandle); + _vm->_mixer->stopHandle(*_IACTchannel); _IACTpos = 0; break; } |