Jump to content

PAL Question - Night jingels.


Man0r

Recommended Posts

ok.

 

Now i have pal script that every 4 songs - Play (1) Jingle from the folder "Sweepers_day".

 

I want to do a PAL script that will make the same thing, but in the night it will take from folder name "Sweepers_night" and not from the normal folder ("Sweepers_day").

 

 

It is possible?

 

 

(sorry for my bad english. :sad:)

Link to comment
Share on other sites

hi, this is the PAL code:

 

PAL.Loop := True;
PAL.WaitForPlayCount(28);
CAT['sweepers_day'].QueueTop(smLemmingLogic, NoRules);

 

basically the code play every 28 songs - 1 file from the folder "sweepers_day".

 

But I want that at night (Midnight - 10:00[in the morning]) the PAL script will take from the folder "sweepers_night".

 

I didnt write the PAL SCRIPT, I dont understand programming.

 

thanks

Link to comment
Share on other sites

Since it might take 2 hours to play 28 tracks are you sure you want to wait that long between sweepers?

...anyway give this a try. This PAL compiles but not tested live.

 

PAL.Loop := True;
PAL.WaitForPlayCount(28);

var Present: DateTime;
var Year, Month, Day, Hour, Min, Sec, MSec: Integer;
Present:= Now;
DecodeTime(Present, Hour, Min, Sec, MSec);

if (Hour  begin
     CAT['sweepers_night'].QueueTop(smLemmingLogic, NoRules);
 end
 else
 begin
     CAT['sweepers_day'].QueueTop(smLemmingLogic, NoRules);
end;

http://5280jazz.com/nowplaying_image/5280jazz.png

Rob Oyler

5280 Jazz

Link to comment
Share on other sites

or try this one, I think it also would work


Pal.Loop:=True;

   Pal.LockExecution;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
var Begintijd    : string = '00:00:01'; // Starting time
var Eindtijd     : string = '09:59:59'; // End time
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




while ((Now >= T[begintijd]) and (Now 

  Begin
PAL.WaitForPlayCount(28);
CAT['sweepers_night'].QueueTop(smLemmingLogic, NoRules);
 end
   else
Begin
CAT['sweepers_day'].QueueTop(smLemmingLogic, NoRules);
 end;
ActivePlayer.FadeTonext;

PAL.WaitForTime(T[Eindtijd]);
ActivePlayer.FadeTonext;


end;

// Keep this line always at the end.
 Pal.UnLockExecution; 

Link to comment
Share on other sites

or try this one, I think it also would work


Pal.Loop:=True;

   Pal.LockExecution;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
var Begintijd    : string = '00:00:01'; // Starting time
var Eindtijd     : string = '09:59:59'; // End time
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




while ((Now >= T[begintijd]) and (Now 

  Begin
PAL.WaitForPlayCount(28);
CAT['sweepers_night'].QueueTop(smLemmingLogic, NoRules);
 end
   else
Begin
CAT['sweepers_day'].QueueTop(smLemmingLogic, NoRules);
 end;
ActivePlayer.FadeTonext;

PAL.WaitForTime(T[Eindtijd]);
ActivePlayer.FadeTonext;


end;

// Keep this line always at the end.
 Pal.UnLockExecution; 

 

No, that isn't a good solution.

 

1- The way you have it set it, it will run through once, and then wait for 09:59:59 ... which means it wait for hours and hours ..

 

2- You have UNLOCKED the PAL script after the WAIT, which means that you have it locked for up to 10 hours. It should be unlocked immediately after the processing.

Spacial SVS Support Team

http://support.spacialaudio.com/forums/

Get help with PAL Scripts at http://www.palscripts.com

Link to comment
Share on other sites

No, that isn't a good solution.

 

1- The way you have it set it, it will run through once, and then wait for 09:59:59 ... which means it wait for hours and hours ..

 

2- You have UNLOCKED the PAL script after the WAIT, which means that you have it locked for up to 10 hours. It should be unlocked immediately after the processing.

It's possible but it works on my server, the only difference is that I use an subdir command in stead of CAT.

Link to comment
Share on other sites

To lock / unlock, you do it so SAM is locked for the shortest amount of time, like this:

 

PAL.Loop := true;

//
// If between Midnight and 10 AM then pick from Sweepers Night
//  If between 10 AM and Midnight pick from Sweepers Day
//


//
// Lock the execution to make script run faster
//

PAL.LockExecution;

// Check the time

if (Now > T['00:00:00'] ) and (Now 
 begin
   CAT['sweepers_night'].QueueTop(smLemmingLogic, NoRules);
 end
else
 begin
   CAT['sweepers_day'].QueueTop(smLemmingLogic, NoRules);
end;

// Immediately Unlock the execution

PAL.UnLockExecution;

// Play songs and wait for next Liner

PAL.WaitForPlayCount(28);

SCS - Dedicated Bandwidth Servers

Shoutcast / Icecast / Windows Media

Transcoding - Auto DJ - Mobile Radio - FLASH Players - Auto DJ

Broadcasting World's Stream Host of the Month

Link to comment
Share on other sites

Here ya go:

PAL.Loop := True;
PAL.WaitForPlayCount(28);

var Present: DateTime;
var Year, Month, Day, Hour, Min, Sec, MSec: Integer;
Present:= Now;
DecodeTime(Present, Hour, Min, Sec, MSec);

if (Hour  begin
     CAT['sweepers_night'].QueueTop(smLemmingLogic, NoRules);
 end
 else
 begin
  if DayOfWeek(Now) = Friday then
   begin
     CAT['sweepers_friday'].QueueTop(smLemmingLogic, NoRules);
   end
   else
     CAT['sweepers_day'].QueueTop(smLemmingLogic, NoRules);
end;

http://5280jazz.com/nowplaying_image/5280jazz.png

Rob Oyler

5280 Jazz

Link to comment
Share on other sites

  • 2 months later...
I found that using the event schedular is sometimes easier...making a new clockwheel and scheduling music and jingles.

Mark Evans (AKA CountryJock)

A1-Country Radio

If You Like The Work That Has Been Done For You, Please Consider A Donation Here:

If I Did Work That Required A Donation, It Can Be Sent Here Too:

 

If you like Country Music...Feel Free To Visit My Station:

www.wix.com/a1country/homepage

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...