From cee18857433a3d5cc1d5b57a97872bbd7b6cf021 Mon Sep 17 00:00:00 2001 From: sbahling Date: Mon, 22 Oct 2018 18:49:07 +0200 Subject: Access console button state from another button Create lookup table of console buttons by button name, --- buttons.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'buttons.py') diff --git a/buttons.py b/buttons.py index f80afc1..b654b38 100644 --- a/buttons.py +++ b/buttons.py @@ -96,8 +96,9 @@ class StripSelButton(Button): strip = self.strip print('handle_strip_sel', strip) - if self.get('REC ENABLE', 0): - if strip.recenable: + recenable = self.console.buttons.get('REC ENABLE', None) + if recenable.pressed: + if strip.rec: osc.client.send_message('/strip/recenable', (strip.num, 0)) else: osc.client.send_message('/strip/recenable', (strip.num, 1)) @@ -246,3 +247,6 @@ class NudgeButton(Button): osc.client.send_message('/access_action', 'Common/nudge-next-backward') super().press() + + +NULLBUTTON = Button(None, None) -- cgit v1.2.3