aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-06-12 17:32:22 +0200
committerEinar Johan Trøan Sømåen2012-06-12 17:32:22 +0200
commit92b7703265c83b9dfec702ada156d78fe4eb93ea (patch)
treeb31df21b726ad4664ca842af160c70c084af8832 /engines/wintermute
parentfcb36b6b9083a52f68989da12b1adb377a782469 (diff)
downloadscummvm-rg350-92b7703265c83b9dfec702ada156d78fe4eb93ea.tar.gz
scummvm-rg350-92b7703265c83b9dfec702ada156d78fe4eb93ea.tar.bz2
scummvm-rg350-92b7703265c83b9dfec702ada156d78fe4eb93ea.zip
WINTERMUTE: Add some loop-support to BSoundBuffer.
Diffstat (limited to 'engines/wintermute')
-rw-r--r--engines/wintermute/Base/BSoundBuffer.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/engines/wintermute/Base/BSoundBuffer.cpp b/engines/wintermute/Base/BSoundBuffer.cpp
index 9751ad44c0..bbec1342c3 100644
--- a/engines/wintermute/Base/BSoundBuffer.cpp
+++ b/engines/wintermute/Base/BSoundBuffer.cpp
@@ -176,18 +176,24 @@ HRESULT CBSoundBuffer::LoadFromFile(const char *Filename, bool ForceReload) {
//////////////////////////////////////////////////////////////////////////
-HRESULT CBSoundBuffer::Play(bool Looping, uint32 StartSample) {
- // TODO: looping
+HRESULT CBSoundBuffer::Play(bool looping, uint32 startSample) {
+ if (startSample != 0) {
+ warning("BSoundBuffer::Play - Should start playback at %d, but currently we don't", startSample);
+ }
if (_stream) {
- SetLooping(Looping);
- g_system->getMixer()->playStream(Audio::Mixer::kPlainSoundType, _handle, _stream, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO);
+ if (looping) {
+ Audio::AudioStream *loopStream = Audio::makeLoopingAudioStream(_stream, 0);
+ g_system->getMixer()->playStream(Audio::Mixer::kPlainSoundType, _handle, loopStream, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::YES);
+ } else {
+ g_system->getMixer()->playStream(Audio::Mixer::kPlainSoundType, _handle, _stream, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::YES);
+ }
}
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
void CBSoundBuffer::SetLooping(bool looping) {
- warning("BSoundBuffer::SetLooping - not implemented yet");
+ warning("BSoundBuffer::SetLooping(%d) - not implemented yet", looping);
#if 0
_looping = looping;