aboutsummaryrefslogtreecommitdiff
path: root/engines/voyeur
diff options
context:
space:
mode:
authorBastien Bouclet2017-07-10 21:36:19 +0200
committerBastien Bouclet2017-07-27 06:40:07 +0200
commitec49730711399c7705211f76bf583ad73a681e16 (patch)
treecedf79022d82766108a26a589958cf5a43383ca8 /engines/voyeur
parent22ce8dbf385c08a58222049333554ee206bf933d (diff)
downloadscummvm-rg350-ec49730711399c7705211f76bf583ad73a681e16.tar.gz
scummvm-rg350-ec49730711399c7705211f76bf583ad73a681e16.tar.bz2
scummvm-rg350-ec49730711399c7705211f76bf583ad73a681e16.zip
VIDEO: Allow setting the mixer sound type used to play audio tracks
Diffstat (limited to 'engines/voyeur')
-rw-r--r--engines/voyeur/animation.cpp9
-rw-r--r--engines/voyeur/animation.h5
2 files changed, 6 insertions, 8 deletions
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<SoundFrame> _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();