Re-add hot output switching, add default output support.
This commit is contained in:
parent
cb42eec757
commit
23647de797
2 changed files with 7 additions and 2 deletions
|
@ -297,9 +297,10 @@ class Player():
|
||||||
|
|
||||||
def output(self, name=None):
|
def output(self, name=None):
|
||||||
wasPlaying = self.state.state["playing"]
|
wasPlaying = self.state.state["playing"]
|
||||||
|
name = None if name == "none" else name
|
||||||
|
|
||||||
self.quit()
|
self.quit()
|
||||||
self.state.update("output", name)
|
self.state.update("output", name)
|
||||||
self.state.update("loaded_item", None)
|
|
||||||
try:
|
try:
|
||||||
if name:
|
if name:
|
||||||
mixer.init(44100, -16, 2, 1024, devicename=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))
|
self.logger.log.exception("Failed to init mixer with device name: " + str(name))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
loadedItem = self.state.state["loaded_item"]
|
||||||
|
if (loadedItem):
|
||||||
|
self.load(loadedItem.timeslotitemid)
|
||||||
if wasPlaying:
|
if wasPlaying:
|
||||||
self.unpause()
|
self.unpause()
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% block content_inner %}
|
{% block content_inner %}
|
||||||
<code>
|
<code>
|
||||||
|
<a href="/player/0/output/none">Set Channel 0</a> <a href="/player/1/output/none">Set Channel 1</a> <a href="/player/2/output/none">Set Channel 2</a> - System Default Output<br>
|
||||||
{% for output in data.outputs %}
|
{% for output in data.outputs %}
|
||||||
<a href="/player/0/output/{{output.name}}">Set Channel 0</a> <a href="/player/1/output/{{output.name}}">Set Channel 1</a> <a href="/player/2/output/{{output.name}}">Set Channel 2</a> - {{output.name}}<br>
|
<a href="/player/0/output/{{output.name}}">Set Channel 0</a> <a href="/player/1/output/{{output.name}}">Set Channel 1</a> <a href="/player/2/output/{{output.name}}">Set Channel 2</a> - {{output.name}}<br>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</code>
|
</code>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in a new issue