summaryrefslogtreecommitdiff
path: root/tascam_fw_console/encoder.py
diff options
context:
space:
mode:
authorsbahling <sbahling@mudgum.net>2018-11-03 01:09:07 +0100
committersbahling <sbahling@mudgum.net>2018-11-03 01:09:07 +0100
commite9e1efefc87ce4dd942fa7c83794a7b27ec3a13c (patch)
tree00ded9a9e5b5460b8173505795ccc7568fc0ba2d /tascam_fw_console/encoder.py
parent7d490031c54458644eb459dbb390b10ea8de3334 (diff)
downloadtascam-fw-osc-e9e1efefc87ce4dd942fa7c83794a7b27ec3a13c.tar.gz
tascam-fw-osc-e9e1efefc87ce4dd942fa7c83794a7b27ec3a13c.tar.xz
tascam-fw-osc-e9e1efefc87ce4dd942fa7c83794a7b27ec3a13c.zip
Serve as base OSC server for the Tascam Console Unittascam_fw_console-0.2
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.
Diffstat (limited to 'tascam_fw_console/encoder.py')
-rw-r--r--tascam_fw_console/encoder.py25
1 files changed, 10 insertions, 15 deletions
diff --git a/tascam_fw_console/encoder.py b/tascam_fw_console/encoder.py
index 211fef1..ae82234 100644
--- a/tascam_fw_console/encoder.py
+++ b/tascam_fw_console/encoder.py
@@ -20,22 +20,17 @@
:license: GPL-2.0, see COPYING for details
"""
+from tascam_fw_console import osc
+
class Encoder():
- def __init__(self):
- self.name = 'Unknown'
- self.update_callbacks = set()
+ def __init__(self, name, addr, strip=None):
+ self.name = name
+ self.addr = addr
+ self.strip = strip
def update(self, delta):
- print('Encoder: ', self.name, delta)
- for callback in self.update_callbacks:
- try:
- callback(delta)
- except Exception('Encoder update callback failed') as e:
- raise(e)
-
- def add_callback(self, callback):
- self.update_callbacks.add(callback)
-
- def remove_callback(self, callback):
- self.update_callbacks.remove(callback)
+ if self.strip:
+ osc.client.send_message(self.addr, (self.strip, delta))
+ else:
+ osc.client.send_message(self.addr, delta)