From 23647de797f18bcb461302f959086bbe3e8b62df Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Thu, 5 Nov 2020 18:59:28 +0000 Subject: [PATCH] Re-add hot output switching, add default output support. --- player.py | 6 +++++- templates/config.html | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/player.py b/player.py index 90597b1..671280b 100644 --- a/player.py +++ b/player.py @@ -297,9 +297,10 @@ class Player(): def output(self, name=None): wasPlaying = self.state.state["playing"] + name = None if name == "none" else name + self.quit() self.state.update("output", name) - self.state.update("loaded_item", None) try: if name: mixer.init(44100, -16, 2, 1024, devicename=name) @@ -309,6 +310,9 @@ class Player(): self.logger.log.exception("Failed to init mixer with device name: " + str(name)) return False + loadedItem = self.state.state["loaded_item"] + if (loadedItem): + self.load(loadedItem.timeslotitemid) if wasPlaying: self.unpause() diff --git a/templates/config.html b/templates/config.html index 7f37597..33f5e8d 100644 --- a/templates/config.html +++ b/templates/config.html @@ -1,8 +1,9 @@ {% extends 'base.html' %} {% block content_inner %} + Set Channel 0 Set Channel 1 Set Channel 2 - System Default Output
{% for output in data.outputs %} Set Channel 0 Set Channel 1 Set Channel 2 - {{output.name}}
{% endfor %}
-{% endblock %} \ No newline at end of file +{% endblock %}