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 1/2] 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() From 1633402de204a263598ec4968483ebea7a3a4015 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Tue, 14 Jul 2020 14:50:24 +0100 Subject: [PATCH 2/2] Fix linting issues --- mopidy_raspberry_gpio/frontend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mopidy_raspberry_gpio/frontend.py b/mopidy_raspberry_gpio/frontend.py index 3bd7f0d..cf10840 100644 --- a/mopidy_raspberry_gpio/frontend.py +++ b/mopidy_raspberry_gpio/frontend.py @@ -62,7 +62,7 @@ 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()