add moddelay cmd
This commit is contained in:
parent
a0a75579dd
commit
127ea389fd
5 changed files with 24 additions and 1 deletions
|
@ -38,6 +38,7 @@ pub const CommandType = enum {
|
|||
Gverb,
|
||||
Invert,
|
||||
TapeDelay,
|
||||
ModDelay,
|
||||
|
||||
Noise,
|
||||
WildNoise,
|
||||
|
@ -205,6 +206,7 @@ pub const Lang = struct {
|
|||
_ = try self.keywords.put("gverb", .Gverb);
|
||||
_ = try self.keywords.put("invert", .Invert);
|
||||
_ = try self.keywords.put("tapedelay", .TapeDelay);
|
||||
_ = try self.keywords.put("moddelay", .ModDelay);
|
||||
|
||||
// custom implementations (not lv2)
|
||||
_ = try self.keywords.put("noise", .Noise);
|
||||
|
|
|
@ -32,6 +32,7 @@ pub fn printList(list: langs.CommandList, stream: var) !void {
|
|||
.Gverb => "gverb",
|
||||
.Invert => "invert",
|
||||
.TapeDelay => "tapedelay",
|
||||
.ModDelay => "moddelay",
|
||||
|
||||
.Noise => "noise",
|
||||
.WildNoise => "wildnoise",
|
||||
|
|
|
@ -354,6 +354,11 @@ pub const Runner = struct {
|
|||
try image.runPlugin("http://plugin.org.uk/swh-plugins/tapeDelay", pos, params);
|
||||
}
|
||||
|
||||
fn moddelayCmd(self: *Runner, pos: Position, params: ParamList) !void {
|
||||
var image = try self.getImage();
|
||||
try image.runPlugin("http://plugin.org.uk/swh-plugins/modDelay", pos, params);
|
||||
}
|
||||
|
||||
fn runCommand(self: *Runner, cmd: *lang.Command) !void {
|
||||
var params = ParamList.init(self.allocator);
|
||||
defer params.deinit();
|
||||
|
@ -664,6 +669,12 @@ pub const Runner = struct {
|
|||
try self.tapedelayCmd(pos, params);
|
||||
},
|
||||
|
||||
.ModDelay => {
|
||||
const pos = try cmd.consumePosition();
|
||||
try cmd.appendParam(¶ms, "base");
|
||||
try self.moddelayCmd(pos, params);
|
||||
},
|
||||
|
||||
else => blk: {
|
||||
std.debug.warn("Unsupported command: {}\n", .{cmd.command});
|
||||
break :blk RunError.UnknownCommand;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue