Created
March 19, 2013 18:14
-
-
Save anonymous/5198616 to your computer and use it in GitHub Desktop.
metadata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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