better quit

This commit is contained in:
j 2017-10-27 22:53:44 +02:00
parent 569dd9a06d
commit fed99721d6

View file

@ -14,11 +14,12 @@ logger = logging.getLogger('cdosea')
player = None player = None
quit = False quit = False
def q_binding(*args): def q_binding(*args):
global player global player
player.quit()
del player
quit = True quit = True
player.quit()
player = None
def main(): def main():
@ -61,13 +62,16 @@ def main():
pause_next = False pause_next = False
play_lights = True play_lights = True
while True: while True:
if not quit and pause_next: if not player:
player.pause = True break
pause_next = False if not quit:
play_lights = False if pause_next:
elif not quit and player.path.decode().endswith('black.mp4'): player.pause = True
pause_next = True pause_next = False
play_lights = False play_lights = False
elif player.path.decode().endswith('black.mp4'):
pause_next = True
play_lights = False
if play_lights and config.lights and player.path: if play_lights and config.lights and player.path:
trigger_lights(player.path.decode()) trigger_lights(player.path.decode())