mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-06-01 12:27:43 +02:00
17 lines
445 B
Zig
17 lines
445 B
Zig
const std = @import("std");
|
|
const c = ffi.c;
|
|
|
|
const ffi = @import("ffi.zig");
|
|
|
|
pub fn msg(mpv: *c.mpv_handle, comptime fmt: []const u8, args: anytype) !void {
|
|
std.log.info(fmt, args);
|
|
|
|
var buf: [1024 * 4]u8 = undefined;
|
|
const osd_msg = try std.fmt.bufPrintZ(&buf, "[sbskip] " ++ fmt, args);
|
|
try ffi.checkMpvError(c.mpv_command(
|
|
mpv,
|
|
@constCast(&[_:null]?[*:0]const u8{ "show-text", osd_msg, "4000" }),
|
|
));
|
|
}
|
|
|