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 /video/qt_decoder.cpp | |
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 'video/qt_decoder.cpp')
-rw-r--r-- | video/qt_decoder.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp index 585f5927a1..aba545abc0 100644 --- a/video/qt_decoder.cpp +++ b/video/qt_decoder.cpp @@ -97,7 +97,7 @@ void QuickTimeDecoder::startAudio() { updateAudioBuffer(); for (uint32 i = 0; i < _audioTracks.size(); i++) { - g_system->getMixer()->playStream(Audio::Mixer::kPlainSoundType, &_audioHandles[i], _audioTracks[i], -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO); + g_system->getMixer()->playStream(Audio::Mixer::kPlainSoundType, &_audioHandles[i], _audioTracks[i], -1, getVolume(), getBalance(), DisposeAfterUse::NO); // Pause the audio again if we're still paused if (isPaused()) @@ -236,6 +236,18 @@ bool QuickTimeDecoder::loadStream(Common::SeekableReadStream *stream) { return true; } +void QuickTimeDecoder::updateVolume() { + for (uint32 i = 0; i < _audioHandles.size(); i++) + if (g_system->getMixer()->isSoundHandleActive(_audioHandles[i])) + g_system->getMixer()->setChannelVolume(_audioHandles[i], getVolume()); +} + +void QuickTimeDecoder::updateBalance() { + for (uint32 i = 0; i < _audioHandles.size(); i++) + if (g_system->getMixer()->isSoundHandleActive(_audioHandles[i])) + g_system->getMixer()->setChannelBalance(_audioHandles[i], getBalance()); +} + void QuickTimeDecoder::init() { Audio::QuickTimeAudioDecoder::init(); |