fixed omxplayer load bug and hide parellel mode because not working

This commit is contained in:
langolierz
2019-08-19 09:58:08 +00:00
parent 92df0bf6b4
commit 74f54f99cf
6 changed files with 40 additions and 29 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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