summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--starling/scene.scm14
1 files changed, 7 insertions, 7 deletions
diff --git a/starling/scene.scm b/starling/scene.scm
index 16630ba..8757ad8 100644
--- a/starling/scene.scm
+++ b/starling/scene.scm
@@ -65,13 +65,13 @@
(define-method (refresh-background-music (scene <scene>))
(let ((source (background-music-source scene)))
- (if (audio? (background-music scene))
- (begin
- (set-source-volume! source (background-music-volume scene))
- (set-source-loop! source (background-music-loop? scene))
- (set-source-audio! source (background-music scene))
- (source-play source))
- (source-stop (background-music-source scene)))))
+ (set-source-volume! source (background-music-volume scene))
+ (set-source-loop! source (background-music-loop? scene))
+ (when (audio? (background-music scene))
+ (set-source-audio! source (background-music scene))
+ (if (active? scene)
+ (source-play source)
+ (source-stop source)))))
(define-method (on-change (scene <scene>) slot-name old new)
(case slot-name