diff --git a/src/custom.zig b/src/custom.zig index f346fa0..4f9bbc2 100644 --- a/src/custom.zig +++ b/src/custom.zig @@ -140,10 +140,10 @@ pub const Embed = struct { sndfile: *c.SNDFILE = undefined, buf: []f32 = undefined, - pub fn init(allocator: *std.mem.Allocator, filepath: []const u8) @This() { + pub fn init(allocator: *std.mem.Allocator, params: *plugins.ParmaMap) @This() { return Embed{ .allocator = allocator, - .filepath = filepath, + .filepath = params.get("path").?, }; } diff --git a/src/lang.zig b/src/lang.zig index 03a6c52..ef886b9 100644 --- a/src/lang.zig +++ b/src/lang.zig @@ -1,6 +1,7 @@ const std = @import("std"); const plugin = @import("plugin.zig"); +const custom = @import("custom.zig"); pub const ParseError = error{ OutOfMemory, @@ -188,13 +189,9 @@ pub const Command = struct { data: f32, }); - pub const Embed = struct { - pub const base_tag = Tag.embed; - base: Command, - split: usize, - index: usize, + pub const Embed = CustomCommand(Tag.write, custom.Embed, struct { path: []const u8, - }; + }); pub const Rotate = struct { pub const base_tag = Tag.rotate;