Skip to content

Instantly share code, notes, and snippets.

Created March 19, 2013 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5198616 to your computer and use it in GitHub Desktop.
Save anonymous/5198616 to your computer and use it in GitHub Desktop.
metadata
#auth function
def dj_auth(user,password) =
#get the output of the php script
ret = get_process_lines("./dj_auth.rb #{user} #{password}")
#ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown"
ret = list.hd(ret)
#return true to let the client transmit data, or false to tell harbor to decline
if ret != "false" then
ignore(icy_update("title=LIVE #{user},artist=datafruits.fm"))
true
else
false
end
end
def log_metadata(m)
log("metadata changed")
end
# The file source
backup_playlist = playlist(reload=600,"~/grimeyblimey.m3u",conservative=true)
output.dummy(fallible=true,backup_playlist)
live_dj = input.harbor("datafruits",port=9000,auth=dj_auth)
on_fail = single("/home/tony/samples/vox/datafruitsdotfm_processed.wav")
ads = playlist("~/ads.m3u",conservative=true)
source = on_metadata(log_metadata, source)
source = fallback(track_sensitive=false,
#transitions=[transition(ads)],
[live_dj,backup_playlist,on_fail])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment