aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMatthew Hoops2012-05-27 21:18:32 -0400
committerMatthew Hoops2012-05-28 14:00:16 -0400
commit10f7e805c20c164a7b3a20832237341136165e28 (patch)
tree5a561ded0a078ddd744b42337d253730bd5177ea /engines/sci
parent792d1e6f6ae3d910fcc88f43dc92a1a761496c1e (diff)
downloadscummvm-rg350-10f7e805c20c164a7b3a20832237341136165e28.tar.gz
scummvm-rg350-10f7e805c20c164a7b3a20832237341136165e28.tar.bz2
scummvm-rg350-10f7e805c20c164a7b3a20832237341136165e28.zip
VIDEO: Add volume/balance control to VideoDecoder
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/video/robot_decoder.cpp12
-rw-r--r--engines/sci/video/robot_decoder.h5
2 files changed, 16 insertions, 1 deletions
diff --git a/engines/sci/video/robot_decoder.cpp b/engines/sci/video/robot_decoder.cpp
index 77f45e0788..95b3c2abc1 100644
--- a/engines/sci/video/robot_decoder.cpp
+++ b/engines/sci/video/robot_decoder.cpp
@@ -116,7 +116,7 @@ bool RobotDecoder::loadStream(Common::SeekableReadStream *stream) {
if (_header.hasSound) {
_audioStream = Audio::makeQueuingAudioStream(11025, false);
- _mixer->playStream(Audio::Mixer::kMusicSoundType, &_audioHandle, _audioStream);
+ _mixer->playStream(Audio::Mixer::kMusicSoundType, &_audioHandle, _audioStream, -1, getVolume(), getBalance());
}
readPaletteChunk(_header.paletteDataSize);
@@ -361,6 +361,16 @@ void RobotDecoder::close() {
reset();
}
+void RobotDecoder::updateVolume() {
+ if (g_system->getMixer()->isSoundHandleActive(_audioHandle))
+ g_system->getMixer()->setChannelVolume(_audioHandle, getVolume());
+}
+
+void RobotDecoder::updateBalance() {
+ if (g_system->getMixer()->isSoundHandleActive(_audioHandle))
+ g_system->getMixer()->setChannelBalance(_audioHandle, getBalance());
+}
+
#endif
} // End of namespace Sci
diff --git a/engines/sci/video/robot_decoder.h b/engines/sci/video/robot_decoder.h
index 3f93582418..e9cefe7d91 100644
--- a/engines/sci/video/robot_decoder.h
+++ b/engines/sci/video/robot_decoder.h
@@ -71,6 +71,11 @@ public:
Common::Point getPos() const { return _pos; }
protected:
+ // VideoDecoder API
+ void updateVolume();
+ void updateBalance();
+
+ // FixedRateVideoDecoder API
Common::Rational getFrameRate() const { return Common::Rational(60, 10); }
private: