diff options
author | Lassi Pulkkinen <lassi@pulk.fi> | 2024-10-31 03:11:21 +0200 |
---|---|---|
committer | Lassi Pulkkinen <lassi@pulk.fi> | 2024-10-31 03:51:35 +0200 |
commit | ae44478b30d890fe0fb04022f44d474dcdcc3f9d (patch) | |
tree | 5f462459ae4b47d22114eed717d1382d08cf4dfe /sdl2/mixer/channels.ha |
Diffstat (limited to 'sdl2/mixer/channels.ha')
-rw-r--r-- | sdl2/mixer/channels.ha | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sdl2/mixer/channels.ha b/sdl2/mixer/channels.ha new file mode 100644 index 0000000..fffccd0 --- /dev/null +++ b/sdl2/mixer/channels.ha @@ -0,0 +1,20 @@ +use sdl2; + +@symbol("Mix_PlayChannelTimed") fn _Mix_PlayChannelTimed( + channel: int, + sample: *Mix_Chunk, + loops: int, + ticks: int, +) int; + +// Play chunk on channel, or if channel is -1, pick the first free unreserved +// channel. The sample will play for loops+1 number of times, unless stopped by +// halt, or fade out, or setting a new expiration time of less time than it +// would have originally taken to play the loops, or closing the mixer. +export fn Mix_PlayChannelTimed( + channel: int, + sample: *Mix_Chunk, + loops: int, +) (void | sdl2::error) = { + return sdl2::wrapvoid(_Mix_PlayChannelTimed(channel, sample, loops, -1)); +}; |