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 d09603c005 - Show all commits

View file

@ -385,20 +385,10 @@ pub const Runner = struct {
const typ = @TypeOf(command); const typ = @TypeOf(command);
inline for (@typeInfo(typ).Struct.fields) |cmd_field| { inline for (@typeInfo(@TypeOf(command.parameters)).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;
}
}
try params.append(plugin.Param{ try params.append(plugin.Param{
.sym = cmd_field.name, .sym = cmd_field.name,
.value = @field(command, cmd_field.name), .value = @field(command.parameters, cmd_field.name),
}); });
} }