fixes comp, gate, denoiser ctrl+up/down/left/right

This commit is contained in:
onyx-and-iris 2023-09-17 12:07:14 +01:00
parent 0570138963
commit d958167ded

View File

@ -785,23 +785,26 @@ class NVDAVMWindow(psg.Window):
self[f"STRIP {index}||SLIDER {param}"].update(value=util.check_bounds(val, (-12, 12))) self[f"STRIP {index}||SLIDER {param}"].update(value=util.check_bounds(val, (-12, 12)))
case [ case [
["STRIP", index], ["STRIP", index],
["SLIDER", "GAIN" | "LIMIT" | "BASS" | "MID" | "TREBLE" as param], ["SLIDER", "GAIN" | "COMP" | "GATE" | "DENOISER" | "LIMIT" | "BASS" | "MID" | "TREBLE" as param],
["KEY", "CTRL", "LEFT" | "RIGHT" | "UP" | "DOWN" as direction], ["KEY", "CTRL", "LEFT" | "RIGHT" | "UP" | "DOWN" as direction],
]: ]:
match param: match param:
case "GAIN": case "GAIN":
val = self.vm.strip[int(index)].gain val = self.vm.strip[int(index)].gain
case "COMP" | "GATE" | "DENOISER":
target = getattr(self.vm.strip[int(index)], param.lower())
val = target.knob
case "LIMIT": case "LIMIT":
val = self.vm.strip[int(index)].limit val = self.vm.strip[int(index)].limit
match direction: match direction:
case "RIGHT" | "UP": case "RIGHT" | "UP":
if param in ("BASS", "MID", "TREBLE"): if param in ("COMP", "GATE", "DENOISER", "BASS", "MID", "TREBLE"):
val += 1 val += 1
else: else:
val += 3 val += 3
case "LEFT" | "DOWN": case "LEFT" | "DOWN":
if param in ("BASS", "MID", "TREBLE"): if param in ("COMP", "GATE", "DENOISER", "BASS", "MID", "TREBLE"):
val -= 1 val -= 1
else: else:
val -= 3 val -= 3
@ -810,12 +813,15 @@ class NVDAVMWindow(psg.Window):
case "GAIN": case "GAIN":
self.vm.strip[int(index)].gain = util.check_bounds(val, (-60, 12)) self.vm.strip[int(index)].gain = util.check_bounds(val, (-60, 12))
self[f"STRIP {index}||SLIDER {param}"].update(value=util.check_bounds(val, (-60, 12))) self[f"STRIP {index}||SLIDER {param}"].update(value=util.check_bounds(val, (-60, 12)))
case "LIMIT": case "COMP" | "GATE" | "DENOISER":
self.vm.strip[int(index)].limit = util.check_bounds(val, (-40, 12)) setattr(target, "knob", util.check_bounds(val, (0, 10)))
self[f"STRIP {index}||SLIDER {param}"].update(value=util.check_bounds(val, (-40, 12))) self[f"STRIP {index}||SLIDER {param}"].update(value=util.check_bounds(val, (0, 10)))
case "BASS" | "MID" | "TREBLE": case "BASS" | "MID" | "TREBLE":
setattr(self.vm.strip[int(index)], param.lower(), util.check_bounds(val, (-12, 12))) setattr(self.vm.strip[int(index)], param.lower(), util.check_bounds(val, (-12, 12)))
self[f"STRIP {index}||SLIDER {param}"].update(value=util.check_bounds(val, (-12, 12))) self[f"STRIP {index}||SLIDER {param}"].update(value=util.check_bounds(val, (-12, 12)))
case "LIMIT":
self.vm.strip[int(index)].limit = util.check_bounds(val, (-40, 12))
self[f"STRIP {index}||SLIDER {param}"].update(value=util.check_bounds(val, (-40, 12)))
case [ case [
["STRIP", index], ["STRIP", index],
["SLIDER", "GAIN" | "COMP" | "GATE" | "DENOISER" | "AUDIBILITY" | "LIMIT" as param], ["SLIDER", "GAIN" | "COMP" | "GATE" | "DENOISER" | "AUDIBILITY" | "LIMIT" as param],