CC-1665: Scheduled stream rebroadcasting and recording

on-air light works with streams now
This commit is contained in:
Martin Konecny 2012-08-01 14:51:56 -04:00
parent e1f962baa9
commit 63b89043b6
4 changed files with 33 additions and 10 deletions

View File

@ -665,6 +665,12 @@ class Application_Model_Schedule
//time of this event is the "end" time of the stream minus 1 second.
$dt = new DateTime($item["end"], new DateTimeZone('UTC'));
$dt->sub(new DateInterval("PT1S"));
//make sure the webstream doesn't play past the end time of the show
if ($dt->getTimestamp() > $showEndDateTime->getTimestamp()) {
$dt = $showEndDateTime;
}
$stream_end = Application_Model_Schedule::AirtimeTimeToPypoTime($dt->format("Y-m-d H:i:s"));
$data["media"][$stream_end] = array(

View File

@ -235,20 +235,27 @@ dyn_out = output.icecast(%wav,
mount="test-harbor",
fallible=true)
def set_dynamic_source_id(id) =
current_dyn_id := id
#"Done!"
string_of(!current_dyn_id)
end
# Function to create a playlist source and output it.
def create_dynamic_source(uri) =
# The playlist source
s = input.http(uri)
# The playlist source
s = input.http(uri)
# The output
active_dyn_out = dyn_out(s)
# The output
active_dyn_out = dyn_out(s)
# We register both source and output
# in the list of sources
dyn_sources :=
list.append( [(uri,s),(uri,active_dyn_out)],
!dyn_sources )
"Done!"
# We register both source and output
# in the list of sources
dyn_sources :=
list.append([(uri,s),(uri,active_dyn_out)], !dyn_sources)
notify([("schedule_table_id", !current_dyn_id)])
"Done!"
end
# A function to destroy a dynamic source

View File

@ -21,6 +21,7 @@ set("harbor.bind_addr", "0.0.0.0")
#TODO: Need to create a randomized password for every instance
web_stream = input.harbor("test-harbor",port=8999,password="hackme")
current_dyn_id = ref ''
pypo_data = ref '0'
stream_metadata_type = ref 0
@ -53,6 +54,11 @@ server.register(namespace="vars", "station_name", fun (s) -> begin station_name
server.register(namespace="vars", "bootup_time", fun (s) -> begin time := s s end)
server.register(namespace="streams", "connection_status", fun (s) -> begin "1:#{!s1_connected},2:#{!s2_connected},3:#{!s3_connected}" end)
server.register(namespace="vars", "default_dj_fade", fun (s) -> begin default_dj_fade := float_of_string(s) s end)
server.register(namespace="dynamic_source",
description="Set the cc_schedule row id",
usage="id <id>",
"id",
set_dynamic_source_id)
server.register(namespace="dynamic_source",
description="Start a new dynamic source.",
usage="start <uri>",

View File

@ -374,6 +374,10 @@ class PypoPush(Thread):
tn = telnetlib.Telnet(LS_HOST, LS_PORT)
#dynamic_source.start http://87.230.101.24:80/top100station.mp3
msg = 'dynamic_source.id %s\n' % media_item['row_id']
tn.write(msg)
#TODO: DO we need this?
msg = 'streams.scheduled_play_start\n'
tn.write(msg)
msg = 'dynamic_source.start %s\n' % media_item['uri'].encode('latin-1')