From 9f27968c5cd8031f8a49c0fa7a7f816895753bbd Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Fri, 23 Jun 2023 01:13:56 +0100 Subject: [PATCH] BUSEQ class added to Bus class --- voicemeeterlib/bus.py | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/voicemeeterlib/bus.py b/voicemeeterlib/bus.py index e1f84ed..44a7516 100644 --- a/voicemeeterlib/bus.py +++ b/voicemeeterlib/bus.py @@ -46,22 +46,6 @@ class Bus(IRemote): def mono(self, val: bool): self.setter("mono", 1 if val else 0) - @property - def eq(self) -> bool: - return self.getter("eq.On") == 1 - - @eq.setter - def eq(self, val: bool): - self.setter("eq.On", 1 if val else 0) - - @property - def eq_ab(self) -> bool: - return self.getter("eq.ab") == 1 - - @eq_ab.setter - def eq_ab(self, val: bool): - self.setter("eq.ab", 1 if val else 0) - @property def sel(self) -> bool: return self.getter("sel") == 1 @@ -103,6 +87,28 @@ class Bus(IRemote): time.sleep(self._remote.DELAY) +class BusEQ(IRemote): + @property + def identifier(self) -> str: + return f"Bus[{self.index}].eq" + + @property + def on(self) -> bool: + return self.getter("on") == 1 + + @on.setter + def on(self, val: bool): + self.setter("on", 1 if val else 0) + + @property + def ab(self) -> bool: + return self.getter("ab") == 1 + + @ab.setter + def ab(self, val: bool): + self.setter("ab", 1 if val else 0) + + class PhysicalBus(Bus): @classmethod def make(cls, remote, i, kind): @@ -309,6 +315,7 @@ def bus_factory(is_phys_bus, remote, i) -> Union[PhysicalBus, VirtualBus]: { "levels": BusLevel(remote, i), "mode": BUSMODEMIXIN_cls(remote, i), + "eq": BusEQ(remote, i), }, )(remote, i)