diff options
author | Max Horn | 2010-01-09 00:19:13 +0000 |
---|---|---|
committer | Max Horn | 2010-01-09 00:19:13 +0000 |
commit | be8371fb07936f27934909c4c0eb5184547a2656 (patch) | |
tree | 9edc668e3306f3ae87a8b9ed3a4a26a05eea0bdc /engines/groovie | |
parent | 41eaeaa61d968442bf2055d07e30b0dd4d31d606 (diff) | |
download | scummvm-rg350-be8371fb07936f27934909c4c0eb5184547a2656.tar.gz scummvm-rg350-be8371fb07936f27934909c4c0eb5184547a2656.tar.bz2 scummvm-rg350-be8371fb07936f27934909c4c0eb5184547a2656.zip |
Replace AppendableAudioStream by QueuingAudioStream
svn-id: r47189
Diffstat (limited to 'engines/groovie')
-rw-r--r-- | engines/groovie/player.h | 2 | ||||
-rw-r--r-- | engines/groovie/roq.cpp | 24 | ||||
-rw-r--r-- | engines/groovie/vdx.cpp | 4 |
3 files changed, 15 insertions, 15 deletions
diff --git a/engines/groovie/player.h b/engines/groovie/player.h index 2ef340149a..d54601bc52 100644 --- a/engines/groovie/player.h +++ b/engines/groovie/player.h @@ -52,7 +52,7 @@ protected: OSystem *_syst; Common::SeekableReadStream *_file; uint16 _flags; - Audio::AppendableAudioStream *_audioStream; + Audio::QueuingAudioStream *_audioStream; private: // Synchronization stuff diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index 5f16f9c935..11e7fd9aaa 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -516,11 +516,7 @@ bool ROQPlayer::processBlockSoundMono(ROQBlockHeader &blockHeader) { // Initialize the audio stream if needed if (!_audioStream) { - byte flags = Audio::Mixer::FLAG_16BITS | Audio::Mixer::FLAG_AUTOFREE; -#ifdef SCUMM_LITTLE_ENDIAN - flags |= Audio::Mixer::FLAG_LITTLE_ENDIAN; -#endif - _audioStream = Audio::makeAppendableAudioStream(22050, flags); + _audioStream = Audio::makeQueuingAudioStream(22050, false); Audio::SoundHandle sound_handle; g_system->getMixer()->playInputStream(Audio::Mixer::kPlainSoundType, &sound_handle, _audioStream); } @@ -544,7 +540,11 @@ bool ROQPlayer::processBlockSoundMono(ROQBlockHeader &blockHeader) { } // Queue the read buffer - _audioStream->queueBuffer((byte *)buffer, blockHeader.size * 2); + byte flags = Audio::Mixer::FLAG_16BITS | Audio::Mixer::FLAG_AUTOFREE; +#ifdef SCUMM_LITTLE_ENDIAN + flags |= Audio::Mixer::FLAG_LITTLE_ENDIAN; +#endif + _audioStream->queueBuffer((byte *)buffer, blockHeader.size * 2, flags); return true; } @@ -559,11 +559,7 @@ bool ROQPlayer::processBlockSoundStereo(ROQBlockHeader &blockHeader) { // Initialize the audio stream if needed if (!_audioStream) { - byte flags = Audio::Mixer::FLAG_16BITS | Audio::Mixer::FLAG_AUTOFREE | Audio::Mixer::FLAG_STEREO; -#ifdef SCUMM_LITTLE_ENDIAN - flags |= Audio::Mixer::FLAG_LITTLE_ENDIAN; -#endif - _audioStream = Audio::makeAppendableAudioStream(22050, flags); + _audioStream = Audio::makeQueuingAudioStream(22050, true); Audio::SoundHandle sound_handle; g_system->getMixer()->playInputStream(Audio::Mixer::kPlainSoundType, &sound_handle, _audioStream); } @@ -600,7 +596,11 @@ bool ROQPlayer::processBlockSoundStereo(ROQBlockHeader &blockHeader) { } // Queue the read buffer - _audioStream->queueBuffer((byte *)buffer, blockHeader.size * 2); + byte flags = Audio::Mixer::FLAG_16BITS | Audio::Mixer::FLAG_AUTOFREE | Audio::Mixer::FLAG_STEREO; +#ifdef SCUMM_LITTLE_ENDIAN + flags |= Audio::Mixer::FLAG_LITTLE_ENDIAN; +#endif + _audioStream->queueBuffer((byte *)buffer, blockHeader.size * 2, flags); return true; } diff --git a/engines/groovie/vdx.cpp b/engines/groovie/vdx.cpp index 0c754473fe..e2764defa6 100644 --- a/engines/groovie/vdx.cpp +++ b/engines/groovie/vdx.cpp @@ -498,7 +498,7 @@ void VDXPlayer::decodeBlockDelta(uint32 offset, byte *colours, uint16 imageWidth void VDXPlayer::chunkSound(Common::ReadStream *in) { if (!_audioStream) { - _audioStream = Audio::makeAppendableAudioStream(22050, Audio::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_AUTOFREE); + _audioStream = Audio::makeQueuingAudioStream(22050, false); Audio::SoundHandle sound_handle; g_system->getMixer()->playInputStream(Audio::Mixer::kPlainSoundType, &sound_handle, _audioStream); } @@ -506,7 +506,7 @@ void VDXPlayer::chunkSound(Common::ReadStream *in) { byte *data = new byte[60000]; int chunksize = in->read(data, 60000); if (!Common::isDebugChannelEnabled(kGroovieDebugFast)) { - _audioStream->queueBuffer(data, chunksize); + _audioStream->queueBuffer(data, chunksize, Audio::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_AUTOFREE); } } |