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
remotes/origin/HEAD
wildestpixel 2020-07-14 12:15:49 +01:00 committed by GitHub
parent d2f4003970
commit d5851339a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -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()