upd decorator func names

This commit is contained in:
onyx-and-iris 2024-02-08 15:27:15 +00:00
parent a62a46d61a
commit f3cf215a76
3 changed files with 10 additions and 10 deletions

View File

@ -90,12 +90,12 @@ class Config(IConfig):
return f"{root}/solo"
@property
@util.from_db
@util.db_from
def level(self) -> float:
return self.getter("level")[0]
@level.setter
@util.to_db
@util.db_to
def level(self, val: float):
self.setter("level", val)

View File

@ -561,12 +561,12 @@ class Mix:
self.setter("on", 1 if val else 0)
@property
@util.from_db
@util.db_from
def fader(self) -> float:
return self.getter("fader")[0]
@fader.setter
@util.to_db
@util.db_to
def fader(self, val: float):
self.setter("fader", val)
@ -636,8 +636,8 @@ class Send:
@classmethod
def make(cls, _cls, remote, i, index=None):
STRIPSEND_cls = type("Send", (cls, _cls), {})
return STRIPSEND_cls(remote, i, index)
SEND_cls = type("Send", (cls, _cls), {})
return SEND_cls(remote, i, index)
@property
def address(self) -> str:
@ -645,11 +645,11 @@ class Send:
return f"{root}/mix/{str(self.i).zfill(2)}"
@property
@util.from_db
@util.db_from
def level(self):
return self.getter("level")[0]
@level.setter
@util.to_db
@util.db_to
def level(self, val):
self.setter("level", val)

View File

@ -18,7 +18,7 @@ def log_set(min, max, val):
return log(val / min) / log(max / min)
def from_db(func):
def db_from(func):
"""fader|level converter for getters"""
@functools.wraps(func)
@ -41,7 +41,7 @@ def from_db(func):
return wrapper
def to_db(func):
def db_to(func):
"""fader|level converter for setters"""
@functools.wraps(func)