Note that this Wiki is a work in progress, items may not be updated or may disappear entirely as the pages are updated.

Remote live show on Friday nights

From SpacialAudio

Jump to: navigation, search

A modified version of the remote live show script that I use for streaming a live show every Friday night from 9:00 PM to 10:30 PM. You will need to edit it to your needs.

 { CONFIGURATION }
 {================================================= =}
const ShowURL = 'http://url:port'; //<-- MODIFY URL const StartTime = '21:00:00'; //<-- MODIFY START TIME const EndTime = '22:30:00'; //<-- MODIFY END TIME
{ IMPLEMENTATION } {--------------------------------------------------} {Set the day of week. The time prevents the script from starting the show again after it ends.} var DOW : Boolean; DOW := (DayOfWeek(Now) = Friday) and (now < T['22:29:00']);
var C : Integer; PAL.Loop := True;
{Wait for our set day.} while DOW do begin
{Wait for the show to start} PAL.WaitForTime(StartTime);
{Add show to queue} Queue.Clear; Queue.AddURL(ShowURL,ipTop);
{Fade to show} ActivePlayer.FadeToNext;
{Set stream info} var Song : TSongInfo; Song := TSongInfo.Create;
Song['artist'] := 'Artist'; Song['title']  := 'Title'; Song['duration'] := 90*60*1000; {90 minutes}
Encoders.SongChange(Song);
{Precautions - if there is a brief disconnect or server problem, then we would want to retry a few times to get back to the show. To do this we place the URL quite a few times in the queue, followed by some normal programming. That way we will try and reconnect until the end of the show}
C := 1; while C < 20 do begin Queue.AddURL(ShowURL,ipBottom); CAT['Music (All)'].QueueBottom(smLRP,EnforceRules); C := C + 1; end;
{Wait for show to end} PAL.WaitForTime(EndTime);
{Clear queue} Queue.Clear;
{Fade to normal programming} ActivePlayer.FadeToNext;
end;
{--------------------------------------------------}
Personal tools