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 8 additions and 9 deletions
Showing only changes of commit f20079b807 - Show all commits

View file

@ -185,7 +185,8 @@ pub fn main() !void {
const scri_path = try (args_it.next(allocator) orelse @panic("expected scri path or 'repl'")); const scri_path = try (args_it.next(allocator) orelse @panic("expected scri path or 'repl'"));
if (std.mem.eql(u8, scri_path, "repl")) { if (std.mem.eql(u8, scri_path, "repl")) {
return try doRepl(allocator, &args_it); @panic("TODO bring repl back");
// return try doRepl(allocator, &args_it);
} }
var file = try std.fs.cwd().openFile(scri_path, .{}); var file = try std.fs.cwd().openFile(scri_path, .{});

View file

@ -374,6 +374,8 @@ pub const Runner = struct {
try image.runPlugin("http://calf.sourceforge.net/plugins/VintageDelay", pos, params); try image.runPlugin("http://calf.sourceforge.net/plugins/VintageDelay", pos, params);
} }
fn newRunCommand(self: *@This(), cmd: lang.NewCommand) !void {}
fn runCommand(self: *Runner, cmd: *lang.Command) !void { fn runCommand(self: *Runner, cmd: *lang.Command) !void {
var params = ParamList.init(self.allocator); var params = ParamList.init(self.allocator);
defer params.deinit(); defer params.deinit();
@ -775,14 +777,10 @@ pub const Runner = struct {
cmds: lang.CommandList, cmds: lang.CommandList,
debug_flag: bool, debug_flag: bool,
) !void { ) !void {
for (cmds.items) |const_cmd| { for (cmds.items) |cmd| {
if (debug_flag) const_cmd.print(); // TODO
// if (debug_flag) const_cmd.print();
// copy the command so we own its memory try self.newRunCommand(cmd);
var cmd = try const_cmd.copy(self.allocator);
defer self.allocator.destroy(cmd);
try self.runCommand(cmd);
} }
} }
}; };