mirror of
https://github.com/onyx-and-iris/vban-cmd-python.git
synced 2025-01-18 18:40:47 +00:00
fix bug where getter may return None
This commit is contained in:
parent
f8b964bc35
commit
637fe9fb88
@ -47,10 +47,10 @@ class OutputBus(Channel):
|
|||||||
else:
|
else:
|
||||||
return ((1 << 16) - 1) - val
|
return ((1 << 16) - 1) - val
|
||||||
|
|
||||||
val = round(self.getter("gain"), 1)
|
val = self.getter("gain")
|
||||||
if val is None:
|
if val is None:
|
||||||
val = round((fget() * 0.01), 1)
|
val = fget() * 0.01
|
||||||
return val
|
return round(val, 1)
|
||||||
|
|
||||||
@gain.setter
|
@gain.setter
|
||||||
def gain(self, val: float):
|
def gain(self, val: float):
|
||||||
|
@ -45,10 +45,10 @@ class InputStrip(Channel):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def gain(self) -> float:
|
def gain(self) -> float:
|
||||||
val = round(self.getter("gain"), 1)
|
val = self.getter("gain")
|
||||||
if val is None:
|
if val is None:
|
||||||
val = self.gainlayer[0].gain
|
val = self.gainlayer[0].gain
|
||||||
return val
|
return round(val, 1)
|
||||||
|
|
||||||
@gain.setter
|
@gain.setter
|
||||||
def gain(self, val: float):
|
def gain(self, val: float):
|
||||||
@ -139,10 +139,10 @@ class GainLayer(InputStrip):
|
|||||||
else:
|
else:
|
||||||
return ((1 << 16) - 1) - val
|
return ((1 << 16) - 1) - val
|
||||||
|
|
||||||
val = round(self.getter(f"GainLayer[{self._i}]"), 1)
|
val = self.getter(f"GainLayer[{self._i}]")
|
||||||
if val is None:
|
if val is None:
|
||||||
val = round((fget() * 0.01), 1)
|
val = fget() * 0.01
|
||||||
return val
|
return round(val, 1)
|
||||||
|
|
||||||
@gain.setter
|
@gain.setter
|
||||||
def gain(self, val: float):
|
def gain(self, val: float):
|
||||||
|
Loading…
Reference in New Issue
Block a user