StripComp, StripGate, StripDenoiser, StripDevice

added to PhysicalStrip
This commit is contained in:
onyx-and-iris 2023-06-25 01:48:07 +01:00
parent d5219d66f7
commit 5f4fdcb0eb

View File

@ -51,25 +51,22 @@ class Strip(IRemote):
class PhysicalStrip(Strip): class PhysicalStrip(Strip):
@classmethod
def make(cls, remote, index):
return type(
f"PhysicalStrip{remote.kind}",
(cls,),
{
"comp": StripComp(remote, index),
"gate": StripGate(remote, index),
"denoiser": StripDenoiser(remote, index),
"eq": StripEQ(remote, index),
},
)
def __str__(self): def __str__(self):
return f"{type(self).__name__}{self.index}" return f"{type(self).__name__}{self.index}"
@property
def comp(self) -> float:
return
@comp.setter
def comp(self, val: float):
self.setter("Comp", val)
@property
def gate(self) -> float:
return
@gate.setter
def gate(self, val: float):
self.setter("gate", val)
@property @property
def device(self): def device(self):
return return
@ -79,6 +76,70 @@ class PhysicalStrip(Strip):
return return
class StripComp(IRemote):
@property
def identifier(self) -> str:
return f"Strip[{self.index}].comp"
@property
def knob(self) -> float:
return
@knob.setter
def knob(self, val: float):
self.setter("", val)
class StripGate(IRemote):
@property
def identifier(self) -> str:
return f"Strip[{self.index}].gate"
@property
def knob(self) -> float:
return
@knob.setter
def knob(self, val: float):
self.setter("", val)
class StripDenoiser(IRemote):
@property
def identifier(self) -> str:
return f"Strip[{self.index}].denoiser"
@property
def knob(self) -> float:
return
@knob.setter
def knob(self, val: float):
self.setter("", val)
class StripEQ(IRemote):
@property
def identifier(self) -> str:
return f"Strip[{self.index}].eq"
@property
def on(self):
return
@on.setter
def on(self, val: bool):
self.setter("on", 1 if val else 0)
@property
def ab(self):
return
@ab.setter
def ab(self, val: bool):
self.setter("ab", 1 if val else 0)
class VirtualStrip(Strip): class VirtualStrip(Strip):
def __str__(self): def __str__(self):
return f"{type(self).__name__}{self.index}" return f"{type(self).__name__}{self.index}"
@ -232,7 +293,7 @@ def strip_factory(is_phys_strip, remote, i) -> Union[PhysicalStrip, VirtualStrip
Returns a physical or virtual strip subclass Returns a physical or virtual strip subclass
""" """
STRIP_cls = PhysicalStrip if is_phys_strip else VirtualStrip STRIP_cls = PhysicalStrip.make(remote, i) if is_phys_strip else VirtualStrip
CHANNELOUTMIXIN_cls = _make_channelout_mixins[remote.kind.name] CHANNELOUTMIXIN_cls = _make_channelout_mixins[remote.kind.name]
GAINLAYERMIXIN_cls = _make_gainlayer_mixin(remote, i) GAINLAYERMIXIN_cls = _make_gainlayer_mixin(remote, i)