From e0d83f91e766be6762194524672f02e89bc726f1 Mon Sep 17 00:00:00 2001 From: onyx-and-iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:30:51 +0000 Subject: [PATCH] Update __main__.py update main --- __main__.py | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/__main__.py b/__main__.py index db3fd8a..9d11065 100644 --- a/__main__.py +++ b/__main__.py @@ -1,20 +1,27 @@ -import vban_cmd +import vbancmd + +class ManyThings: + def __init__(self, vban): + self.vban = vban + + def things(self): + # Set the mapping of the second input strip + self.vban.strip[1].A3 = True + print(f'Output A3 of Strip {self.vban.strip[1].label}: {self.vban.strip[1].A3}') + + def other_things(self): + # Toggle mute for the leftmost output bus + self.vban.bus[0].mute = not self.vban.bus[0].mute + def main(): - with vban_cmd.connect('potato', ip=ip, port=port, streamname=streamname, bps=bps, channel=channel) as vban: - for param in ['A1', 'A2', 'A3', 'A4', 'A5', 'B1', 'B2', 'B3', 'mono', 'mute']: - setattr(vban.strip[0], param, True) - print(getattr(vban.strip[0], param)) - setattr(vban.strip[0], param, False) - print(getattr(vban.strip[0], param)) - + with vbancmd.connect(kind_id, ip=ip) as vban: + do = ManyThings(vban) + do.things() + do.other_things() if __name__ == '__main__': kind_id = 'potato' - ip = 'ws.local' - port=6980 - streamname = 'testing' - bps = 57600 - channel=3 + ip = '' main()