-fixed synchronization of song-start to ui-start after very long playback (greater than 48 hours)
This commit is contained in:
parent
810aa3845b
commit
bf25de9ce4
|
@ -692,11 +692,16 @@ class Playout:
|
||||||
|
|
||||||
# Get any extra information for liquidsoap (which will be sent back to us)
|
# Get any extra information for liquidsoap (which will be sent back to us)
|
||||||
liquidsoap_data = self.api_client.get_liquidsoap_data(pkey, schedule)
|
liquidsoap_data = self.api_client.get_liquidsoap_data(pkey, schedule)
|
||||||
logger.debug("Sending additional data to liquidsoap: "+str(liquidsoap_data["schedule_id"]))
|
logger.debug("Sending additional telnet data to liquidsoap: "+str(liquidsoap_data["schedule_id"]))
|
||||||
|
|
||||||
|
#skip the currently playing song if any.
|
||||||
|
logger.debug("source.skip\n")
|
||||||
|
tn.write("source.skip\n")
|
||||||
|
|
||||||
#Sending JSON string. Example: {"schedule_id":"13"}
|
#Sending schedule table row id string.
|
||||||
|
logger.debug("vars.pypo_data %s\n"%(str(liquidsoap_data["schedule_id"])))
|
||||||
tn.write("vars.pypo_data %s\n"%(str(liquidsoap_data["schedule_id"])))
|
tn.write("vars.pypo_data %s\n"%(str(liquidsoap_data["schedule_id"])))
|
||||||
|
|
||||||
for line in pl_file.readlines():
|
for line in pl_file.readlines():
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
logger.debug(line)
|
logger.debug(line)
|
||||||
|
|
|
@ -22,6 +22,22 @@ def crossfade(s)
|
||||||
cross(fader,s)
|
cross(fader,s)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Add a skip function to a source
|
||||||
|
# when it does not have one
|
||||||
|
# by default
|
||||||
|
def add_skip_command(s) =
|
||||||
|
# A command to skip
|
||||||
|
def skip(_) =
|
||||||
|
source.skip(s)
|
||||||
|
"Done!"
|
||||||
|
end
|
||||||
|
# Register the command:
|
||||||
|
server.register(namespace="source",
|
||||||
|
usage="skip",
|
||||||
|
description="Skip the current song.",
|
||||||
|
"skip",skip)
|
||||||
|
end
|
||||||
|
|
||||||
server.register(namespace="vars", "pypo_data", fun (s) -> begin pypo_data := s "Done" end)
|
server.register(namespace="vars", "pypo_data", fun (s) -> begin pypo_data := s "Done" end)
|
||||||
|
|
||||||
default = single("/opt/pypo/files/basic/silence.mp3")
|
default = single("/opt/pypo/files/basic/silence.mp3")
|
||||||
|
@ -32,6 +48,10 @@ s = fallback(track_sensitive=false, [queue, default])
|
||||||
s = on_metadata(notify, s)
|
s = on_metadata(notify, s)
|
||||||
s = crossfade(s)
|
s = crossfade(s)
|
||||||
|
|
||||||
|
# Attach a skip command to the source s:
|
||||||
|
add_skip_command(s)
|
||||||
|
|
||||||
|
|
||||||
if output_sound_device then
|
if output_sound_device then
|
||||||
out_device = out(s)
|
out_device = out(s)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue