Use comptime for fully declarative LV2 and Custom commands #14

Merged
luna merged 69 commits from declarative-commands into master 2020-06-02 21:37:47 +00:00
2 changed files with 5 additions and 8 deletions
Showing only changes of commit e8808c501b - Show all commits

View file

@ -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").?,
}; };
} }

View file

@ -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;