diff options
author | Matthew Hoops | 2012-05-27 21:18:32 -0400 |
---|---|---|
committer | Matthew Hoops | 2012-05-28 14:00:16 -0400 |
commit | 10f7e805c20c164a7b3a20832237341136165e28 (patch) | |
tree | 5a561ded0a078ddd744b42337d253730bd5177ea /engines/sword25 | |
parent | 792d1e6f6ae3d910fcc88f43dc92a1a761496c1e (diff) | |
download | scummvm-rg350-10f7e805c20c164a7b3a20832237341136165e28.tar.gz scummvm-rg350-10f7e805c20c164a7b3a20832237341136165e28.tar.bz2 scummvm-rg350-10f7e805c20c164a7b3a20832237341136165e28.zip |
VIDEO: Add volume/balance control to VideoDecoder
Diffstat (limited to 'engines/sword25')
-rw-r--r-- | engines/sword25/fmv/theora_decoder.cpp | 12 | ||||
-rw-r--r-- | engines/sword25/fmv/theora_decoder.h | 3 |
2 files changed, 14 insertions, 1 deletions
diff --git a/engines/sword25/fmv/theora_decoder.cpp b/engines/sword25/fmv/theora_decoder.cpp index 082c569fda..d38f5a26cf 100644 --- a/engines/sword25/fmv/theora_decoder.cpp +++ b/engines/sword25/fmv/theora_decoder.cpp @@ -289,7 +289,7 @@ bool TheoraDecoder::loadStream(Common::SeekableReadStream *stream) { } if (_audStream) - g_system->getMixer()->playStream(Audio::Mixer::kPlainSoundType, _audHandle, _audStream); + g_system->getMixer()->playStream(Audio::Mixer::kPlainSoundType, _audHandle, _audStream, -1, getVolume(), getBalance()); } else { // tear down the partial vorbis setup vorbis_info_clear(&_vorbisInfo); @@ -550,6 +550,16 @@ void TheoraDecoder::translateYUVtoRGBA(th_ycbcr_buffer &YUVBuffer) { Graphics::convertYUV420ToRGB(&_surface, YUVBuffer[kBufferY].data, YUVBuffer[kBufferU].data, YUVBuffer[kBufferV].data, YUVBuffer[kBufferY].width, YUVBuffer[kBufferY].height, YUVBuffer[kBufferY].stride, YUVBuffer[kBufferU].stride); } +void TheoraDecoder::updateVolume() { + if (g_system->getMixer()->isSoundHandleActive(*_audHandle)) + g_system->getMixer()->setChannelVolume(*_audHandle, getVolume()); +} + +void TheoraDecoder::updateBalance() { + if (g_system->getMixer()->isSoundHandleActive(*_audHandle)) + g_system->getMixer()->setChannelBalance(*_audHandle, getBalance()); +} + } // End of namespace Sword25 #endif diff --git a/engines/sword25/fmv/theora_decoder.h b/engines/sword25/fmv/theora_decoder.h index 4fd7cc0f03..739040024f 100644 --- a/engines/sword25/fmv/theora_decoder.h +++ b/engines/sword25/fmv/theora_decoder.h @@ -87,6 +87,9 @@ public: bool endOfVideo() const; protected: + // VideoDecoder API + void updateVolume(); + void updateBalance(); void pauseVideoIntern(bool pause); private: |