diff options
| author | sbahling <sbahling@mudgum.net> | 2018-10-26 14:23:08 +0200 |
|---|---|---|
| committer | sbahling <sbahling@mudgum.net> | 2018-10-26 14:23:08 +0200 |
| commit | 1d1b23e5154e093a3e3e3e40b05946ab06c9738c (patch) | |
| tree | a57773bf632c21cecc6427619ec23fd8c88d8b5d /faders.py | |
| parent | 38c4e8310ef6bde30d3628ee93103c631caed47b (diff) | |
| download | tascam-fw-osc-1d1b23e5154e093a3e3e3e40b05946ab06c9738c.tar.gz tascam-fw-osc-1d1b23e5154e093a3e3e3e40b05946ab06c9738c.tar.xz tascam-fw-osc-1d1b23e5154e093a3e3e3e40b05946ab06c9738c.zip | |
Create initial package setup with setuptools
Diffstat (limited to 'faders.py')
| -rw-r--r-- | faders.py | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/faders.py b/faders.py deleted file mode 100644 index 6d57b33..0000000 --- a/faders.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python3 -""" - Open Sound Control send/recieve daemon for Tascam Firewire control surface - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - :copyright: Copyright (c) 2018 Scott Bahling - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program (see the file COPYING); if not, write to the - Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - :license: GPL-2.0, see COPYING for details -""" - -from buttons import Button -import osc - -status_quadlets = (4, 0, 0, 1, 1, 2, 2, 3, 3) -status_bits = ((1, 16), - (1, 16), - (17, 32), - (1, 16), - (17, 32), - (1, 16), - (17, 32), - (1, 16), - (17, 32), - ) - - -class Fader(Button): - def __init__(self, console, strip): - name = 'Strip {} Fader'. format(strip.num) - super().__init__(console, name) - self.strip = strip - self.addr = '/strip/fader' - self.status_quadlet = status_quadlets[self.strip.num] - self.status_bits = status_bits[self.strip.num] - self.status_callback = self.send_pos - - @property - def position(self): - return self.console.status.field(self.status_quadlet, self.status_bits) - - @position.setter - def position(self, pos): - self.console.unit.strips[self.strip.num].fader.set_position(pos) - - def send_pos(self, pos): - print('{}, ({}, {})'.format(self.addr, self.strip.num, pos/1023)) - osc.client.send_message(self.addr, (self.strip.num, pos/1023)) - - def press(self): - self.console.status_thread.add_callback(self) - super().press() - - def release(self): - self.console.status_thread.remove_callback(self) - super().press() |
