diff options
| author | Drew DeVault <sir@cmpwn.com> | 2021-12-12 13:56:23 +0100 |
|---|---|---|
| committer | Drew DeVault <sir@cmpwn.com> | 2021-12-12 13:56:23 +0100 |
| commit | eae63b218494d3aa077a9ea196abc4c5096e016b (patch) | |
| tree | b2bdd4c73685879aacecd1adc3ca962741267fee /sdl2/mixer/samples.ha | |
| parent | sdl2::mixer: implement sample loading (diff) | |
| download | hare-chip8-eae63b218494d3aa077a9ea196abc4c5096e016b.tar.gz | |
sdl2::mixer: implement channel playback
Diffstat (limited to '')
| -rw-r--r-- | sdl2/mixer/samples.ha | 6 |
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; |
