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: else:
self.capture.start_recording() 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): def set_the_camera_colour_u_with_cc(self, amount):
u_value = self._convert_midi_cc_value(amount, 0, 255) u_value = self._convert_midi_cc_value(amount, 0, 255)
self.capture.set_colour(u_value, None) self.capture.set_colour(u_value, None)

View File

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

View File

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

View File

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

View File

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

View File

@@ -217,11 +217,12 @@ class Display(object):
self.tk.after(500, self._update_screen_every_second) self.tk.after(500, self._update_screen_every_second)
def refresh_display(self): def refresh_display(self):
self.display_text.configure(state='normal') if self.data.update_screen:
self.display_text.delete(1.0, END) self.display_text.configure(state='normal')
self._load_display() self.display_text.delete(1.0, END)
self.display_text.configure(state='disable') self._load_display()
self.display_text.focus_set() self.display_text.configure(state='disable')
self.display_text.focus_set()
def navigate_menu(self, move_direction, number_items_in_list): def navigate_menu(self, move_direction, number_items_in_list):
last_list_index = number_items_in_list - 1 last_list_index = number_items_in_list - 1