all: update to latest Zig APIs (zig fmt)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
d95a453e78
commit
4bc32adeb8
61 changed files with 806 additions and 806 deletions
|
|
@ -163,7 +163,7 @@ pub const Player = struct {
|
|||
}
|
||||
|
||||
fn resumeOnClick(args: js.Object, _: usize, captures: []js.Value) js.Value {
|
||||
const self = @ptrFromInt(*Player, @intFromFloat(usize, captures[0].view(.num)));
|
||||
const self = @as(*Player, @ptrFromInt(@as(usize, @intFromFloat(captures[0].view(.num)))));
|
||||
self.play() catch {};
|
||||
|
||||
const document = js.global().get("document").view(.object);
|
||||
|
|
@ -177,7 +177,7 @@ pub const Player = struct {
|
|||
}
|
||||
|
||||
fn audioProcessEvent(args: js.Object, _: usize, captures: []js.Value) js.Value {
|
||||
const self = @ptrFromInt(*Player, @intFromFloat(usize, captures[0].view(.num)));
|
||||
const self = @as(*Player, @ptrFromInt(@as(usize, @intFromFloat(captures[0].view(.num)))));
|
||||
|
||||
const event = args.getIndex(0).view(.object);
|
||||
defer event.deinit();
|
||||
|
|
@ -219,7 +219,7 @@ pub const Player = struct {
|
|||
pub fn volume(self: Player) !f32 {
|
||||
const gain = self.gain_node.get("gain").view(.object);
|
||||
defer gain.deinit();
|
||||
return @floatCast(f32, gain.get("value").view(.num));
|
||||
return @as(f32, @floatCast(gain.get("value").view(.num)));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue