From 42fad869056c3b07fa62334f809fbbd66089ced9 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sun, 17 Sep 2023 12:23:04 +0100 Subject: [PATCH] defines bass,mid,treble ctrl events --- src/nvda_voicemeeter/window.py | 52 ++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 9 deletions(-) diff --git a/src/nvda_voicemeeter/window.py b/src/nvda_voicemeeter/window.py index 2f3228f..600f433 100644 --- a/src/nvda_voicemeeter/window.py +++ b/src/nvda_voicemeeter/window.py @@ -754,8 +754,6 @@ class NVDAVMWindow(psg.Window): match param: case "GAIN": val = self.vm.strip[int(index)].gain - case "LIMIT": - val = self.vm.strip[int(index)].limit case "COMP" | "GATE" | "DENOISER": target = getattr(self.vm.strip[int(index)], param.lower()) val = target.knob @@ -763,6 +761,8 @@ class NVDAVMWindow(psg.Window): val = self.vm.strip[int(index)].audibility case "BASS" | "MID" | "TREBLE": val = getattr(self.vm.strip[int(index)], param.lower()) + case "LIMIT": + val = self.vm.strip[int(index)].limit match direction: case "RIGHT" | "UP": @@ -774,9 +774,6 @@ class NVDAVMWindow(psg.Window): case "GAIN": 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))) - 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 "COMP" | "GATE" | "DENOISER": setattr(target, "knob", util.check_bounds(val, (0, 10))) self[f"STRIP {index}||SLIDER {param}"].update(value=util.check_bounds(val, (0, 10))) @@ -786,9 +783,23 @@ class NVDAVMWindow(psg.Window): case "BASS" | "MID" | "TREBLE": 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))) + 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 [ ["STRIP", index], - ["SLIDER", "GAIN" | "COMP" | "GATE" | "DENOISER" | "LIMIT" | "BASS" | "MID" | "TREBLE" as param], + [ + "SLIDER", + "GAIN" + | "COMP" + | "GATE" + | "DENOISER" + | "AUDIBILITY" + | "LIMIT" + | "BASS" + | "MID" + | "TREBLE" as param, + ], ["KEY", "CTRL", "LEFT" | "RIGHT" | "UP" | "DOWN" as direction], ]: match param: @@ -797,17 +808,21 @@ class NVDAVMWindow(psg.Window): case "COMP" | "GATE" | "DENOISER": target = getattr(self.vm.strip[int(index)], param.lower()) val = target.knob + case "AUDIBILITY": + val = self.vm.strip[int(index)].audibility + case "BASS" | "MID" | "TREBLE": + val = getattr(self.vm.strip[int(index)], param.lower()) case "LIMIT": val = self.vm.strip[int(index)].limit match direction: case "RIGHT" | "UP": - if param in ("COMP", "GATE", "DENOISER", "BASS", "MID", "TREBLE"): + if param in ("COMP", "GATE", "DENOISER", "AUDIBILITY", "BASS", "MID", "TREBLE"): val += 1 else: val += 3 case "LEFT" | "DOWN": - if param in ("COMP", "GATE", "DENOISER", "BASS", "MID", "TREBLE"): + if param in ("COMP", "GATE", "DENOISER", "AUDIBILITY", "BASS", "MID", "TREBLE"): val -= 1 else: val -= 3 @@ -819,6 +834,9 @@ class NVDAVMWindow(psg.Window): case "COMP" | "GATE" | "DENOISER": setattr(target, "knob", util.check_bounds(val, (0, 10))) self[f"STRIP {index}||SLIDER {param}"].update(value=util.check_bounds(val, (0, 10))) + case "AUDIBILITY": + self.vm.strip[int(index)].audibility = util.check_bounds(val, (0, 10)) + self[f"STRIP {index}||SLIDER {param}"].update(value=util.check_bounds(val, (0, 10))) case "BASS" | "MID" | "TREBLE": 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))) @@ -827,7 +845,18 @@ class NVDAVMWindow(psg.Window): self[f"STRIP {index}||SLIDER {param}"].update(value=util.check_bounds(val, (-40, 12))) case [ ["STRIP", index], - ["SLIDER", "GAIN" | "COMP" | "GATE" | "DENOISER" | "AUDIBILITY" | "LIMIT" as param], + [ + "SLIDER", + "GAIN" + | "COMP" + | "GATE" + | "DENOISER" + | "AUDIBILITY" + | "LIMIT" + | "BASS" + | "MID" + | "TREBLE" as param, + ], ["KEY", "SHIFT", "LEFT" | "RIGHT" | "UP" | "DOWN" as direction], ]: match param: @@ -838,6 +867,8 @@ class NVDAVMWindow(psg.Window): val = target.knob case "AUDIBILITY": val = self.vm.strip[int(index)].audibility + case "BASS" | "MID" | "TREBLE": + val = getattr(self.vm.strip[int(index)], param.lower()) case "LIMIT": val = self.vm.strip[int(index)].limit @@ -863,6 +894,9 @@ class NVDAVMWindow(psg.Window): case "AUDIBILITY": self.vm.strip[int(index)].audibility = util.check_bounds(val, (0, 10)) self[f"STRIP {index}||SLIDER {param}"].update(value=util.check_bounds(val, (0, 10))) + case "BASS" | "MID" | "TREBLE": + 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))) 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)))