Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add initial support for radio player and color themes #49

Open
wants to merge 1 commit into
base: 21.02
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ def initialize(self):

self.add_event('playback.display.video.type', self.handle_display_video)
self.add_event('playback.display.audio.type', self.handle_display_audio)
self.add_event('playback.display.radio.type', self.handle_display_radio)
self.add_event('playback.display.remove', self.handle_remove_player)
self.add_event('playback.display.set.player.theme', self.handle_display_player_settheme)

self.clear_gui_info()
# Handle common audio intents. 'Audio' skills should listen for the
Expand Down Expand Up @@ -269,12 +271,23 @@ def _play_query_timeout(self, message):
if search_phrase in self.query_extensions:
del self.query_extensions[search_phrase]

def handle_display_player_settheme(self, message):
theme = message.data.get("theme", "")
self.gui["textColor"] = theme.get("textColor", "")
self.gui["spectrumColor"] = theme.get("spectrumColor", "")
self.gui["seekBackgroundColor"] = theme.get("seekBackgroundColor", "")
self.gui["seekForgroundColor"] = theme.get("seekForgroundColor", "")
self.gui["cardBackgroundColor"] = theme.get("cardBackgroundColor", "")

def handle_display_video(self, message):
self.gui.show_page("VideoPlayer.qml", override_idle=True)

def handle_display_audio(self, message):
self.gui.show_page("AudioPlayer.qml", override_idle=True)

def handle_display_radio(self, message):
self.gui.show_page("RadioPlayer.qml", override_idle=True)

def handle_remove_player(self, message):
self.gui.release()

Expand Down
Loading