diff --git a/actions.py b/actions.py index 20a4caa..656f13c 100644 --- a/actions.py +++ b/actions.py @@ -7,7 +7,7 @@ class Actions(object): self.data = data self.video_driver = video_driver self.display = display - + def move_browser_selection_down(self): self.display.navigate_menu('down', len(self.data.return_browser_list())) @@ -86,10 +86,13 @@ class Actions(object): self.display.selected_list_index = self.display.top_menu_index if self.display.display_mode == "BROWSER": self.display.display_mode = "SETTINGS" + self.display.control_mode = 'NAV_SETTINGS' elif self.display.display_mode == "SAMPLER": self.display.display_mode = "BROWSER" + self.display.control_mode = 'NAV_BROWSER' elif self.display.display_mode == "SETTINGS": self.display.display_mode = "SAMPLER" + self.display.control_mode = 'PLAYER' def toggle_pause_on_player(self): self.video_driver.current_player.toggle_pause() diff --git a/data_centre/json_objects/display_data.json b/data_centre/json_objects/display_data.json index 8ce208e..718bf4a 100644 --- a/data_centre/json_objects/display_data.json +++ b/data_centre/json_objects/display_data.json @@ -1 +1 @@ -[{"location": "/media/pi/TIM1/videos_to_play/colour_pixel_01.mp4", "length": 49.28, "start": -1, "name": "colour_pixel_01.mp4", "end": -1}, {"length": -1, "start": -1, "name": "", "end": -1, "location": ""}, {"length": -1, "start": -1, "name": "", "end": -1, "location": ""}, {"length": -1, "start": -1, "name": "", "end": -1, "location": ""}, {"length": -1, "start": -1, "name": "", "end": -1, "location": ""}, {"length": -1, "start": -1, "name": "", "end": -1, "location": ""}, {"length": -1, "start": -1, "name": "", "end": -1, "location": ""}, {"length": -1, "start": -1, "name": "", "end": -1, "location": ""}, {"length": -1, "start": -1, "name": "", "end": -1, "location": ""}, {"length": -1, "start": -1, "name": "", "end": -1, "location": ""}] \ No newline at end of file +[{"name": "colour_pixel_01.mp4", "length": 49.28, "end": -1, "start": -1, "location": "/media/pi/TIM1/videos_to_play/colour_pixel_01.mp4"}, {"name": "colour_pixel_02.mp4", "start": -1, "location": "/media/pi/TIM1/videos_to_play/colour_pixel_02.mp4", "length": 87.04, "end": -1}, {"name": "", "length": -1, "location": "", "start": -1, "end": -1}, {"name": "", "length": -1, "location": "", "start": -1, "end": -1}, {"name": "", "length": -1, "location": "", "start": -1, "end": -1}, {"name": "", "length": -1, "location": "", "start": -1, "end": -1}, {"name": "", "length": -1, "location": "", "start": -1, "end": -1}, {"name": "", "length": -1, "location": "", "start": -1, "end": -1}, {"name": "", "length": -1, "location": "", "start": -1, "end": -1}, {"name": "", "length": -1, "location": "", "start": -1, "end": -1}] \ No newline at end of file diff --git a/data_centre/json_objects/keypad_action_mapping.json b/data_centre/json_objects/keypad_action_mapping.json index 9517b07..24b6f87 100644 --- a/data_centre/json_objects/keypad_action_mapping.json +++ b/data_centre/json_objects/keypad_action_mapping.json @@ -1,18 +1,18 @@ { "a": { - "BROWSER": ["move_browser_selection_up"], - "SAMPLER": ["seek_back_on_player"], - "SETTINGS": ["move_settings_selection_up"] + "NAV_BROWSER": ["move_browser_selection_up"], + "PLAYER": ["seek_back_on_player"], + "NAV_SETTINGS": ["move_settings_selection_up"] }, "b": { - "BROWSER": ["move_browser_selection_down"], - "SAMPLER": ["seek_forward_on_player"], - "SETTINGS": ["move_settings_selection_down"] + "NAV_BROWSER": ["move_browser_selection_down"], + "PLAYER": ["seek_forward_on_player"], + "NAV_SETTINGS": ["move_settings_selection_down"] }, "c": { - "BROWSER": ["enter_on_browser_selection"], - "SAMPLER": ["toggle_pause_on_player"], - "SETTINGS": ["enter_on_settings_selection"] + "NAV_BROWSER": ["enter_on_browser_selection"], + "PLAYER": ["toggle_pause_on_player"], + "NAV_SETTINGS": ["enter_on_settings_selection"] }, "d": { "DEFAULT": ["trigger_next_player"] diff --git a/display_centre/display.py b/display_centre/display.py index ec8f74c..62c0d9c 100644 --- a/display_centre/display.py +++ b/display_centre/display.py @@ -17,6 +17,7 @@ class Display(object): self.data = data self.display_mode = "SAMPLER" + self.control_mode = 'PLAYER' self.top_menu_index = 0 self.selected_list_index = self.top_menu_index self.browser_list = self.data.rewrite_browser_list() @@ -124,7 +125,7 @@ class Display(object): def _load_message(self): if self.message_handler.current_message[1]: - self.display_text.insert(END, '{:5}: {:38}'.format( + self.display_text.insert(END, '{:5} {:38}'.format( self.message_handler.current_message[0], self.message_handler.current_message[1][0:38])) self.display_text.tag_add('{}_MESSAGE'.format( self.message_handler.current_message[0]), 16.0,16.0 + self.SELECTOR_WIDTH) @@ -135,6 +136,9 @@ class Display(object): elif self.message_handler.function_on: self.display_text.insert(END, '{:^45}'.format('< FUNCTION KEY ON >')) self.display_text.tag_add('FUNCTION', 16.0,16.0 + self.SELECTOR_WIDTH) + else: + self.display_text.insert(END, '{:8} {:<10}'.format('CONTROL:', self.control_mode)) + self.display_text.tag_add('TITLE', 16.0,16.0 + self.SELECTOR_WIDTH) def _highlight_this_row(self, row): self.display_text.tag_add("SELECT", self.ROW_OFFSET + row, diff --git a/user_input/numpad_input.py b/user_input/numpad_input.py index 5ecf11d..c74ca57 100644 --- a/user_input/numpad_input.py +++ b/user_input/numpad_input.py @@ -31,8 +31,8 @@ class NumpadInput(object): def run_action_for_mapped_key(self, key): this_mapping = self.key_mappings[key] - if self.display.display_mode in this_mapping: - mode = self.display.display_mode + if self.display.control_mode in this_mapping: + mode = self.display.control_mode elif 'DEFAULT' in this_mapping: mode = 'DEFAULT'