mirror of
https://github.com/onyx-and-iris/voicemeeter-api-python.git
synced 2025-06-27 14:50:23 +01:00
pass channel + cell indices to each class
update identifier properties to reflect changes.
This commit is contained in:
parent
c797912458
commit
714d2fc972
@ -101,8 +101,7 @@ class BusEQ(IRemote):
|
|||||||
kls,
|
kls,
|
||||||
{
|
{
|
||||||
'channel': tuple(
|
'channel': tuple(
|
||||||
BusEQCh.make(remote, j)
|
BusEQCh.make(remote, i, j) for j in range(remote.kind.channels)
|
||||||
for j in range(remote.kind.channels)
|
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@ -127,9 +126,10 @@ class BusEQ(IRemote):
|
|||||||
def ab(self, val: bool):
|
def ab(self, val: bool):
|
||||||
self.setter('ab', 1 if val else 0)
|
self.setter('ab', 1 if val else 0)
|
||||||
|
|
||||||
|
|
||||||
class BusEQCh(IRemote):
|
class BusEQCh(IRemote):
|
||||||
@classmethod
|
@classmethod
|
||||||
def make(cls, remote, i):
|
def make(cls, remote, i, j):
|
||||||
"""
|
"""
|
||||||
Factory method for Bus EQ channel.
|
Factory method for Bus EQ channel.
|
||||||
|
|
||||||
@ -141,28 +141,36 @@ class BusEQCh(IRemote):
|
|||||||
kls,
|
kls,
|
||||||
{
|
{
|
||||||
'cell': tuple(
|
'cell': tuple(
|
||||||
BusEQChCell(remote, k)
|
BusEQChCell(remote, i, j, k) for k in range(remote.kind.cells)
|
||||||
for k in range(remote.kind.cells)
|
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def __init__(self, remote, i, j):
|
||||||
|
super().__init__(remote, i)
|
||||||
|
self.channel_index = j
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def identifier(self) -> str:
|
def identifier(self) -> str:
|
||||||
return f'channel[{self.index}]'
|
return f'Bus[{self.index}].eq.channel[{self.channel_index}]'
|
||||||
|
|
||||||
|
|
||||||
class BusEQChCell(IRemote):
|
class BusEQChCell(IRemote):
|
||||||
|
def __init__(self, remote, i, j, k):
|
||||||
|
super().__init__(remote, i)
|
||||||
|
self.channel_index = j
|
||||||
|
self.cell_index = k
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def identifier(self) -> str:
|
def identifier(self) -> str:
|
||||||
return f'cell[{self.index}]'
|
return f'Bus[{self.index}].eq.channel[{self.channel_index}].cell[{self.cell_index}]'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def on(self) -> bool:
|
def on(self) -> bool:
|
||||||
return self.getter('on') == 1
|
return self.getter('on') == 1
|
||||||
|
|
||||||
@on.setter
|
@on.setter
|
||||||
def on(self,val: bool):
|
def on(self, val: bool):
|
||||||
self.setter('on', 1 if val else 0)
|
self.setter('on', 1 if val else 0)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -175,28 +183,29 @@ class BusEQChCell(IRemote):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def f(self) -> float:
|
def f(self) -> float:
|
||||||
return round(self.getter('f'),1)
|
return round(self.getter('f'), 1)
|
||||||
|
|
||||||
@f.setter
|
@f.setter
|
||||||
def f(self,val: float):
|
def f(self, val: float):
|
||||||
self.setter('f', val)
|
self.setter('f', val)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def gain(self) -> float:
|
def gain(self) -> float:
|
||||||
return round(self.getter('gain'),1)
|
return round(self.getter('gain'), 1)
|
||||||
|
|
||||||
@gain.setter
|
@gain.setter
|
||||||
def gain(self,val: float):
|
def gain(self, val: float):
|
||||||
self.setter('gain', val)
|
self.setter('gain', val)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def q(self) -> float:
|
def q(self) -> float:
|
||||||
return round(self.getter('q'),1)
|
return round(self.getter('q'), 1)
|
||||||
|
|
||||||
@q.setter
|
@q.setter
|
||||||
def q(self,val: float):
|
def q(self, val: float):
|
||||||
self.setter('q', val)
|
self.setter('q', val)
|
||||||
|
|
||||||
|
|
||||||
class PhysicalBus(Bus):
|
class PhysicalBus(Bus):
|
||||||
@classmethod
|
@classmethod
|
||||||
def make(cls, remote, i, kind):
|
def make(cls, remote, i, kind):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user