aboutsummaryrefslogtreecommitdiff
path: root/sdl2/mixer/samples.ha
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2021-12-12 13:56:23 +0100
committerDrew DeVault <sir@cmpwn.com>2021-12-12 13:56:23 +0100
commiteae63b218494d3aa077a9ea196abc4c5096e016b (patch)
treeb2bdd4c73685879aacecd1adc3ca962741267fee /sdl2/mixer/samples.ha
parentsdl2::mixer: implement sample loading (diff)
downloadhare-chip8-eae63b218494d3aa077a9ea196abc4c5096e016b.tar.gz
sdl2::mixer: implement channel playback
Diffstat (limited to '')
-rw-r--r--sdl2/mixer/samples.ha6
1 files changed, 6 insertions, 0 deletions
diff --git a/sdl2/mixer/samples.ha b/sdl2/mixer/samples.ha
index 49f1e1e..aaf1ad1 100644
--- a/sdl2/mixer/samples.ha
+++ b/sdl2/mixer/samples.ha
@@ -31,3 +31,9 @@ export fn load_file(src: str) (*chunk | fs::error | sdl2::error) = {
// chunk after this without loading a new sample to it. Note: It's a bad idea to
// free a chunk that is still being played...
export @symbol("Mix_FreeChunk") fn free_chunk(chunk: *chunk) void;
+
+// Maximum volume for a chunk.
+export def MAX_VOLUME: int = 128; // XXX: SDL_mixer derives this from SDL_MIX_MAXVOLUME
+
+// Sets the chunk volume as specified, returning the previous value.
+export @symbol("Mix_VolumeChunk") fn volume_chunk(chunk: *chunk, volume: int) int;