diff --git a/actions.py b/actions.py index 24aa152..1c8b613 100644 --- a/actions.py +++ b/actions.py @@ -85,10 +85,11 @@ class Actions(object): ### load next player for seamless type otherwise respect player mode if self.data.settings['sampler']['LOOP_TYPE']['value'] == 'seamless': if self.data.update_next_slot_number(slot): + print('should reload next player !! ') self.video_driver.reload_next_player() else: if self.data.player_mode == 'next': - if self.data.update_next_slot_number(slot): + if self.data.update_next_slot_number(slot, is_current=False): self.video_driver.reload_next_player() else: if self.data.update_next_slot_number(slot, is_current=True): @@ -482,8 +483,10 @@ class Actions(object): if state == 'ofvideoplayer' or state == 'ofxomxplayer': self.switch_conjur_player_type(state) elif state == 'omxplayer': + self.data.update_setting_value('sampler', 'LOOP_TYPE', 'seamless') self.exit_openframeworks() self.set_capture_object('nothing') + self.display.settings_menu.generate_settings_list() self.reset_players() def reset_players(self): diff --git a/display_centre/menu.py b/display_centre/menu.py index 1b4dadb..8838a4b 100644 --- a/display_centre/menu.py +++ b/display_centre/menu.py @@ -164,8 +164,11 @@ class SettingsMenu(Menu): return False, '' def check_for_settings_to_hide(self): + self.SETTINGS_TO_HIDE = ['OUTPUT'] if self.data.settings['video']['VIDEOPLAYER_BACKEND']['value'] != 'omxplayer': self.SETTINGS_TO_HIDE = self.SETTINGS_TO_HIDE + ['SCREEN_MODE', 'BACKGROUND_COLOUR', 'FRAMERATE', 'IMAGE_EFFECT', 'RESOLUTION', 'SHUTTER'] + else: + self.SETTINGS_TO_HIDE = self.SETTINGS_TO_HIDE + ['LOOP_TYPE'] @staticmethod def order_keys_from_list(dictionary, order_list): diff --git a/json_objects/analog_action_mapping.json b/json_objects/analog_action_mapping.json index 5541a40..c2782ff 100644 --- a/json_objects/analog_action_mapping.json +++ b/json_objects/analog_action_mapping.json @@ -1,28 +1,34 @@ { "0": { - "DEFAULT": ["set_the_shader_param_0_continuous"] + "DEFAULT": ["set_the_shader_param_0_continuous"], + "NAV_DETOUR": ["set_detour_mix_continuous"] }, "1": { - "DEFAULT": ["set_the_shader_param_1_continuous"] + "DEFAULT": ["set_the_shader_param_1_continuous"], + "NAV_DETOUR": ["set_detour_speed_position_continuous"] }, "2": { - "DEFAULT": ["set_the_shader_param_2_continuous"] + "DEFAULT": ["set_the_shader_param_2_continuous"], + "NAV_DETOUR": ["set_detour_start_continuous"] }, "3": { - "DEFAULT": ["set_the_shader_param_3_continuous"] + "DEFAULT": ["set_the_shader_param_3_continuous"], + "NAV_DETOUR": ["set_detour_end_continuous"] + }, + "4": { + "DEFAULT": ["set_the_shader_param_0_continuous"], + "NAV_DETOUR": ["set_detour_mix_continuous"] }, - "4": { - "DEFAULT": ["set_the_shader_param_0_continuous"] - }, "5": { - "DEFAULT": ["set_the_shader_param_1_continuous"] - }, + "DEFAULT": ["set_the_shader_param_1_continuous"], + "NAV_DETOUR": ["set_detour_speed_position_continuous"] + }, "6": { - "DEFAULT": ["set_the_shader_param_2_continuous"] - }, + "DEFAULT": ["set_the_shader_param_2_continuous"], + "NAV_DETOUR": ["set_detour_start_continuous"] + }, "7": { - "DEFAULT": ["set_the_shader_param_3_continuous"] - } - - + "DEFAULT": ["set_the_shader_param_3_continuous"], + "NAV_DETOUR": ["set_detour_end_continuous"] + } } diff --git a/json_objects/midi_action_mapping.json b/json_objects/midi_action_mapping.json index 959b13e..97d5503 100644 --- a/json_objects/midi_action_mapping.json +++ b/json_objects/midi_action_mapping.json @@ -1,21 +1,18 @@ { - "control_change 0": { - "DEFAULT": ["set_the_current_video_alpha_continuous"] - }, "control_change 1": { - "DEFAULT": ["set_the_next_video_alpha_continuous"], + "DEFAULT": ["set_the_shader_param_0_continuous"], "NAV_DETOUR": ["set_detour_mix_continuous"] }, "control_change 2": { - "DEFAULT": ["set_the_camera_alpha_continuous"], + "DEFAULT": ["set_the_shader_param_1_continuous"], "NAV_DETOUR": ["set_detour_speed_position_continuous"] }, "control_change 3": { - "DEFAULT": ["set_the_camera_colour_u_continuous"], + "DEFAULT": ["set_the_shader_param_2_continuous"], "NAV_DETOUR": ["set_detour_start_continuous"] }, "control_change 4": { - "DEFAULT": ["set_the_camera_colour_v_continuous"], + "DEFAULT": ["set_the_shader_param_3_continuous"], "NAV_DETOUR": ["set_detour_end_continuous"] }, "control_change 5": { diff --git a/video_centre/video_driver.py b/video_centre/video_driver.py index caca0e7..924a0b2 100644 --- a/video_centre/video_driver.py +++ b/video_centre/video_driver.py @@ -146,7 +146,7 @@ class VideoDriver(object): self.next_player = VideoPlayer(self.root, self.message_handler, self.data, 'c.c') def reload_next_player(self): - self.next_player.reload(self.get_next_layer_value()) + self.next_player.reload(self.get_next_layer_value(), is_current=False) def reload_current_player(self): self.current_player.reload(self.get_next_layer_value(), is_current=True) diff --git a/video_centre/video_player.py b/video_centre/video_player.py index 1662487..cb8458a 100644 --- a/video_centre/video_player.py +++ b/video_centre/video_player.py @@ -21,7 +21,7 @@ class VideoPlayer: self.show_toggle_on = False - def try_load(self, layer, is_current=True): + def try_load(self, layer, is_current=False): load_attempts = 0 while(load_attempts < 2): load_attempts = load_attempts + 1 @@ -102,7 +102,7 @@ class VideoPlayer: elif(self.omx_running): self.root.after(5, self.pause_at_end) - def reload(self, layer, is_current=True): + def reload(self, layer, is_current=False): self.exit() self.omx_running = False self.try_load(layer, is_current) @@ -172,11 +172,13 @@ class VideoPlayer: def exit(self): try: - self.omx_player.quit() + if self.omx_player: + print('trying to exit this player ', self.location) + self.omx_player.quit() self.status = 'EMPTY' self.omx_running = False - except: - pass + except Exception as e: + print('failed to exit: ', e) def set_screen_size_for_dev_mode(self): ## only dev mode is needed now that auto handles all modes... can be removed probably ...