Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
denise 2012-08-01 15:00:54 -04:00
commit 40ebeb7fb4
4 changed files with 47 additions and 23 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,6 +235,12 @@ 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
@ -246,8 +252,9 @@ def create_dynamic_source(uri) =
# We register both source and output
# in the list of sources
dyn_sources :=
list.append( [(uri,s),(uri,active_dyn_out)],
!dyn_sources )
list.append([(uri,s),(uri,active_dyn_out)], !dyn_sources)
notify([("schedule_table_id", !current_dyn_id)])
"Done!"
end

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,8 +374,13 @@ 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')
self.logger.debug(msg)
tn.write(msg)