Use comptime for fully declarative LV2 and Custom commands #14
1 changed files with 2 additions and 12 deletions
|
@ -385,20 +385,10 @@ pub const Runner = struct {
|
|||
|
||||
const typ = @TypeOf(command);
|
||||
|
||||
inline for (@typeInfo(typ).Struct.fields) |cmd_field| {
|
||||
// ignore fields that can't be symbols for lv2 execution
|
||||
comptime {
|
||||
if (std.mem.eql(u8, cmd_field.name, "base") or
|
||||
std.mem.eql(u8, cmd_field.name, "split") or
|
||||
std.mem.eql(u8, cmd_field.name, "index"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
inline for (@typeInfo(@TypeOf(command.parameters)).Struct.fields) |cmd_field| {
|
||||
try params.append(plugin.Param{
|
||||
.sym = cmd_field.name,
|
||||
.value = @field(command, cmd_field.name),
|
||||
.value = @field(command.parameters, cmd_field.name),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue