summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@member.fsf.org>2013-09-13 18:42:27 -0400
committerDavid Thompson <dthompson@member.fsf.org>2013-09-13 18:42:27 -0400
commit75e7af08323d207907334fa26b7604b3f06b48c2 (patch)
treebdfa1872ada1fe7ee2250ba0c61f682d3bd6641a
parent8649aa9717ed2fdcdf69a1cfd6e435b981d8dc5d (diff)
Add sample/music volume control.
-rw-r--r--2d/audio.scm24
1 files 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 <music>
@@ -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)