Use comptime for fully declarative LV2 and Custom commands #14
1 changed files with 2 additions and 2 deletions
|
@ -378,7 +378,7 @@ pub const Lang = struct {
|
|||
cmd.split = try std.fmt.parseInt(usize, tok_it.next().?, 10);
|
||||
cmd.index = try std.fmt.parseInt(usize, tok_it.next().?, 10);
|
||||
|
||||
inline for (@typeInfo(@typeOf(command_struct.parameters)).Struct.fields) |cmd_field| {
|
||||
inline for (@typeInfo(@TypeOf(cmd.parameters)).Struct.fields) |cmd_field| {
|
||||
const arg = tok_it.next().?;
|
||||
const argument_value = switch (cmd_field.field_type) {
|
||||
f32 => try std.fmt.parseFloat(f32, arg),
|
||||
|
@ -391,7 +391,7 @@ pub const Lang = struct {
|
|||
argument_value,
|
||||
});
|
||||
|
||||
@field(cmd.params, cmd_field.name) = argument_value;
|
||||
@field(cmd.parameters, cmd_field.name) = argument_value;
|
||||
}
|
||||
} else {
|
||||
inline for (@typeInfo(command_struct).Struct.fields) |cmd_field| {
|
||||
|
|
Loading…
Reference in a new issue