CC-3427: Live Stream: Ability to switch off Scheduled Play

- done
This commit is contained in:
James 2012-03-13 14:34:48 -04:00
parent e31ac81e74
commit 4eefc05366
11 changed files with 91 additions and 79 deletions

View file

@ -26,20 +26,6 @@ def transition(a,b) =
fade.final(duration=!default_dj_fade_out, a) ])
end
def transition_to_live(a,b) =
log("transition called...")
#add(normalize=false,
# [fade.initial(duration=5.,type="log", b),fade.final(duration=5.,type="log",a)])
smooth_add(delay=10., normal=a, special=b)
end
def transition_from_live(a,b) =
log("transition called...")
#add(normalize=false,
# [fade.initial(duration=5.,type="log", b),fade.final(duration=5.,type="log",a)])
smooth_add(delay=10., normal=b, special=a)
end
def crossfade(s)
#duration is automatically overwritten by metadata fields passed in
#with audio

View file

@ -45,6 +45,7 @@ ignore(output.dummy(default, fallible=true))
master_dj_enabled = ref false;
live_dj_enabled = ref false;
scheduled_play_enabled = ref true;
def make_master_dj_available()
master_dj_enabled := true
@ -62,6 +63,14 @@ def make_live_dj_unavailable()
live_dj_enabled := false
end
def make_scheduled_play_available()
scheduled_play_enabled := true
end
def make_scheduled_play_unavailable()
scheduled_play_enabled := false
end
#live stream setup
set("harbor.bind_addr", "0.0.0.0")
@ -94,7 +103,6 @@ def check_master_dj_client(user,password) =
ret = list.hd(ret)
#return true to let the client transmit data, or false to tell harbor to decline
if (ret == "True") then
#master_dj_connect()
true
else
false
@ -108,7 +116,6 @@ def check_dj_client(user,password) =
ret = list.hd(ret)
#return true to let the client transmit data, or false to tell harbor to decline
if (ret == "True") then
#live_dj_connect()
true
else
false
@ -139,7 +146,7 @@ def append_dj_inputs(master_harbor_input_port, master_harbor_input_mount_point,
end
end
s = fallback(id="default_fallback", track_sensitive=false, [queue, default])
s = switch(id="default_switch", track_sensitive=false, transitions=[transition, transition], [({!scheduled_play_enabled},queue),({true},default)])
s = append_dj_inputs(master_live_stream_port, master_live_stream_mp, dj_live_stream_port, dj_live_stream_mp, s)
s = crossfade(s)
@ -182,6 +189,16 @@ server.register(namespace="streams",
usage="live_dj_start",
"live_dj_start",
fun (s) -> begin make_live_dj_available() "Done." end)
server.register(namespace="streams",
description="Stop Scheduled Play source.",
usage="scheduled_play_stop",
"scheduled_play_stop",
fun (s) -> begin make_scheduled_play_unavailable() "Done." end)
server.register(namespace="streams",
description="Start Scheduled Play source.",
usage="scheduled_play_start",
"scheduled_play_start",
fun (s) -> begin make_scheduled_play_available() "Done." end)
if output_sound_device then

View file

@ -107,9 +107,11 @@ class PypoFetch(Thread):
command = "streams."
if(sourcename == "master_dj"):
command += "master_dj_"
else:
elif(sourcename == "live_dj"):
command += "live_dj_"
elif(sourcename == "scheduled_play"):
command += "scheduled_play_"
if(status == "on"):
command += "start\n"
else: