Commit e52576a3 authored by Alyx's avatar Alyx
Browse files

sidifosdf

parent c21eae9d
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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:
@@ -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():
@@ -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