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
Showing only changes of commit 690ab89cfd - Show all commits

View file

@ -521,7 +521,7 @@ pub const Lang = struct {
var cmd = try self.allocator.create(command_struct); var cmd = try self.allocator.create(command_struct);
const is_lv2_command = switch (command_struct.base_tag) { const is_lv2_command = switch (command_struct.base_tag) {
.noop, .load, .quicksave, .runqs, .rotate => false, .noop, .load, .quicksave, .runqs, .rotate => false,
else => command_struct.command_type == .lv2_command, else => true,
}; };
// TODO: crash when no arguments are left but we still need // TODO: crash when no arguments are left but we still need
@ -543,7 +543,6 @@ pub const Lang = struct {
cmd.split = try std.fmt.parseInt(usize, split.?, 10); cmd.split = try std.fmt.parseInt(usize, split.?, 10);
cmd.index = try std.fmt.parseInt(usize, index.?, 10); cmd.index = try std.fmt.parseInt(usize, index.?, 10);
// All parameters for LV2 plugins are f32.
inline for (@typeInfo(@TypeOf(cmd.parameters)).Struct.fields) |cmd_field| { inline for (@typeInfo(@TypeOf(cmd.parameters)).Struct.fields) |cmd_field| {
const maybe_arg = tok_it.next(); const maybe_arg = tok_it.next();
if (maybe_arg == null) { if (maybe_arg == null) {