mirror of
https://github.com/onyx-and-iris/vban-cmd-python.git
synced 2026-04-18 13:03:31 +00:00
add gain,levels
implement gain, levels for strip/bus classes. add to readme
This commit is contained in:
@@ -71,8 +71,21 @@ class OutputBus(Channel):
|
||||
raise VMCMDErrors('label is a string parameter')
|
||||
self.setter('Label', val)
|
||||
|
||||
@property
|
||||
def gain(self):
|
||||
return self.public_packet.busgain[self.index]
|
||||
def fget():
|
||||
val = self.public_packet.busgain[self.index]
|
||||
if val < 10000:
|
||||
return -val
|
||||
elif val == ((1 << 16) - 1):
|
||||
return 0
|
||||
else:
|
||||
return ((1 << 16) - 1) - val
|
||||
return round((fget() * 0.01), 1)
|
||||
|
||||
@gain.setter
|
||||
def gain(self, val: float):
|
||||
self.setter('gain', val)
|
||||
|
||||
|
||||
class PhysicalOutputBus(OutputBus):
|
||||
@@ -96,11 +109,12 @@ class BusLevel(OutputBus):
|
||||
|
||||
def getter_level(self, mode=None):
|
||||
def fget(i, data):
|
||||
return data.outputlevels[i]
|
||||
val = data.outputlevels[i]
|
||||
return -val * 0.01
|
||||
|
||||
range_ = self.level_map[self.index]
|
||||
data = self.public_packet
|
||||
levels = tuple(fget(i, data) for i in range(*range_))
|
||||
levels = tuple(round(fget(i, data), 1) for i in range(*range_))
|
||||
return levels
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user