aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/sound/sound.cpp
diff options
context:
space:
mode:
authorSven Hesse2008-12-14 03:08:02 +0000
committerSven Hesse2008-12-14 03:08:02 +0000
commitbbe6ff006e79473a0beeac5a4d88f901c68102fb (patch)
tree3a8dd3e71625e40567b9586c3571283b91d67a15 /engines/gob/sound/sound.cpp
parent126c5a1dc8ec76b74a33f9b62d553d652a382df4 (diff)
downloadscummvm-rg350-bbe6ff006e79473a0beeac5a4d88f901c68102fb.tar.gz
scummvm-rg350-bbe6ff006e79473a0beeac5a4d88f901c68102fb.tar.bz2
scummvm-rg350-bbe6ff006e79473a0beeac5a4d88f901c68102fb.zip
Music/Video handling fixes/stubs
svn-id: r35351
Diffstat (limited to 'engines/gob/sound/sound.cpp')
-rw-r--r--engines/gob/sound/sound.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/engines/gob/sound/sound.cpp b/engines/gob/sound/sound.cpp
index 78ef69c912..84f47990ec 100644
--- a/engines/gob/sound/sound.cpp
+++ b/engines/gob/sound/sound.cpp
@@ -520,6 +520,25 @@ void Sound::cdTest(int trySubst, const char *label) {
_cdrom->testCD(trySubst, label);
}
+void Sound::bgPlay(const char *file) {
+ if (!_bgatmos)
+ return;
+
+ debugC(1, kDebugSound, "BackgroundAtmosphere: Playing \"%s\"", file);
+
+ _bgatmos->stop();
+ _bgatmos->queueClear();
+
+ SoundDesc *sndDesc = new SoundDesc;
+ if (!sampleLoad(sndDesc, file)) {
+ delete sndDesc;
+ return;
+ }
+
+ _bgatmos->queueSample(*sndDesc);
+ _bgatmos->play();
+}
+
void Sound::bgPlay(const char *base, int count) {
if (!_bgatmos)
return;
@@ -539,6 +558,8 @@ void Sound::bgPlay(const char *base, int count) {
sndDesc = new SoundDesc;
if (sampleLoad(sndDesc, fileName))
_bgatmos->queueSample(*sndDesc);
+ else
+ delete sndDesc;
}
_bgatmos->play();