From d5851339a5be61f71c05c57398170c312b479692 Mon Sep 17 00:00:00 2001 From: wildestpixel <47211094+wildestpixel@users.noreply.github.com> Date: Tue, 14 Jul 2020 12:15:49 +0100 Subject: [PATCH] Update frontend.py Add definition of handle_play_stop which will allow the ALSA playback device to unlock for audio to be played back from an alternative source --- mopidy_raspberry_gpio/frontend.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mopidy_raspberry_gpio/frontend.py b/mopidy_raspberry_gpio/frontend.py index 097d5e2..3bd7f0d 100644 --- a/mopidy_raspberry_gpio/frontend.py +++ b/mopidy_raspberry_gpio/frontend.py @@ -62,6 +62,12 @@ class RaspberryGPIOFrontend(pykka.ThreadingActor, core.CoreListener): self.core.playback.pause() else: self.core.playback.play() + + def handle_play_stop(self, config): + if self.core.playback.get_state().get() == core.PlaybackState.PLAYING: + self.core.playback.stop() + else: + self.core.playback.play() def handle_next(self, config): self.core.playback.next()