improvements to consistency of displaying mod slot labels in the ui, some TODOs added

This commit is contained in:
Tristan Rowley
2020-03-14 23:56:41 +00:00
parent 8703118b46
commit 5532c0cf55
6 changed files with 23 additions and 12 deletions

View File

@@ -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 = {}

View File

@@ -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

View File

@@ -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,

View File

@@ -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"

View File

@@ -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"

View File

@@ -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)