diff --git a/src/image.zig b/src/image.zig index 221d3cb..06bc739 100644 --- a/src/image.zig +++ b/src/image.zig @@ -195,7 +195,7 @@ pub const Image = struct { var idx = c.lilv_port_get_index(ctx.plugin, port); std.debug.warn( - "sym={}, idx={} to val={}\n", + "\tset sym={}, idx={} to val={}\n", param.sym, idx, param.value, @@ -223,10 +223,10 @@ pub const Image = struct { const file_end = try getEndPos(self.curpath); const seek_pos = position.seekPos(file_end); - std.debug.warn("start {} end {}\n", seek_pos.start, seek_pos.end); + std.debug.warn("\tstart {} end {}\n", seek_pos.start, seek_pos.end); - var seeked = c.sf_seek(self.sndfile, 0, c.SEEK_SET); - std.debug.warn("in: seek {}\n", seeked); + // make sure we start from 0 + _ = c.sf_seek(self.sndfile, 0, c.SEEK_SET); var i: usize = 0; diff --git a/src/main.zig b/src/main.zig index 4a415b5..bdbf8a6 100644 --- a/src/main.zig +++ b/src/main.zig @@ -21,16 +21,18 @@ pub fn main() !void { // args[1] is the path to scri file const scri_path = try (args_it.next(allocator) orelse @panic("expected scri path")); - std.debug.warn("path: '{}'\n", scri_path); - var file = try std.fs.File.openRead(scri_path); defer file.close(); // sadly, we read it all into memory. such is life const total_bytes = try file.getEndPos(); + var data = try allocator.alloc(u8, total_bytes); + defer allocator.free(data); _ = try file.read(data); var cmds = try lang.parse(data); + defer cmds.deinit(); + try runner.runCommands(cmds, true); }