{********************************************************************** Live365 60-Second Advert Script PAL Script to play four 60-Second Adverts for Live365 Broadcasters This will only work when the adverts provided by Live365 are added to a Playlist entitled Live365-60 and categorized as Adverts One, 60-second adverts will be added to the top of the queue at the following numbers of minutes past the hour: 10, 20, 40 & 50 Live365 customers must include 4 minutes of adverts each hour No support is provided with this script which is used at your own risk **********************************************************************} PAL.Loop := True; // Loop the PAL Script // Variable Declarations ************************************************************************** var Player1 : TPlayer; // Declare an instance of TPlayer for the Active Player var Player2 : TPlayer = DeckB; // Declare an instance of TPlayer for the Idle Player var CountRep : integer; var AdBreakTotal : integer; var AdCount : integer; // Used to count the number of adverts var P1Track, P2Track, P3Track : TSongInfo; // Declare the TSongInfo Containers // End Of Variable Declarations ******************************************************************** // Declare Adjustable Variables ******************************************************************** CountRep := 1; var AdTotal : integer = 1; // Set the number of adverts to play // End Of Declare Adjustable Variables ************************************************************** While Countrep <5 do begin case CountRep of 1 : PAL.WaitForTime ('XX:10:00'); 2 : PAL.WaitForTime ('XX:20:00'); 3 : PAL.WaitForTime ('XX:40:00'); 4 : PAL.WaitForTime ('XX:50:00'); end; CountRep := CountRep + 1; PAL.LockExecution; // Speed up the Script processing // Check for the Active Player Player1 := ActivePlayer; // Assign the Active Player to Player1 If Player1 = DeckB Then Player2 := DeckA; // Assign the Idle Player to Player 2 // Add the required number of adverts to the top of the queue for AdCount := 1 to AdTotal do begin CAT['Live365-60'].QueueTop(smLRP,NoRules); writeln(AdCount); end; // Capture the Track Information from the Active Player P3Track := ActivePlayer.GetSongInfo; // Count the Adverts while (AdCount < AdTotal) AND (P3Track['songtype'] <> 'S') do begin PAL.WaitForPlayCount(1); // Wait for the Advert to Play P3Track := ActivePlayer.GetSongInfo; // Capture the next Track Information end; // end for the While loop PAL.UnLockExecution; // Return PAL Script processing to normal speed end; // Housekeeping Player1.Free; Player2.Free; P1Track.Free; P2Track.Free; P3Track.Free;