aboutsummaryrefslogtreecommitdiff
path: root/vendor/hare-sdl2/sdl2/mixer/channels.ha
diff options
context:
space:
mode:
authorPolesznyák Márk <contact@pml68.dev>2026-04-06 23:44:45 +0200
committerPolesznyák Márk <contact@pml68.dev>2026-04-06 23:44:45 +0200
commit6637fdded6f3c5fba7e7a378ca7e30d0db11f27d (patch)
tree40f8868ae2140680645b1f90f4a1fc2a378920b3 /vendor/hare-sdl2/sdl2/mixer/channels.ha
parentdocs: add README (diff)
parentAdd ! after c::fromstr calls to handle nomem (diff)
downloadhare-chip8-6637fdded6f3c5fba7e7a378ca7e30d0db11f27d.tar.gz
Add 'vendor/hare-sdl2/' from commit 'fb6008be0b79a2a24b1ac960316a83f7873b4f39'
git-subtree-dir: vendor/hare-sdl2 git-subtree-mainline: ed088aa81ac23fa48d5ae48ee739c97e0fcb4490 git-subtree-split: fb6008be0b79a2a24b1ac960316a83f7873b4f39
Diffstat (limited to '')
-rw-r--r--vendor/hare-sdl2/sdl2/mixer/channels.ha20
1 files changed, 20 insertions, 0 deletions
diff --git a/vendor/hare-sdl2/sdl2/mixer/channels.ha b/vendor/hare-sdl2/sdl2/mixer/channels.ha
new file mode 100644
index 0000000..fffccd0
--- /dev/null
+++ b/vendor/hare-sdl2/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));
+};