sintonia/3rd_party/pypo/scripts/ls_cue.liq
paul.baranowski 3613812012 Pypo fixes and improvements
General:
 * Moved pypo author info into one file
 * Added two database columns in schedule table: "schedule_group_played"
   and "media_item_played".

API clients:
 * Created get_liquidsoap_data() function which allows you
   to give arbitrary data to liquidsoap.
 * Added documentation
 * Renamed functions to make it more obvious what is happening

pypo_cli:
 * Got rid of more constants that were not needed
 * Created function set_export_source() to reduce code repetition
 * Separated the downloading of the schedule from tracking what has
   been played.  The tracking info is now kept in a separate file.
   This fixes the major bug that the playlist keeps restarting for
   the first minute of playback.
 * converted more print statements to debug statements

pypoTester:
 * Now uses samples from the audio_samples directory, and schedules two
   audio clips back-to-back.
2010-11-29 18:34:22 -05:00

36 lines
No EOL
746 B
Text

# Register the cut protocol
def cue_protocol(arg,delay)
# The extraction program
# cut_file = "#{configure.libdir}/cut-file.py"
cue_script = "./cue_file.py"
# Parse args
ret = string.extract(pattern="cue_in=(\d+)",arg)
start =
if list.length(ret) == 0 then
"0"
else
ret["1"]
end
ret = string.extract(pattern="cue_out=(\d+)",arg)
stop =
if list.length(ret) == 0 then
"0"
else
ret["1"]
end
ret = string.extract(pattern=":(.*)$",arg)
uri =
if list.length(ret) == 0 then
""
else
ret["1"]
end
x = get_process_lines("#{cue_script} #{quote(uri)} #{start} #{stop}")
if list.hd(x) != "" then
([list.hd(x)],[])
else
([uri],[])
end
end
add_post_processor("cue_file", temporary=true, cue_protocol)