-interface is now notified when a song starts playing. ON-AIR graphic only turns red after this notification.
This commit is contained in:
parent
6b615b4e70
commit
dab39f391e
8 changed files with 555 additions and 548 deletions
File diff suppressed because it is too large
Load diff
|
@ -18,7 +18,6 @@ qualname="process"
|
|||
propagate=0
|
||||
|
||||
|
||||
|
||||
[handler_consoleHandler]
|
||||
class=StreamHandler
|
||||
level=DEBUG
|
||||
|
@ -41,7 +40,7 @@ args=("./debug.log",)
|
|||
class=FileHandler
|
||||
level=DEBUG
|
||||
formatter=simpleFormatter
|
||||
args=("/tmp/sessionlog_null.log",)
|
||||
args=("/dev/null",)
|
||||
|
||||
|
||||
[formatter_simpleFormatter]
|
||||
|
|
|
@ -383,8 +383,10 @@ class Playout:
|
|||
fsize = 0
|
||||
|
||||
if fsize > 0:
|
||||
pl_entry = 'annotate:export_source="%s",media_id="%s",liq_start_next="%s",liq_fade_in="%s",liq_fade_out="%s":%s' % \
|
||||
(str(media['export_source']), media['id'], 0, str(float(media['fade_in']) / 1000), str(float(media['fade_out']) / 1000), dst)
|
||||
pl_entry = \
|
||||
'annotate:export_source="%s",media_id="%s",liq_start_next="%s",liq_fade_in="%s",liq_fade_out="%s",schedule_table_id="%s":%s'\
|
||||
% (str(media['export_source']), media['id'], 0, str(float(media['fade_in']) / 1000), \
|
||||
str(float(media['fade_out']) / 1000), media['row_id'],dst)
|
||||
|
||||
logger.debug(pl_entry)
|
||||
|
||||
|
@ -686,6 +688,14 @@ class Playout:
|
|||
time.sleep(sleep_time)
|
||||
|
||||
tn = telnetlib.Telnet(LS_HOST, 1234)
|
||||
|
||||
|
||||
# Get any extra information for liquidsoap (which will be sent back to us)
|
||||
liquidsoap_data = self.api_client.get_liquidsoap_data(pkey, schedule)
|
||||
logger.debug("Sending additional data to liquidsoap: "+str(liquidsoap_data["schedule_id"]))
|
||||
|
||||
#Sending JSON string. Example: {"schedule_id":"13"}
|
||||
tn.write("vars.pypo_data %s\n"%(str(liquidsoap_data["schedule_id"])))
|
||||
|
||||
for line in pl_file.readlines():
|
||||
line = line.strip()
|
||||
|
|
|
@ -80,7 +80,7 @@ class Notify:
|
|||
logger.debug('#################################################')
|
||||
logger.debug('data = '+ str(data))
|
||||
response = self.api_client.notify_media_item_start_playing(data, media_id)
|
||||
logger.debug("Response: "+str(response))
|
||||
logger.debug("Response: "+json.dumps(response))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -10,9 +10,10 @@ queue = audio_to_stereo(queue)
|
|||
|
||||
pypo_data = ref '0'
|
||||
|
||||
#def notify(m)
|
||||
# print("./notify.sh --data='#{!pypo_data}' --media-id=#{m['media_id']}")
|
||||
#end
|
||||
def notify(m)
|
||||
system("./notify.sh --data='#{!pypo_data}' --media-id=#{m['schedule_table_id']}")
|
||||
print("./notify.sh --data='#{!pypo_data}' --media-id=#{m['schedule_table_id']}")
|
||||
end
|
||||
|
||||
def crossfade(s)
|
||||
s = fade.in(type="log", s)
|
||||
|
@ -28,7 +29,7 @@ default = rewrite_metadata([("artist","Airtime"), ("title", "offline")],default)
|
|||
|
||||
s = fallback(track_sensitive=false, [queue, default])
|
||||
|
||||
#s = on_metadata(notify, s)
|
||||
s = on_metadata(notify, s)
|
||||
s = crossfade(s)
|
||||
|
||||
if output_sound_device then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue