From e9e1efefc87ce4dd942fa7c83794a7b27ec3a13c Mon Sep 17 00:00:00 2001 From: sbahling Date: Sat, 3 Nov 2018 01:09:07 +0100 Subject: Serve as base OSC server for the Tascam Console Unit We remove the Ardour specific OSC mapping and create our own OSC API that will be consumed by OSC translators that communicate to specific applications. We only send the state of each control and set the state of each fader or led based on received commands. Logic for interpreting the control state will be moved to the OSC translator code. --- tascam_fw_console/osc.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'tascam_fw_console/osc.py') diff --git a/tascam_fw_console/osc.py b/tascam_fw_console/osc.py index 2892168..46f6fc1 100644 --- a/tascam_fw_console/osc.py +++ b/tascam_fw_console/osc.py @@ -29,6 +29,19 @@ server = None dispatcher = dispatcher.Dispatcher() +class OSCClient(udp_client.SimpleUDPClient): + def __init__(self, ip, port): + super().__init__(ip, port) + + def send_message(self, addr, args): + try: + print(addr, *args) + except Exception: + print(addr, args) + + super().send_message(addr, args) + + def init_dispatcher(console): dispatcher.map("/loop_toggle", console.loop_toggle_handler) dispatcher.map("/transport_stop", console.transport_stop_handler) @@ -53,7 +66,7 @@ def init_dispatcher(console): def init_client(ip, port): global client - client = udp_client.SimpleUDPClient(ip, port) + client = OSCClient(ip, port) def init_server(ip, port, console): -- cgit v1.2.3