added option to drop output modew to 720 for some hdmi devices...

This commit is contained in:
langolierz
2018-05-16 04:02:51 +00:00
parent d6e941464b
commit fd7748c102
3 changed files with 40 additions and 10 deletions

View File

@@ -211,6 +211,14 @@ class Actions(object):
alpha_amount = self._convert_midi_cc_value(amount, 0, 255)
self.capture.set_alpha(alpha_amount)
def set_the_current_video_alpha_cc(self, amount):
alpha_amount = self._convert_midi_cc_value(amount, 0, 255)
self.video_driver.current_player.set_alpha_value(alpha_amount)
def set_the_next_video_alpha_cc(self, amount):
alpha_amount = self._convert_midi_cc_value(amount, 0, 255)
self.video_driver.next_player.set_alpha_value(alpha_amount)
@staticmethod
def _convert_midi_cc_value(cc_value, min_param, max_param):
output_range = max_param - min_param
@@ -227,11 +235,18 @@ class Actions(object):
def change_output_mode(self, setting_value):
if setting_value == 'hdmi':
subprocess.call(['tvservice', '-p'])
self._refresh_frame_buffer()
self.change_hdmi_settings(setting_value)
elif setting_value == 'composite':
self.change_composite_setting(setting_value)
def change_hdmi_settings(self, setting_value):
if self.data.settings['video']['OUTPUT']['value'] == 'hdmi':
if self.data.settings['video']['HDMI_MODE']['value'] == 'preferred':
subprocess.call(['tvservice', '-p'])
elif self.data.settings['video']['HDMI_MODE']['value'] == 'CEA 4 HDMI':
subprocess.call(['tvservice -e=\"CEA 4 HDMI\"'], shell=True)
self._refresh_frame_buffer()
def check_and_set_output_mode_on_boot(self):
#### checking if pi display mode is composite
response = str(subprocess.check_output(['tvservice', '-s']))
@@ -239,11 +254,12 @@ class Actions(object):
self.data.update_setting_value('video', 'OUTPUT', 'composite')
else:
self.data.update_setting_value('video', 'OUTPUT', 'hdmi')
self.data.update_setting_value('video', 'HDMI_MODE', 'preferred')
#### this is to work around a bug where 1080 videos on hdmi drop out ...
subprocess.call(['tvservice --sdtvon="PAL 4:3"'],shell=True)
self._refresh_frame_buffer()
subprocess.call(['tvservice', '-p'])
self._refresh_frame_buffer()
#subprocess.call(['tvservice --sdtvon="PAL 4:3"'],shell=True)
#self._refresh_frame_buffer()
#subprocess.call(['tvservice', '-p'])
#self._refresh_frame_buffer()
def check_dev_mode(self):
#### check if in dev mode:(ie not using the lcd screen)

View File

@@ -1,11 +1,17 @@
{
"control_change 0": {
"DEFAULT": ["set_the_camera_alpha_cc"]
"DEFAULT": ["set_the_current_video_alpha_cc"]
},
"control_change 1": {
"DEFAULT": ["set_the_camera_colour_u_with_cc"]
"DEFAULT": ["set_the_next_video_alpha_cc"]
},
"control_change 2": {
"DEFAULT": ["set_the_camera_alpha_cc"]
},
"control_change 3": {
"DEFAULT": ["set_the_camera_colour_u_with_cc"]
},
"control_change 4": {
"DEFAULT": ["set_the_camera_colour_v_with_cc"]
},
"note_on 72": {

View File

@@ -24,7 +24,7 @@
},
"IMAGE_EFFECT": {
"action": "update_capture_settings",
"options": [],
"options": ["none","sketch", "solarize", "oilpaint", "cartoon", "colorswap"],
"value": "none"
},
"RESOLUTION": {
@@ -145,7 +145,7 @@
"on",
"off"
],
"value": "off"
"value": "on"
},
"LOAD_NEXT": {
"action": "update_video_settings",
@@ -213,6 +213,14 @@
],
"value": "black"
},
"HDMI_MODE": {
"action": "change_hdmi_settings",
"options": [
"preferred",
"CEA 4 HDMI"
],
"value": "preferred"
},
"COMPOSITE_PROGRESSIVE": {
"action": "change_composite_setting",
"options": [