vban-cmd-python/vban_cmd/meta.py
onyx-and-iris 0f18116cd1 add gainlayers, levels, public_packet property object
add gainlayers, levels

_get_rt now private method.

public_packet now property object
2022-02-26 23:57:19 +00:00

13 lines
509 B
Python

from .errors import VMCMDErrors
def strip_output_prop(param):
""" A strip output prop. """
def fget(self):
data = self._remote.public_packet
return not int.from_bytes(data.stripstate[self.index], 'little') & getattr(self._modes, f'_bus{param.lower()}') == 0
def fset(self, val):
if not isinstance(val, bool) and val not in (0, 1):
raise VMCMDErrors(f'{param} is a boolean parameter')
self.setter(param, 1 if val else 0)
return property(fget, fset)