Change behavior for controller to play/pause.

This commit is contained in:
Matthew Stratford 2021-05-02 13:52:47 +01:00
parent 2fb1d38e6e
commit 05b64fb317
2 changed files with 2 additions and 1 deletions

View file

@ -87,7 +87,7 @@ class MattchBox(Controller):
if line == 255:
self.ser.write(b"\xff") # Send 255 back.
elif line in [1, 3, 5]:
self.sendToPlayer(int(line / 2), "PLAY")
self.sendToPlayer(int(line / 2), "PLAYPAUSE")
elif line in [2, 4, 6]:
self.sendToPlayer(int(line / 2) - 1, "STOP")
except Exception:

View file

@ -890,6 +890,7 @@ class Player:
# Unpause, so we don't jump to 0, we play from the current pos.
"PLAY": lambda: self._retMsg(self.unpause()),
"PAUSE": lambda: self._retMsg(self.pause()),
"PLAYPAUSE": lambda: self._retMsg(self.unpause() if not self.isPlaying else self.pause()), # For the hardware controller.
"UNPAUSE": lambda: self._retMsg(self.unpause()),
"STOP": lambda: self._retMsg(self.stop(user_initiated=True)),
"SEEK": lambda: self._retMsg(