audio: increase soundio binding coverage for running sine-wine example
This commit is contained in:
parent
d3b7df882e
commit
0e3461e25f
6 changed files with 114 additions and 6 deletions
|
|
@ -8,8 +8,8 @@ const SoundIo = @This();
|
|||
|
||||
handle: *c.SoundIo,
|
||||
|
||||
pub fn init() Error!SoundIo {
|
||||
return SoundIo{ .handle = c.soundio_create() orelse return Error.OutOfMemory };
|
||||
pub fn init() error{OutOfMemory}!SoundIo {
|
||||
return SoundIo{ .handle = c.soundio_create() orelse return error.OutOfMemory };
|
||||
}
|
||||
|
||||
pub fn deinit(self: SoundIo) void {
|
||||
|
|
@ -32,6 +32,10 @@ pub fn flushEvents(self: SoundIo) void {
|
|||
c.soundio_flush_events(self.handle);
|
||||
}
|
||||
|
||||
pub fn waitEvents(self: SoundIo) void {
|
||||
c.soundio_wait_events(self.handle);
|
||||
}
|
||||
|
||||
pub fn defaultInputDeviceIndex(self: SoundIo) ?u16 {
|
||||
const index = c.soundio_default_input_device_index(self.handle);
|
||||
return if (index < 0) null else @intCast(u16, index);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue