make Embed follow existing custom plugin structure
This commit is contained in:
parent
e669b74ffb
commit
e8808c501b
2 changed files with 5 additions and 8 deletions
|
@ -140,10 +140,10 @@ pub const Embed = struct {
|
||||||
sndfile: *c.SNDFILE = undefined,
|
sndfile: *c.SNDFILE = undefined,
|
||||||
buf: []f32 = 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{
|
return Embed{
|
||||||
.allocator = allocator,
|
.allocator = allocator,
|
||||||
.filepath = filepath,
|
.filepath = params.get("path").?,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
|
|
||||||
const plugin = @import("plugin.zig");
|
const plugin = @import("plugin.zig");
|
||||||
|
const custom = @import("custom.zig");
|
||||||
|
|
||||||
pub const ParseError = error{
|
pub const ParseError = error{
|
||||||
OutOfMemory,
|
OutOfMemory,
|
||||||
|
@ -188,13 +189,9 @@ pub const Command = struct {
|
||||||
data: f32,
|
data: f32,
|
||||||
});
|
});
|
||||||
|
|
||||||
pub const Embed = struct {
|
pub const Embed = CustomCommand(Tag.write, custom.Embed, struct {
|
||||||
pub const base_tag = Tag.embed;
|
|
||||||
base: Command,
|
|
||||||
split: usize,
|
|
||||||
index: usize,
|
|
||||||
path: []const u8,
|
path: []const u8,
|
||||||
};
|
});
|
||||||
|
|
||||||
pub const Rotate = struct {
|
pub const Rotate = struct {
|
||||||
pub const base_tag = Tag.rotate;
|
pub const base_tag = Tag.rotate;
|
||||||
|
|
Loading…
Reference in a new issue