sysaudio: add missing bool param to soundio call (#492)
This commit is contained in:
parent
d9bd4d7d79
commit
5dfd677a37
3 changed files with 7 additions and 6 deletions
|
|
@ -25,8 +25,8 @@ pub fn start(self: InStream) Error!void {
|
||||||
try intToError(c.soundio_instream_start(self.handle));
|
try intToError(c.soundio_instream_start(self.handle));
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn pause(self: InStream) Error!void {
|
pub fn pause(self: InStream, pause_state: bool) Error!void {
|
||||||
try intToError(c.soundio_instream_pause(self.handle));
|
try intToError(c.soundio_instream_pause(self.handle, pause_state));
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn beginWrite(self: InStream, areas: [*]?[*]c.SoundIoChannelArea, frame_count: *i32) Error!void {
|
pub fn beginWrite(self: InStream, areas: [*]?[*]c.SoundIoChannelArea, frame_count: *i32) Error!void {
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,8 @@ pub fn start(self: OutStream) Error!void {
|
||||||
try intToError(c.soundio_outstream_start(self.handle));
|
try intToError(c.soundio_outstream_start(self.handle));
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn pause(self: OutStream) Error!void {
|
pub fn pause(self: OutStream, pause_state: bool) Error!void {
|
||||||
try intToError(c.soundio_outstream_pause(self.handle));
|
try intToError(c.soundio_outstream_pause(self.handle, pause_state));
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn beginWrite(self: OutStream, areas: [*]?[*]c.SoundIoChannelArea, frame_count: *i32) Error!void {
|
pub fn beginWrite(self: OutStream, areas: [*]?[*]c.SoundIoChannelArea, frame_count: *i32) Error!void {
|
||||||
|
|
|
||||||
|
|
@ -112,8 +112,8 @@ pub const Device = struct {
|
||||||
|
|
||||||
pub fn pause(device: *Device) Error!void {
|
pub fn pause(device: *Device) Error!void {
|
||||||
return (switch (device.handle) {
|
return (switch (device.handle) {
|
||||||
.input => |d| d.pause(),
|
.input => |d| d.pause(true),
|
||||||
.output => |d| d.pause(),
|
.output => |d| d.pause(true),
|
||||||
}) catch |err| {
|
}) catch |err| {
|
||||||
return switch (err) {
|
return switch (err) {
|
||||||
error.OutOfMemory => error.OutOfMemory,
|
error.OutOfMemory => error.OutOfMemory,
|
||||||
|
|
@ -123,6 +123,7 @@ pub const Device = struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn start(device: *Device) Error!void {
|
pub fn start(device: *Device) Error!void {
|
||||||
|
// TODO(sysaudio): after pause, may need to call d.pause(false) instead of d.start()?
|
||||||
return (switch (device.handle) {
|
return (switch (device.handle) {
|
||||||
.input => |d| d.start(),
|
.input => |d| d.start(),
|
||||||
.output => |d| d.start(),
|
.output => |d| d.start(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue