Loading player_functions.py +5 −2 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ import threading display = serial.Serial("/dev/ttyUSB0", 19200, serial.EIGHTBITS, serial.PARITY_NONE, serial.STOPBITS_ONE, timeout=5, rtscts=False) status="alive" def stoplisten(): while True: Loading @@ -28,8 +29,7 @@ def stoplisten(): print("failing decode quietly") # Check if the received character is 'E' if received_char == 'E': if (proc.poll() is not None): proc.terminate() status="kill" # Find the ID of the first MIDI device since I only have one def findAMIDIDevice(): Loading Loading @@ -98,6 +98,9 @@ def playTrack(track_path, port): time.sleep(.5) if (proc.poll() is not None): retry = 0 if(status=="kill"): proc.terminate() status="alive" finally: # When we've stopped retrying, either because of stop command # or a finished track, terminate the subprocess if it hasn't already been Loading Loading
player_functions.py +5 −2 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ import threading display = serial.Serial("/dev/ttyUSB0", 19200, serial.EIGHTBITS, serial.PARITY_NONE, serial.STOPBITS_ONE, timeout=5, rtscts=False) status="alive" def stoplisten(): while True: Loading @@ -28,8 +29,7 @@ def stoplisten(): print("failing decode quietly") # Check if the received character is 'E' if received_char == 'E': if (proc.poll() is not None): proc.terminate() status="kill" # Find the ID of the first MIDI device since I only have one def findAMIDIDevice(): Loading Loading @@ -98,6 +98,9 @@ def playTrack(track_path, port): time.sleep(.5) if (proc.poll() is not None): retry = 0 if(status=="kill"): proc.terminate() status="alive" finally: # When we've stopped retrying, either because of stop command # or a finished track, terminate the subprocess if it hasn't already been Loading