diff --git a/data_centre/data.py b/data_centre/data.py index 14f674d..fe1a1e5 100644 --- a/data_centre/data.py +++ b/data_centre/data.py @@ -231,6 +231,25 @@ class Data(object): else: return False + def get_background_colour(self): + colour_name = self.settings['video']['BACKGROUND_COLOUR']['value'] + colour_argb = (255,0,0,0) + if colour_name == "black": + colour_argb = (255,0,0,0) + elif colour_name == "white": + colour_argb = (255,255,255,255) + elif colour_name == "green": + colour_argb = (255,0,255,0) + elif colour_name == "blue": + colour_argb = (255,0,0,255) + elif colour_name == "pink": + colour_argb = (255,255,0,255) + elif colour_name == "none": + colour_argb = (0,0,0,0) + colour_hex = '%02x%02x%02x%02x' % colour_argb + print(colour_hex) + return colour_hex + @staticmethod def _get_mb_free_diskspace(path): st = os.statvfs(path) diff --git a/data_centre/json_objects/settings.json b/data_centre/json_objects/settings.json index 4f8a0c3..2ae7cad 100644 --- a/data_centre/json_objects/settings.json +++ b/data_centre/json_objects/settings.json @@ -93,7 +93,7 @@ "on", "off" ], - "value": "off" + "value": "on" }, "QUIT": { "action": "quit_the_program", @@ -121,7 +121,7 @@ "on", "off" ], - "value": "on" + "value": "off" }, "LOAD_NEXT": { "action": "update_video_settings", @@ -148,7 +148,7 @@ "nothing", "switch" ], - "value": "switch" + "value": "nothing" }, "ON_LOAD": { "action": "update_video_settings", @@ -156,7 +156,7 @@ "hide", "show" ], - "value": "show" + "value": "hide" }, "ON_START": { "action": "update_video_settings", @@ -178,6 +178,18 @@ } }, "video": { + "BACKGROUND_COLOUR": { + "action": null, + "options": [ + "pink", + "blue", + "black", + "white", + "green", + "none" + ], + "value": "none" + }, "COMPOSITE_PROGRESSIVE": { "action": "change_composite_setting", "options": [ diff --git a/video_centre/video_player.py b/video_centre/video_player.py index 87629c0..db421fb 100644 --- a/video_centre/video_player.py +++ b/video_centre/video_player.py @@ -41,7 +41,7 @@ class VideoPlayer: is_dev_mode, first_screen_arg, second_screen_arg = self.set_screen_size_for_dev_mode() arguments = ['--no-osd', '--layer', str(layer), '--adev', 'local', '--alpha', '0', first_screen_arg, second_screen_arg] if not is_dev_mode: - arguments.append('-b') ##=0x000000FF') + arguments.append('--blank=0x{}'.format(self.data.get_background_colour())) self.status = 'LOADING' print('the location is {}'.format(self.location)) self.omx_player = OMXPlayer(self.location, args=arguments, dbus_name=self.name)