From 11c7c886a65ad1f0d6a3c5b9807a695611b7e52e Mon Sep 17 00:00:00 2001 From: Tristan Rowley Date: Sat, 7 Mar 2020 22:34:21 +0000 Subject: [PATCH] allow display modes to fallback to other display modes before default --- data_centre/data.py | 2 +- plugins/ShaderQuickPresetPlugin.py | 2 +- user_input/analog_input.py | 8 +++++++- user_input/midi_input.py | 8 +++++++- user_input/numpad_input.py | 8 +++++++- user_input/osc_input.py | 8 +++++++- 6 files changed, 30 insertions(+), 6 deletions(-) diff --git a/data_centre/data.py b/data_centre/data.py index 39a32d1..9dbee61 100644 --- a/data_centre/data.py +++ b/data_centre/data.py @@ -467,7 +467,7 @@ class Data(object): display_modes.append(["SHADERS",'NAV_SHADERS']) if self.settings['shader']['USE_SHADER_BANK']['value'] == 'enabled' and ["SHADERS",'NAV_SHADERS'] in display_modes: display_modes.append(["SHDR_BNK",'PLAY_SHADER']) - display_modes.append(["MOD_BNK","NAV_SHADERS"]) + display_modes.append(["MOD_BNK",["NAV_MOD","PLAY_SHADER"]]) ## allow override, but fall back to PLAY_SHADER controls if self.settings['detour']['TRY_DEMO']['value'] == 'enabled': display_modes.append(["FRAMES",'NAV_DETOUR']) if self.settings['system'].setdefault('USE_PLUGINS', diff --git a/plugins/ShaderQuickPresetPlugin.py b/plugins/ShaderQuickPresetPlugin.py index a189fc8..154bfa3 100644 --- a/plugins/ShaderQuickPresetPlugin.py +++ b/plugins/ShaderQuickPresetPlugin.py @@ -42,7 +42,7 @@ class ShaderQuickPresetPlugin(ActionsPlugin,DisplayPlugin): #,SequencePlugin): # DisplayPlugin methods def get_display_modes(self): - return ['QUIKSHDR','NAV_QKSH'] + return ['QUIKSHDR',['NAV_QKSH','PLAY_SHADER']] def show_plugin(self, display, display_mode): from tkinter import Text, END diff --git a/user_input/analog_input.py b/user_input/analog_input.py index 9507a48..64209cd 100644 --- a/user_input/analog_input.py +++ b/user_input/analog_input.py @@ -52,7 +52,13 @@ class AnalogInput(object): def run_action_for_mapped_channel(self, channel, channel_value): this_mapping = self.analog_mappings[str(channel)] - if self.data.control_mode in this_mapping: + if type(self.data.control_mode) is list: + mode = 'DEFAULT' + for cm in self.data.control_mode: + if cm in this_mapping: + mode = cm + break + elif self.data.control_mode in this_mapping: mode = self.data.control_mode elif 'DEFAULT' in this_mapping: mode = 'DEFAULT' diff --git a/user_input/midi_input.py b/user_input/midi_input.py index 6bcb338..a3c4d7b 100644 --- a/user_input/midi_input.py +++ b/user_input/midi_input.py @@ -116,7 +116,13 @@ class MidiInput(object): def run_action_for_mapped_message(self, message_name, mapped_message_value): this_mapping = self.midi_mappings[message_name] - if self.data.control_mode in this_mapping: + if type(self.data.control_mode) is list: + mode = 'DEFAULT' + for cm in self.data.control_mode: + if cm in this_mapping: + mode = cm + break + elif self.data.control_mode in this_mapping: mode = self.data.control_mode elif 'DEFAULT' in this_mapping: mode = 'DEFAULT' diff --git a/user_input/numpad_input.py b/user_input/numpad_input.py index db17e30..634de81 100644 --- a/user_input/numpad_input.py +++ b/user_input/numpad_input.py @@ -58,7 +58,13 @@ class NumpadInput(object): def run_action_for_mapped_key(self, key, value=-1): this_mapping = self.key_mappings[key] - if self.data.control_mode in this_mapping: + if type(self.data.control_mode) is list: + mode = 'DEFAULT' + for cm in self.data.control_mode: + if cm in this_mapping: + mode = cm + break + elif self.data.control_mode in this_mapping: mode = self.data.control_mode elif 'DEFAULT' in this_mapping: mode = 'DEFAULT' diff --git a/user_input/osc_input.py b/user_input/osc_input.py index 82441ef..6338a30 100644 --- a/user_input/osc_input.py +++ b/user_input/osc_input.py @@ -86,7 +86,13 @@ class OscInput(object): def run_action_for_osc_channel(self, channel, param_value=None): this_mapping = self.osc_mappings[channel] - if self.data.control_mode in this_mapping: + if type(self.data.control_mode) is list: + mode = 'DEFAULT' + for cm in self.data.control_mode: + if cm in this_mapping: + mode = cm + break + elif self.data.control_mode in this_mapping: mode = self.data.control_mode elif 'DEFAULT' in this_mapping: mode = 'DEFAULT'