From eae63b218494d3aa077a9ea196abc4c5096e016b Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sun, 12 Dec 2021 13:56:23 +0100 Subject: sdl2::mixer: implement channel playback --- sdl2/mixer/samples.ha | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sdl2/mixer/samples.ha') 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; -- cgit v1.2.3