From ec49730711399c7705211f76bf583ad73a681e16 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Mon, 10 Jul 2017 21:36:19 +0200 Subject: VIDEO: Allow setting the mixer sound type used to play audio tracks --- engines/voyeur/animation.cpp | 9 +++++---- engines/voyeur/animation.h | 5 +---- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'engines/voyeur') diff --git a/engines/voyeur/animation.cpp b/engines/voyeur/animation.cpp index d5d58a2fd3..5a5f4c2ad3 100644 --- a/engines/voyeur/animation.cpp +++ b/engines/voyeur/animation.cpp @@ -34,7 +34,7 @@ namespace Voyeur { // Number of audio frames to keep audio track topped up when playing back video #define SOUND_FRAMES_READAHEAD 3 -RL2Decoder::RL2Decoder(Audio::Mixer::SoundType soundType) : _soundType(soundType) { +RL2Decoder::RL2Decoder() { _paletteStart = 0; _fileStream = nullptr; _soundFrameNumber = -1; @@ -76,7 +76,7 @@ bool RL2Decoder::loadStream(Common::SeekableReadStream *stream) { // Add an audio track if sound is present _audioTrack = nullptr; if (_header._soundRate) { - _audioTrack = new RL2AudioTrack(_header, stream, _soundType); + _audioTrack = new RL2AudioTrack(_header, stream, getSoundType()); addTrack(_audioTrack); } @@ -433,8 +433,9 @@ Graphics::Surface *RL2Decoder::RL2VideoTrack::getBackSurface() { /*------------------------------------------------------------------------*/ -RL2Decoder::RL2AudioTrack::RL2AudioTrack(const RL2FileHeader &header, Common::SeekableReadStream *stream, Audio::Mixer::SoundType soundType): - _header(header), _soundType(soundType) { +RL2Decoder::RL2AudioTrack::RL2AudioTrack(const RL2FileHeader &header, Common::SeekableReadStream *stream, Audio::Mixer::SoundType soundType) : + AudioTrack(soundType), + _header(header) { // Create audio straem for the audio track _audStream = Audio::makeQueuingAudioStream(_header._rate, _header._channels == 2); } diff --git a/engines/voyeur/animation.h b/engines/voyeur/animation.h index c20ccf7284..fbb0cc90d0 100644 --- a/engines/voyeur/animation.h +++ b/engines/voyeur/animation.h @@ -88,7 +88,6 @@ private: class RL2AudioTrack : public AudioTrack { private: - Audio::Mixer::SoundType _soundType; const RL2FileHeader &_header; Audio::QueuingAudioStream *_audStream; protected: @@ -98,7 +97,6 @@ private: Audio::Mixer::SoundType soundType); ~RL2AudioTrack(); - Audio::Mixer::SoundType getSoundType() const { return _soundType; } int numQueuedStreams() const { return _audStream->numQueuedStreams(); } virtual bool isSeekable() const { return true; } virtual bool seek(const Audio::Timestamp &time) { return true; } @@ -156,7 +154,6 @@ private: RL2AudioTrack *_audioTrack; RL2VideoTrack *_videoTrack; Common::SeekableReadStream *_fileStream; - Audio::Mixer::SoundType _soundType; RL2FileHeader _header; int _paletteStart; Common::Array _soundFrames; @@ -171,7 +168,7 @@ private: virtual bool seekIntern(const Audio::Timestamp &time); public: - RL2Decoder(Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType); + RL2Decoder(); virtual ~RL2Decoder(); virtual void close(); -- cgit v1.2.3