vban-cmd-python/__main__.py

52 lines
1.2 KiB
Python
Raw Normal View History

import vban_cmd
2022-02-25 14:37:23 +00:00
2022-03-04 14:30:51 +00:00
class ManyThings:
def __init__(self, vban):
self.vban = vban
def things(self):
self.vban.strip[0].label = "podmic"
self.vban.strip[0].mute = True
print(
2022-08-06 10:51:35 +01:00
f"strip 0 ({self.vban.strip[0].label}) mute has been set to {self.vban.strip[0].mute}"
)
2022-03-04 14:30:51 +00:00
def other_things(self):
info = (
f"bus 3 gain has been set to {self.vban.bus[3].gain}",
f"bus 4 eq has been set to {self.vban.bus[4].eq}",
)
self.vban.bus[3].gain = -6.3
self.vban.bus[4].eq = True
print("\n".join(info))
2022-02-25 14:37:23 +00:00
2022-03-04 14:30:51 +00:00
def main():
with vban_cmd.api(kind_id, **opts) as vban:
2022-03-04 14:30:51 +00:00
do = ManyThings(vban)
do.things()
do.other_things()
# set many parameters at once
vban.apply(
{
"strip-2": {"A1": True, "B1": True, "gain": -6.0},
"bus-2": {"mute": True},
"button-0": {"state": True},
"vban-in-0": {"on": True},
"vban-out-1": {"name": "streamname"},
}
)
if __name__ == "__main__":
kind_id = "banana"
opts = {
"ip": "<ip address>",
"streamname": "Command1",
"port": 6980,
}
2022-02-25 15:17:05 +00:00
main()