From 5532c0cf55ae66c42753c1181b4b25a7873db963 Mon Sep 17 00:00:00 2001 From: Tristan Rowley Date: Sat, 14 Mar 2020 23:56:41 +0000 Subject: [PATCH] improvements to consistency of displaying mod slot labels in the ui, some TODOs added --- data_centre/plugin_collection.py | 4 ++-- display_centre/display.py | 6 ++++++ plugins/LFOModulationPlugin.py | 12 ++++++++++-- plugins/SoundReactPlugin.py | 2 +- plugins/WJSendPlugin.py | 2 +- plugins/frame_manager.py | 9 +++------ 6 files changed, 23 insertions(+), 12 deletions(-) diff --git a/data_centre/plugin_collection.py b/data_centre/plugin_collection.py index de454d8..82d6f47 100644 --- a/data_centre/plugin_collection.py +++ b/data_centre/plugin_collection.py @@ -290,7 +290,7 @@ class AutomationSourcePlugin(Plugin): # else, # store as last value - print("WJSEND got pre-interpolated clip: %s" % [ f.f for f in frames if f is not None]) + print("AutomationSourcePlugin[%s] got pre-interpolated clip: %s" % ( type(self), [ f.f for f in frames if f is not None]) ) #last = [ [None]*4, [None]*4, [None]*4 ] last = {} @@ -362,7 +362,7 @@ class AutomationSourcePlugin(Plugin): process(self,findex,frame) - print("\nWJSEND got interpolated clip: %s" % [ f.f for f in frames if f is not None ]) + print("\nAutomationSourcePlugin got interpolated clip: %s" % [ f.f for f in frames if f is not None ]) self.distance_cache = {} diff --git a/display_centre/display.py b/display_centre/display.py index d6d6991..9059ae5 100644 --- a/display_centre/display.py +++ b/display_centre/display.py @@ -479,6 +479,12 @@ class Display(object): g = '%s'%bar[int(value*(len(bar)-1))] return g + def get_mod_slot_label(self, slot): + sl = 'ABCD'[slot] + if slot != self.shaders.selected_modulation_slot: + sl = sl.lower() + return sl + def get_speed_indicator(self, value, convert = True): if convert: value = (value * 2.0) - 1.0 # convert 0 to 1 to -1 to +1 diff --git a/plugins/LFOModulationPlugin.py b/plugins/LFOModulationPlugin.py index 10f2aee..4210583 100644 --- a/plugins/LFOModulationPlugin.py +++ b/plugins/LFOModulationPlugin.py @@ -13,9 +13,14 @@ class LFOModulationPlugin(ActionsPlugin,SequencePlugin,DisplayPlugin, Automation active = False # for keeping track of LFO levels - level = [0.0]*MAX_LFOS #, 0.0, 0.0, 0.0] + level = [0.0]*MAX_LFOS speed = 0.5 + # TODO: enable assigning of LFOs to mod slots + # with combination/averaging... + # needs UI to control it and [ [ 0.0 ] * 4 ] * 4 to handle the mappings? + # currently each LFO maps directly to mod slot + stop_flag = False pause_flag = False def __init__(self, plugin_collection): @@ -63,7 +68,9 @@ class LFOModulationPlugin(ActionsPlugin,SequencePlugin,DisplayPlugin, Automation for lfo,value in enumerate(self.level): display.display_text.insert(END, "lfo {} level: {:4.2f}% {}\t".format(lfo,value*100,display.get_bar(value))) display.display_text.insert(END, "{}\t{}\n".format(self.last_lfo_status[lfo], display.get_bar(self.last_lfo_value[lfo]))) - display.display_text.insert(END, "\t%s\n" % self.formula[lfo]) + display.display_text.insert(END, "\tslot %s\t%s\n" % (display.get_mod_slot_label(lfo), self.formula[lfo])) + + display.display_text.insert(END, "\n") # AutomationSourcePlugin methods # methods/vars for AutomationSourcePlugin @@ -178,6 +185,7 @@ class LFOModulationPlugin(ActionsPlugin,SequencePlugin,DisplayPlugin, Automation return for lfo in range(0,self.MAX_LFOS): + # TODO: this is where would use assignable amounts and average across multiple inputs if self.level[lfo]>0.0: self.pc.actions.call_method_name( "modulate_param_%s_to_amount_continuous"%lfo, diff --git a/plugins/SoundReactPlugin.py b/plugins/SoundReactPlugin.py index c9ec03a..f587c75 100644 --- a/plugins/SoundReactPlugin.py +++ b/plugins/SoundReactPlugin.py @@ -116,7 +116,7 @@ class SoundReactPlugin(ActionsPlugin,SequencePlugin,DisplayPlugin): for sourcename in sorted(self.sources): value = "{:8}:\t".format(sourcename) for i,level in enumerate(self.levels[sourcename]): - g = "ABCD"[i]+'%s '%self.pc.display.get_bar(level) + g = self.pc.display.get_mod_slot_label(i)+'%s '%self.pc.display.get_bar(level) value += g value += "\t" value += self.display_values.get(sourcename) or "{:4.2f}%".format(self.values.get(sourcename,0)*100) or "None" diff --git a/plugins/WJSendPlugin.py b/plugins/WJSendPlugin.py index b4be578..5e60e8b 100644 --- a/plugins/WJSendPlugin.py +++ b/plugins/WJSendPlugin.py @@ -153,7 +153,7 @@ class WJSendPlugin(ActionsPlugin, SequencePlugin, DisplayPlugin, ModulationRecei #if arg_name in mods: v = mods.get(arg_name,0.0) g = '%s'%self.pc.display.get_bar(v) - output += "{}:{}|".format('ABCD'[slot],g) + output += "{}:{}|".format(self.pc.display.get_mod_slot_label(slot),g) if is_selected: output+="]" output += "\n" diff --git a/plugins/frame_manager.py b/plugins/frame_manager.py index 2a45921..f682138 100644 --- a/plugins/frame_manager.py +++ b/plugins/frame_manager.py @@ -87,15 +87,13 @@ class Frame: if type(d) is dict and len(d)==0: # skip empty dicts continue if key in ["selected_shader","layer_active_status","shader_params","shader_speeds","selected_shader_slots"]: - # skip these as dealt with above + # skip these as dealt with below pass elif key in ['shader_modulation_levels']: for layer in range(3): o = "" for slot in range(4): - sl = 'ABCD'[slot] - if slot != self.pc.shaders.selected_modulation_slot: - sl = sl.lower() + sl = self.pc.display.get_mod_slot_label(slot) o+= sl + "[" for param in range(4): o += self.pc.display.get_bar(d[layer][param][slot]) @@ -104,8 +102,7 @@ class Frame: elif self.pc.get_plugin_for_class_name(key) is not None: summary.append(self.pc.get_plugin_for_class_name(key).get_frame_summary(d)) """elif key in ["WJSendPlugin"]: - # tends to be heavy so save it for later - # TODO: ask plugin to format the data for summary? + # for things that tend to be heavy so dont show not_shown[key] = d""" else: line += "%s: %s" % (key, d)