Skip to Content
It is currently August 25th, 2019, 12:28 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Conflict Among PALs?
PostPosted: November 15th, 2008, 12:25 pm 
Offline
Senior User
Senior User

Joined: May 1st, 2008, 8:24 pm
Posts: 151
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;

{--------------------------------------------------}


Top
 Profile  
Reply with quote  
 Post subject: Re: Conflict Among PALs?
PostPosted: November 19th, 2008, 12:14 pm 
Offline
SVS Member
SVS Member

Joined: October 15th, 2003, 11:59 pm
Posts: 4730
Location: Los Angeles - A Little West Of Nashville
Since you are throwing this right into the player and then starting it, yes, it will kick off whatever is playing.

You just have to check somehow to see if the human show is finished.

I usually write out to a data set on what show is playing. Then I wait until it is finished before I perform the task that needs to be done.

_________________
- DJ Dee
- Spacial Volunteer Support (SVS)
- Custom PAL services: www.palscripts.com
- http://www.AlternativeHD.com
- http://www.lahotcountry.com


Top
 Profile  
Reply with quote  
 Post subject: Re: Conflict Among PALs?
PostPosted: November 19th, 2008, 1:04 pm 
Offline
Senior User
Senior User

Joined: May 1st, 2008, 8:24 pm
Posts: 151
It'll throw off the Human DJ even though both the human and this computer are broadcasting remotely, and sending to our shoutcast server? This computer has never been able to override the stream, even when I've tried to do it manually.

Performing a "data set"?

Not sure I'm following here...


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group