From 75e7af08323d207907334fa26b7604b3f06b48c2 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 13 Sep 2013 18:42:27 -0400 Subject: Add sample/music volume control. --- 2d/audio.scm | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/2d/audio.scm b/2d/audio.scm index d67eebe..e7d0023 100644 --- a/2d/audio.scm +++ b/2d/audio.scm @@ -43,11 +43,21 @@ "Play SAMPLE." (SDL:play-channel (sample-audio sample))) +(define (sample-volume) + "Return volume that samples are played at." + (SDL:volume)) + +(define (set-sample-volume volume) + "Set the volume that samples are played at." + (SDL:volume volume)) + (export make-sample load-sample sample? sample-audio - sample-play) + sample-play + sample-volume + set-sample-volume) ;; Wrapper over SDL music objects. (define-record-type @@ -66,11 +76,21 @@ "Play MUSIC." (SDL:play-music (music-audio music))) +(define (music-volume) + "Return volume that music is played at." + (SDL:music-volume)) + +(define (set-music-volume volume) + "Set the volume that music is played at." + (SDL:volume volume)) + (export make-music load-music music? music-audio - music-play) + music-play + music-volume + set-music-volume) (re-export (SDL:pause-music . music-pause) (SDL:resume-music . music-resume) -- cgit v1.2.3