From d67f9b89f275ddb092d0b833b7ca9adf6a722c5a Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sun, 27 May 2012 21:19:53 -0400 Subject: MOHAWK: Use video volume control in Riven --- engines/mohawk/video.cpp | 8 +++++--- engines/mohawk/video.h | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/engines/mohawk/video.cpp b/engines/mohawk/video.cpp index 83fca9ac35..c10b986c60 100644 --- a/engines/mohawk/video.cpp +++ b/engines/mohawk/video.cpp @@ -315,7 +315,7 @@ VideoHandle VideoManager::playMovieRiven(uint16 id) { for (uint16 i = 0; i < _mlstRecords.size(); i++) if (_mlstRecords[i].code == id) { debug(1, "Play tMOV %d (non-blocking) at (%d, %d) %s", _mlstRecords[i].movieID, _mlstRecords[i].left, _mlstRecords[i].top, _mlstRecords[i].loop != 0 ? "looping" : "non-looping"); - return createVideoHandle(_mlstRecords[i].movieID, _mlstRecords[i].left, _mlstRecords[i].top, _mlstRecords[i].loop != 0); + return createVideoHandle(_mlstRecords[i].movieID, _mlstRecords[i].left, _mlstRecords[i].top, _mlstRecords[i].loop != 0, _mlstRecords[i].volume); } return NULL_VID_HANDLE; @@ -371,7 +371,7 @@ void VideoManager::disableAllMovies() { _videoStreams[i].enabled = false; } -VideoHandle VideoManager::createVideoHandle(uint16 id, uint16 x, uint16 y, bool loop) { +VideoHandle VideoManager::createVideoHandle(uint16 id, uint16 x, uint16 y, bool loop, byte volume) { // First, check to see if that video is already playing for (uint32 i = 0; i < _videoStreams.size(); i++) if (_videoStreams[i].id == id) @@ -381,6 +381,7 @@ VideoHandle VideoManager::createVideoHandle(uint16 id, uint16 x, uint16 y, bool Video::QuickTimeDecoder *decoder = new Video::QuickTimeDecoder(); decoder->setChunkBeginOffset(_vm->getResourceOffset(ID_TMOV, id)); decoder->loadStream(_vm->getResource(ID_TMOV, id)); + decoder->setVolume(volume); VideoEntry entry; entry.clear(); @@ -403,7 +404,7 @@ VideoHandle VideoManager::createVideoHandle(uint16 id, uint16 x, uint16 y, bool return _videoStreams.size() - 1; } -VideoHandle VideoManager::createVideoHandle(const Common::String &filename, uint16 x, uint16 y, bool loop) { +VideoHandle VideoManager::createVideoHandle(const Common::String &filename, uint16 x, uint16 y, bool loop, byte volume) { // First, check to see if that video is already playing for (uint32 i = 0; i < _videoStreams.size(); i++) if (_videoStreams[i].filename == filename) @@ -426,6 +427,7 @@ VideoHandle VideoManager::createVideoHandle(const Common::String &filename, uint } entry->loadStream(file); + entry->setVolume(volume); // Search for any deleted videos so we can take a formerly used slot for (uint32 i = 0; i < _videoStreams.size(); i++) diff --git a/engines/mohawk/video.h b/engines/mohawk/video.h index 8736782d7a..98bcadfb53 100644 --- a/engines/mohawk/video.h +++ b/engines/mohawk/video.h @@ -120,8 +120,8 @@ private: // Keep tabs on any videos playing Common::Array _videoStreams; - VideoHandle createVideoHandle(uint16 id, uint16 x, uint16 y, bool loop); - VideoHandle createVideoHandle(const Common::String &filename, uint16 x, uint16 y, bool loop); + VideoHandle createVideoHandle(uint16 id, uint16 x, uint16 y, bool loop, byte volume = 0xff); + VideoHandle createVideoHandle(const Common::String &filename, uint16 x, uint16 y, bool loop, byte volume = 0xff); }; } // End of namespace Mohawk -- cgit v1.2.3