mute prop moved into meta

patch bump
This commit is contained in:
onyx-and-iris 2022-11-16 15:51:26 +00:00
parent a09b07e1c2
commit ac382c4c32
7 changed files with 27 additions and 53 deletions

View File

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "xair-api" name = "xair-api"
version = "2.2.1" version = "2.2.2"
description = "Remote control Behringer X-Air | Midas MR mixers through OSC" description = "Remote control Behringer X-Air | Midas MR mixers through OSC"
authors = ["onyx-and-iris <code@onyxandiris.online>"] authors = ["onyx-and-iris <code@onyxandiris.online>"]
license = "MIT" license = "MIT"

View File

@ -1,6 +1,7 @@
import abc import abc
from .errors import XAirRemoteError from .errors import XAirRemoteError
from .meta import mute_prop
from .shared import EQ, GEQ, Automix, Config, Dyn, Gate, Group, Insert, Mix, Preamp from .shared import EQ, GEQ, Automix, Config, Dyn, Gate, Group, Insert, Mix, Preamp
@ -52,7 +53,8 @@ class Bus(IBus):
Mix, Mix,
Group, Group,
) )
} },
"mute": mute_prop(),
}, },
) )
return BUS_cls(remote, index) return BUS_cls(remote, index)
@ -60,11 +62,3 @@ class Bus(IBus):
@property @property
def address(self) -> str: def address(self) -> str:
return f"/bus/{self.index}" 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

View File

@ -1,6 +1,7 @@
import abc import abc
from .errors import XAirRemoteError from .errors import XAirRemoteError
from .meta import mute_prop
from .shared import EQ, GEQ, Automix, Config, Dyn, Gate, Group, Insert, Mix, Preamp 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), {} f"{_cls.__name__}{remote.kind}", (_cls, cls), {}
)(remote, index) )(remote, index)
for _cls in (Config, Mix, Group) for _cls in (Config, Mix, Group)
} },
"mute": mute_prop(),
}, },
) )
return FXSEND_cls(remote, index) return FXSEND_cls(remote, index)
@ -68,11 +70,3 @@ class FXSend(IFX):
@property @property
def address(self) -> str: def address(self) -> str:
return f"/fxsend/{self.index}" 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

View File

@ -2,6 +2,7 @@ import abc
from typing import Optional from typing import Optional
from .errors import XAirRemoteError from .errors import XAirRemoteError
from .meta import mute_prop
from .shared import EQ, GEQ, Automix, Config, Dyn, Gate, Group, Insert, Mix, Preamp from .shared import EQ, GEQ, Automix, Config, Dyn, Gate, Group, Insert, Mix, Preamp
@ -54,6 +55,7 @@ class LR(ILR):
Mix, Mix,
) )
}, },
"mute": mute_prop(),
}, },
) )
return LR_cls(remote, index) return LR_cls(remote, index)
@ -61,11 +63,3 @@ class LR(ILR):
@property @property
def address(self) -> str: def address(self) -> str:
return f"/lr" 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

View File

@ -69,3 +69,13 @@ def geq_prop(param):
self.setter(param, lin_set(-15, 15, val)) self.setter(param, lin_set(-15, 15, val))
return property(fget, fset) 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)

View File

@ -2,6 +2,7 @@ import abc
from typing import Optional from typing import Optional
from .errors import XAirRemoteError from .errors import XAirRemoteError
from .meta import mute_prop
from .shared import EQ, GEQ, Automix, Config, Dyn, Gate, Group, Insert, Mix, Preamp from .shared import EQ, GEQ, Automix, Config, Dyn, Gate, Group, Insert, Mix, Preamp
@ -50,7 +51,8 @@ class AuxRtn(IRtn):
Mix, Mix,
Group, Group,
) )
} },
"mute": mute_prop(),
}, },
) )
return AUXRTN_cls(remote, index) return AUXRTN_cls(remote, index)
@ -59,14 +61,6 @@ class AuxRtn(IRtn):
def address(self): def address(self):
return "/rtn/aux" 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): class FxRtn(IRtn):
"""Concrete class for rtn""" """Concrete class for rtn"""
@ -93,7 +87,8 @@ class FxRtn(IRtn):
Mix, Mix,
Group, Group,
) )
} },
"mute": mute_prop(),
}, },
) )
return FXRTN_cls(remote, index) return FXRTN_cls(remote, index)
@ -101,11 +96,3 @@ class FxRtn(IRtn):
@property @property
def address(self): def address(self):
return f"/rtn/{self.index}" 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

View File

@ -1,6 +1,7 @@
import abc import abc
from .errors import XAirRemoteError from .errors import XAirRemoteError
from .meta import mute_prop
from .shared import EQ, GEQ, Automix, Config, Dyn, Gate, Group, Insert, Mix, Preamp 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. Returns a Strip class of a kind.
""" """
STRIP_cls = type( STRIP_cls = type(
f"Strip{remote.kind}", f"Strip{remote.kind}",
(cls,), (cls,),
@ -55,6 +57,7 @@ class Strip(IStrip):
Automix, Automix,
) )
}, },
"mute": mute_prop(),
}, },
) )
return STRIP_cls(remote, index) return STRIP_cls(remote, index)
@ -62,11 +65,3 @@ class Strip(IStrip):
@property @property
def address(self) -> str: def address(self) -> str:
return f"/ch/{str(self.index).zfill(2)}" 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