From 7161dd66565f77101a09546b754ea8b6d56971e1 Mon Sep 17 00:00:00 2001 From: Tristan Rowley Date: Sun, 2 Feb 2020 20:13:52 +0000 Subject: [PATCH] new! visual representation of the modulation parameter levels on the shader bank screen so you can see what levels are mapped to which parameters and which modulation slot is selected ("a b C d" for 'C' selected) --- display_centre/display.py | 60 +++++++++++++++++++++++++++++++++------ 1 file changed, 51 insertions(+), 9 deletions(-) diff --git a/display_centre/display.py b/display_centre/display.py index 17afa99..505199b 100644 --- a/display_centre/display.py +++ b/display_centre/display.py @@ -215,10 +215,18 @@ class Display(object): for index, slot in enumerate(shader_bank_data): name_without_extension = slot['name'].rsplit('.',1)[0] - self.display_text.insert(END, '{:^6} {:<17} {:<5} \n'.format(index, name_without_extension[0:17], slot['shad_type'])) - if index % 2: + #self.display_text.insert(END, '{:^6} {:<17} {:<5} '.format(index, name_without_extension[0:17], slot['shad_type'])) + self.display_text.insert(END, '{:^2} {:<14} {:<3} '.format(index, name_without_extension[0:14], slot['shad_type'])) + #self.display_text.insert(END, '\t') + if (index) % 2: self.display_text.tag_add("ZEBRA_STRIPE", self.ROW_OFFSET + index, self.ROW_OFFSET + self.SELECTOR_WIDTH + index) + self.display_text.insert(END, '\n') + else: + self.display_text.insert(END, ' | ') + + self.display_text.insert(END, '\n') + # highlight the slot of the selected player current_slot = self.shaders.selected_shader_list[self.data.shader_layer].get('slot', None) not_playing_tag = self.shaders.selected_status_list[self.data.shader_layer] != '▶' @@ -227,6 +235,40 @@ class Display(object): self._highlight_this_param(self.shaders.focused_param) + # show info about the modulation configuration + #self.display_text.insert(END, "Lyr|1a b c d|2a b c d|3a b c d|4a b c d\n") + self.display_text.insert(END, "Lyr") + for i in range(4): + self.display_text.insert(END, "|%s"%i) + for i in range(4): + a = 'abcd'[i] + if i==self.shaders.selected_modulation_slot: + a = a.upper() + self.display_text.insert(END, "%s "%a) + self.display_text.insert(END, "\n") + bar = u"_\u2581\u2582\u2583\u2584\u2585\u2586\u2587\u2588" + for layer, modulations in enumerate(self.shaders.selected_modulation_level): + if (layer==self.data.shader_layer): + self.display_text.insert(END, '*') + else: + self.display_text.insert(END, ' ') + self.display_text.insert(END, '%s:' % layer) + for param, levels in enumerate(modulations): + self.display_text.insert(END, '|') + for slot,level in enumerate(levels): + self.display_text.insert(END, ' %s'%bar[int(level*(len(bar)-1))]) #(int(level*100))) + self.display_text.insert(END, ' ') + self.display_text.insert(END, '\n') + + + # todo: this doesnt work but would be a better way to highlight the selected modulation slot/layer + """self._highlight_this_param( + self.shaders.selected_modulation_slot, + param_row = 10+self.data.shader_layer, + param_length = 0.05, + column_offset = 0.1 + )""" + def _load_detour(self): line_count = 0 @@ -276,13 +318,13 @@ class Display(object): self.display_text.tag_remove("SELECT", self.ROW_OFFSET + row, self.ROW_OFFSET + self.SELECTOR_WIDTH + row) - def _highlight_this_param(self, param_num): - param_row = self.ROW_OFFSET - 1 - column_offset = 0.26 - param_length = 0.05 - self.display_text.tag_add("SHADER_PARAM", round(param_row + column_offset + param_num*param_length,2), -round(param_row + column_offset + (param_num+1)*param_length, 2)) - + def _highlight_this_param(self, param_num, column_offset = 0.26, param_length = 0.05, param_row = None): + if param_row is None: + param_row = self.ROW_OFFSET - 1 + self.display_text.tag_add("SHADER_PARAM", + round(param_row + column_offset + param_num*param_length,2), + round(param_row + column_offset + (param_num+1)*param_length, 2) + ) def _get_status_for_player(self): now_slot, now_status, now_alpha, next_slot, next_status, next_alpha = self.video_driver.get_player_info_for_status()