added coloured background options

This commit is contained in:
langolierz
2018-05-02 22:06:27 +00:00
parent 8141073fc1
commit b1cf071e1b
3 changed files with 36 additions and 5 deletions

View File

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

View File

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

View File

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