From ac382c4c32ac14ab0fe3ffbe87637f5e2f2b4446 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Wed, 16 Nov 2022 15:51:26 +0000 Subject: [PATCH] mute prop moved into meta patch bump --- pyproject.toml | 2 +- xair_api/bus.py | 12 +++--------- xair_api/fx.py | 12 +++--------- xair_api/lr.py | 10 ++-------- xair_api/meta.py | 10 ++++++++++ xair_api/rtn.py | 23 +++++------------------ xair_api/strip.py | 11 +++-------- 7 files changed, 27 insertions(+), 53 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3a9e152..9dd3b1e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "xair-api" -version = "2.2.1" +version = "2.2.2" description = "Remote control Behringer X-Air | Midas MR mixers through OSC" authors = ["onyx-and-iris "] license = "MIT" diff --git a/xair_api/bus.py b/xair_api/bus.py index cba558d..1df3ace 100644 --- a/xair_api/bus.py +++ b/xair_api/bus.py @@ -1,6 +1,7 @@ import abc from .errors import XAirRemoteError +from .meta import mute_prop from .shared import EQ, GEQ, Automix, Config, Dyn, Gate, Group, Insert, Mix, Preamp @@ -52,7 +53,8 @@ class Bus(IBus): Mix, Group, ) - } + }, + "mute": mute_prop(), }, ) return BUS_cls(remote, index) @@ -60,11 +62,3 @@ class Bus(IBus): @property def address(self) -> str: return f"/bus/{self.index}" - - @property - def mute(self) -> bool: - return not self.mix.on - - @mute.setter - def mute(self, val: bool): - self.mix.on = not val diff --git a/xair_api/fx.py b/xair_api/fx.py index 9271f0b..c8450af 100644 --- a/xair_api/fx.py +++ b/xair_api/fx.py @@ -1,6 +1,7 @@ import abc from .errors import XAirRemoteError +from .meta import mute_prop from .shared import EQ, GEQ, Automix, Config, Dyn, Gate, Group, Insert, Mix, Preamp @@ -60,7 +61,8 @@ class FXSend(IFX): f"{_cls.__name__}{remote.kind}", (_cls, cls), {} )(remote, index) for _cls in (Config, Mix, Group) - } + }, + "mute": mute_prop(), }, ) return FXSEND_cls(remote, index) @@ -68,11 +70,3 @@ class FXSend(IFX): @property def address(self) -> str: return f"/fxsend/{self.index}" - - @property - def mute(self) -> bool: - return not self.mix.on - - @mute.setter - def mute(self, val: bool): - self.mix.on = not val diff --git a/xair_api/lr.py b/xair_api/lr.py index 69d299f..85236b4 100644 --- a/xair_api/lr.py +++ b/xair_api/lr.py @@ -2,6 +2,7 @@ import abc from typing import Optional from .errors import XAirRemoteError +from .meta import mute_prop from .shared import EQ, GEQ, Automix, Config, Dyn, Gate, Group, Insert, Mix, Preamp @@ -54,6 +55,7 @@ class LR(ILR): Mix, ) }, + "mute": mute_prop(), }, ) return LR_cls(remote, index) @@ -61,11 +63,3 @@ class LR(ILR): @property def address(self) -> str: return f"/lr" - - @property - def mute(self) -> bool: - return not self.mix.on - - @mute.setter - def mute(self, val: bool): - self.mix.on = not val diff --git a/xair_api/meta.py b/xair_api/meta.py index 6013ef0..98c512e 100644 --- a/xair_api/meta.py +++ b/xair_api/meta.py @@ -69,3 +69,13 @@ def geq_prop(param): self.setter(param, lin_set(-15, 15, val)) return property(fget, fset) + + +def mute_prop(): + def fget(self): + return not self.mix.on + + def fset(self, val): + self.mix.on = not val + + return property(fget, fset) diff --git a/xair_api/rtn.py b/xair_api/rtn.py index 60c2273..47a3c88 100644 --- a/xair_api/rtn.py +++ b/xair_api/rtn.py @@ -2,6 +2,7 @@ import abc from typing import Optional from .errors import XAirRemoteError +from .meta import mute_prop from .shared import EQ, GEQ, Automix, Config, Dyn, Gate, Group, Insert, Mix, Preamp @@ -50,7 +51,8 @@ class AuxRtn(IRtn): Mix, Group, ) - } + }, + "mute": mute_prop(), }, ) return AUXRTN_cls(remote, index) @@ -59,14 +61,6 @@ class AuxRtn(IRtn): def address(self): return "/rtn/aux" - @property - def mute(self) -> bool: - return not self.mix.on - - @mute.setter - def mute(self, val: bool): - self.mix.on = not val - class FxRtn(IRtn): """Concrete class for rtn""" @@ -93,7 +87,8 @@ class FxRtn(IRtn): Mix, Group, ) - } + }, + "mute": mute_prop(), }, ) return FXRTN_cls(remote, index) @@ -101,11 +96,3 @@ class FxRtn(IRtn): @property def address(self): return f"/rtn/{self.index}" - - @property - def mute(self) -> bool: - return not self.mix.on - - @mute.setter - def mute(self, val: bool): - self.mix.on = not val diff --git a/xair_api/strip.py b/xair_api/strip.py index 04bb0a1..19800cf 100644 --- a/xair_api/strip.py +++ b/xair_api/strip.py @@ -1,6 +1,7 @@ import abc from .errors import XAirRemoteError +from .meta import mute_prop from .shared import EQ, GEQ, Automix, Config, Dyn, Gate, Group, Insert, Mix, Preamp @@ -35,6 +36,7 @@ class Strip(IStrip): Returns a Strip class of a kind. """ + STRIP_cls = type( f"Strip{remote.kind}", (cls,), @@ -55,6 +57,7 @@ class Strip(IStrip): Automix, ) }, + "mute": mute_prop(), }, ) return STRIP_cls(remote, index) @@ -62,11 +65,3 @@ class Strip(IStrip): @property def address(self) -> str: return f"/ch/{str(self.index).zfill(2)}" - - @property - def mute(self) -> bool: - return not self.mix.on - - @mute.setter - def mute(self, val: bool): - self.mix.on = not val