added screen mirroring toggle

This commit is contained in:
langolierz
2018-05-01 21:42:22 +00:00
parent d4b381b408
commit 821377103f
6 changed files with 21 additions and 11 deletions

View File

@@ -163,6 +163,14 @@ class Actions(object):
else:
self.capture.start_recording()
def toggle_screen_mirror(self):
if self.data.update_screen:
self.data.update_screen = False
subprocess.call(['sudo', 'systemctl', 'start', 'raspi2fb@1'])
else:
self.data.update_screen = True
subprocess.call(['sudo', 'systemctl', 'stop', 'raspi2fb@1'])
def set_the_camera_colour_u_with_cc(self, amount):
u_value = self._convert_midi_cc_value(amount, 0, 255)
self.capture.set_colour(u_value, None)

View File

@@ -31,6 +31,7 @@ class Data(object):
self.control_mode = 'PLAYER'
self.bank_number = 0
self.midi_status = 'disconnected'
self.update_screen = True
### persisted data:
self.bank_data = self._read_json(self.BANK_DATA_JSON)

View File

@@ -18,9 +18,9 @@
},
{
"end": -1,
"length": -1,
"location": "",
"name": "",
"length": 5838.04,
"location": "/media/pi/5EB5-664C/MST3K_0310_Fugitive_Alien_xvid.avi",
"name": "MST3K_0310_Fugitive_Alien_xvid.avi",
"rate": 1,
"start": -1
},

View File

@@ -47,10 +47,10 @@
"DEFAULT": ["load_slot_4_into_next_player","increase_speed"]
},
"o": {
"DEFAULT": ["load_slot_5_into_next_player","print_speed"]
"DEFAULT": ["load_slot_5_into_next_player","toggle_screen_mirror"]
},
"p": {
"DEFAULT": ["load_slot_6_into_next_player"]
"DEFAULT": ["load_slot_6_into_next_player", "print_speed"]
},
"q": {
"DEFAULT": ["load_slot_7_into_next_player"]

View File

@@ -1 +1 @@
"0-0"
"0-2"

View File

@@ -217,6 +217,7 @@ class Display(object):
self.tk.after(500, self._update_screen_every_second)
def refresh_display(self):
if self.data.update_screen:
self.display_text.configure(state='normal')
self.display_text.delete(1.0, END)
self._load_display()