First off, many thanks to all who have helped me so far. You've all helped me come a long way in making our station sound a whole lot better. But, of course, I always want more!

Here's what I want to figure out now:
This is for our station's backstop/auto DJ computer.
1) I want to have a PAL script running that will automatically run the player on encoder start, and stop the player once the encoder stops. (PAL script running constantly)
2) I want to program SAM to automatically play certain mp3's off of our server ("encore" presentations of our DJs' shows) at predetermined times every week. (PAL's triggered by the ES)
3) I want to play a remote stream (syndicated show) at a predetermined time 5 days a week. (PAL triggered by ES)
I'm worried that the scripts might conflict. With the auto run/stop PAL running, will it kick either the remote stream or the mp3 files if the encoder does not start exactly on time (example: if the human DJ does not end the show exactly on time) ?
Here are the scripts for the auto start/stop and the remote show. The remote mp3's will be queued up with the ES, so there really is no script for that.
Thoughts?
Thanks,
Code:
// A Player control script
// by Jeff Sherman (Shermy) 11/11/2004
// This is a script to start the player when the feed starts and stop it if the feed is
// dropped. The purpose is to be able to function as a backup stream but only be
// playing if actually broadcasting, so reports will show only songs actually
// broadcast. Feel free to use and share. I only ask you leave the credits here.
//Set the variables
var P : TPlayer;
var Song : TSongInfo;
var Flag : Integer;
// Start the Loop
PAL.Loop:=True;
Begin;
// The flag is primarily used so I had a value for the until.
Flag :=0;
// Check the status of the encoder. When it starts encoding load a Station ID and
// start the player. (AutoDJ will take it from there)
repeat
If ( Encoders[0].Status='Encoding' )
Then
Begin;
// Load a station ID into Deck A and start the deck, Set the Flag to escape the
// subloop
P :=DeckA;
Song :=Cat['Station IDs (All)'].ChooseSong(smRandom,NoRules);
P.QueueSong(Song);
P.Play;
Flag :=1
end;
until (Flag=1);
// Check the status of the encoder. When it stops encoding stop the active player.
repeat
If ( Encoders[0].Status<>'Encoding')
Then
Begin;
// Determine which Deck is playing and stop it. Set the Flag to excape the
// subloop.
P :=ActivePlayer;
P.Stop;
Flag :=0
end
until (Flag=0)
//Now it goes back and waits for the encoder to start again
end;
Code:
{ About:
This script will play a remote show inside SAM
The show starts via ES trigger, and then ends after a specified length of time.
The script also contains some error-correction code that will attempt to connect to the stream up to 20 times in case it goes down.
We schedule one song between each attempt.
Modified 2008-06-03 by FesterHead from RemoteShow.pal to be scheduled by ES and wait a relative length of time
Usage:
a) Schedule the script via the ES.
b) Change the end time to reflect how long the script should run.
}
{ CONFIGURATION }
{==================================================}
const ShowURL = 'http://nickybbreakfast.hopto.org:8156';
const EndTime = '+05:05:00';
{ IMPLEMENTATION }
{--------------------------------------------------}
var T : Integer;
{Add show to queue}
Queue.Clear;
Queue.AddURL(ShowURL,ipTop);
{Fade to show}
ActivePlayer.FadeToNext;
{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 programmming. That way we will try and reconnect until
the end of the show}
T := 0;
while T < 20 do
begin
Queue.AddURL(ShowURL,ipBottom);
Cat['Station IDs (All)'].QueueBottom(smLRP, EnforceRules);
T := T + 1;
end;
{Wait for show to end}
PAL.WaitForTime(EndTime);
{Clear queue}
Queue.Clear;
{Fade to normal programming}
ActivePlayer.FadeToNext;
{--------------------------------------------------}