Opdracht in PAL, wat doet dit ?

Voor vragen over Playlist Automation Language.
Plaats reactie
Gebruikersavatar
Borg
Beheerder
Berichten: 488
Lid geworden op: 25 jun 2006, 16:54
SAM-versie: 2.8.0.
Database: MySQL
Windows: 10
Locatie: Het Westland
Contacteer:

Opdracht in PAL, wat doet dit ?

Ongelezen bericht door Borg »

Stukje uit mijn aangepaste PAL van Kees, mijn vraag is wat doet dit..(het vetgedrukte)

while DayOfWeek(Now) = Saturday and ((Now >= T['22:59:37']) and (Now <= T['22:59:42'])) do

var QueueTime : Integer = (60*60*1300);
While Queue.Duration < QueueTime do


Jos
ʎɐqǝ uo pɹɐoqʎǝʞ ɐ ʎnq ı ǝɯıʇ ʇsɐן ǝɥʇ sı sıɥʇ
Gebruikersavatar
Kees
Beheerder
Berichten: 3186
Lid geworden op: 28 nov 2005, 22:07
SAM-versie: 4.2.2.*
Database: MySQL
Windows: 11
Locatie: Bergen op Zoom
Contacteer:

Re: Opdracht in PAL, wat doet dit ?

Ongelezen bericht door Kees »

Code: Selecteer alles

while ((Now >= T['22:59:37']) and (Now <= T['22:59:42'])) do
begin
var QueueTime : Integer = (60*60*1300);
While Queue.Duration < QueueTime do 
bla..bla..bla..
end;
Dit betekent dat er tussen 22:59:37 en 22:59:42 +/- 70 minuten muziek uit een of meerdere cat. in de queue wordt geplaatst.

Code: Selecteer alles

var QueueTime : Integer = (60*60*1300);
While Queue.Duration < QueueTime do 
begin
Cat['80s'].QueueBottom(smLRP, EnforceRules);
end;
betekent dus 1 uur lang alleen de 80s.
Hier kun je dus ook meerdere cat. in verwerken.
Gebruikersavatar
Borg
Beheerder
Berichten: 488
Lid geworden op: 25 jun 2006, 16:54
SAM-versie: 2.8.0.
Database: MySQL
Windows: 10
Locatie: Het Westland
Contacteer:

Re: Opdracht in PAL, wat doet dit ?

Ongelezen bericht door Borg »

waaroom tussen die twee tijden ?
en wat doe je met 60 60 1300 ?

heb hem verder al klaargemaakt met mijn cat..


En ik heb hem net getest en hij werkt, althans zolang ik de PAL 'titllestreambanner' uit zet

deze dus:

Code: Selecteer alles

{ ABOUT:
    Script to change title displayed in listener's streaming player.
    This script will read a banner text source file to get a list of
    messages to display, then switch between the normal song information
    and the banner text on regular intervals.
    
    Not only does this make for a more interesting experience for listeners,
    it also prevents stream rippers from being able to make copies of your
    tracks.
    
  USAGE:
    a) Create a normal plain text file and type your banner messages into this file.
       Each new line should contain one new banner message.
    b) Change the configuration settings below to point to your file and
       specify the interval to wait between changes.
}
    
{ CONFIGURATION }
{==================================================}
const bannertext_file = 'C:\Program Files\SpacialAudio\SAMBC\PAL\BannerText.txt';
const change_interval = '+00:00:45';
{==================================================}


{ IMPLEMENTATION }
{--------------------------------------------------}
var CurSong : TSongInfo;
var UpdSong : TSongInfo;
var Banners : TStringList;
var Toggle  : Boolean = True;
var LinePos : Integer = 0;

{Set this script to restart itself}
PAL.Loop := True;

{ Create some objects that we will need}
UpdSong := TSongInfo.Create;
Banners := TStringList.Create;

{ Load banner lines into stringlist object }
if FileExists(bannertext_file) then
 Banners.LoadFromFile(bannertext_file)
else
 WriteLn('Banner source file does not exist!');
 
LinePos := 0;
while (LinePos<Banners.Count) do
begin
  {Wait for specified time}
  PAL.WaitForTime(change_interval);
  
  {Retrieve the current banner line and assign it to song object}
  UpdSong['title'] := Banners[LinePos];
  
  {Tell encoders to update song information:
    When Toggle is True, we use the normal song information from
    the active player - otherwise we use our banner song object
  }
  Toggle := not Toggle;
  if Toggle then
   begin
    CurSong := ActivePlayer.GetSongInfo;
     Encoders.SongChange(CurSong);
    CurSong.Free;
   end
  else
    Encoders.SongChange(UpdSong);

  {Move to the next line in the banner file before we continue}
  LinePos := LinePos + 1;
end;

{Destroy objects once we no longer need them}
Banners.Free;
UpdSong.Free;
{--------------------------------------------------}

Kan ik (of jij) die eventueel inplenteren in die voorbeeld PAL ?




Jos
ʎɐqǝ uo pɹɐoqʎǝʞ ɐ ʎnq ı ǝɯıʇ ʇsɐן ǝɥʇ sı sıɥʇ
Gebruikersavatar
Kees
Beheerder
Berichten: 3186
Lid geworden op: 28 nov 2005, 22:07
SAM-versie: 4.2.2.*
Database: MySQL
Windows: 11
Locatie: Bergen op Zoom
Contacteer:

Re: Opdracht in PAL, wat doet dit ?

Ongelezen bericht door Kees »

60X60x1300=680000 ms.
Dan het volgende....
Even een poging wagen om het exact uit te leggen.
Met het commando

Code: Selecteer alles

PAL.Loop:=True;
blijft het PAL script continu in een loop draaien.
Hoe groter je PAL script, hoe langer hij er over doet om het script te doorlopen.
Tenzij je de commando's

Code: Selecteer alles

PAL.Lockexecution;
en

Code: Selecteer alles

PAL.UnLockExecution;
gebruikt.
Dan vliegt hij er doorheen.

Wanneer je de tijd in zou stellen op

Code: Selecteer alles

...((Now = T['22:59:37']) 
zou hij er over schieten als hij niet op dit exacte tijdstip een bepaald deel van het script moet runnen.
Daarom de marge

Code: Selecteer alles

...((Now >= T['22:59:37']) and (Now <= T['22:59:42'])) 
van 5 seconden.
Dit is meestal genoeg maar je kan de marge ook hoger in stellen.
Hier moet je ook weer mee opassen want stel, je wilt alleen een jingle van 3 seconden laten draaien dan zou het script deze weer een keer draaien als hij weer in de loop gaat en dus weer binnen die tijdmarge op dit deel van het script terecht komt.
Daarom moet je dit opvangen door een

Code: Selecteer alles

PAL.WaitForTime(T['+00:00:15']); 
aan het eind van je scriptdeel te plaatsen.
In onderstaand voorbeeld script zie je ongeveer wat ik bedoel.
Dit is een script wat hier de klapper van de week draait en tevens extra informatie naar de encoders stuurt..
In dit geval gaat het altijd goed omdat er 2 nummers gewacht wordt alvoor het script weer opnieuw in een loop gaat.(PAL.WaitForPlayCount(2);)

Code: Selecteer alles

PAL.Loop:=True;
PAL.LockExecution;
while ((Now >= T['08:58:27']) and (Now <= T['08:58:33'])) or
      ((Now >= T['11:58:27']) and (Now <= T['11:58:33'])) or
      ((Now >= T['17:58:27']) and (Now <= T['17:58:33'])) or
      ((Now >= T['21:28:27']) and (Now <= T['21:28:33'])) do
begin
PAL.UnlockExecution;
Queue.AddList('c:\playlisten\klapper.m3u',ipTop);
PAL.WaitForPlayCount(2);
var Song : TSongInfo;
var myCurrentSong : TSongInfo;
myCurrentSong := ActivePlayer.GetSongInfo;
Song := TSongInfo.Create;
myCurrentSong['artist']; Song['title']  := myCurrentSong['combine']+' (DE KLAPPER VAN DE WEEK)';
Encoders.SongChange(Song);
Song.Free;
PAL.WaitForTime(T['+00:00:15']);
PAL.LockexeCution;
end;
PAL.UnlockExecution;
Ik hoop dit ik het duidelijk heb uitgelegd zo !
Gebruikersavatar
Borg
Beheerder
Berichten: 488
Lid geworden op: 25 jun 2006, 16:54
SAM-versie: 2.8.0.
Database: MySQL
Windows: 10
Locatie: Het Westland
Contacteer:

Re: Opdracht in PAL, wat doet dit ?

Ongelezen bericht door Borg »

Fantastico.nl nou snap ik die 60 60 1300 en die dubbele tijden, je moet
het maar weten toch ?

Alleen nog graag even over bovenstaand palletje, als ik deze naast de
grote 'week' PAL laat draaien dan doet de 'week' PAL het niet.
Dus dat script staat nu uit, misschien een ideetje ?


Jos
ʎɐqǝ uo pɹɐoqʎǝʞ ɐ ʎnq ı ǝɯıʇ ʇsɐן ǝɥʇ sı sıɥʇ
brian

Re: Opdracht in PAL, wat doet dit ?

Ongelezen bericht door brian »

Hallo

Ik zoek ook nog zo'n soort script, maar dan moet hij er zo uit zien.

muziek uit cat (?)
zondag's van 08:59:55 tot 10:59:55
Daarna moet de server het weer overnemen.

Weten jullie daar een script voor..

brian
brian

Re: Opdracht in PAL, wat doet dit ?

Ongelezen bericht door brian »

Of kan ik dit script van Kees gebruiken, volgens mij moet dit lukken, dan start ik hem met de eventschedule..

Code: Selecteer alles

while ((Now >= T['08:59:53']) and (Now <= T['11:59:57'])) do
begin
PAL.UnlockExecution;
Queue.AddFile(naam van de cat);
ActivePlayer.FadeToNext;
Queue.Clear;
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
PAL.Lockexecution;
end;
Gebruikersavatar
Kees
Beheerder
Berichten: 3186
Lid geworden op: 28 nov 2005, 22:07
SAM-versie: 4.2.2.*
Database: MySQL
Windows: 11
Locatie: Bergen op Zoom
Contacteer:

Re: Opdracht in PAL, wat doet dit ?

Ongelezen bericht door Kees »

Radio de Glazen Stad schreef:Fantastico.nl nou snap ik die 60 60 1300 en die dubbele tijden, je moet
het maar weten toch ?

Alleen nog graag even over bovenstaand palletje, als ik deze naast de
grote 'week' PAL laat draaien dan doet de 'week' PAL het niet.
Dus dat script staat nu uit, misschien een ideetje ?


Jos
Dat klopt..
2 PAL scripts met het while commando werkt niet.
Deze zul je moeten samenvoegen tot 1 PAL script !
Gebruikersavatar
Kees
Beheerder
Berichten: 3186
Lid geworden op: 28 nov 2005, 22:07
SAM-versie: 4.2.2.*
Database: MySQL
Windows: 11
Locatie: Bergen op Zoom
Contacteer:

Re: Opdracht in PAL, wat doet dit ?

Ongelezen bericht door Kees »

brian schreef:Of kan ik dit script van Kees gebruiken, volgens mij moet dit lukken, dan start ik hem met de eventschedule..


while ((Now >= T['08:59:53']) and (Now <= T['11:59:57'])) do
begin
PAL.UnlockExecution;
Queue.AddFile(naam van de cat);
ActivePlayer.FadeToNext;
Queue.Clear;
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
Cat['Dance'].QueueBottom(smLemmingLogic, EnforceRules);
PAL.Lockexecution;
end;
Als ik jou goed begrijp wil jij dat er op zondag Dance gedraait wordt van 09:00 tot 12:00 ?
brian

Re: Opdracht in PAL, wat doet dit ?

Ongelezen bericht door brian »

Kees

Ik had niet gezien dat er "dance" stond, ik kan toch een willigekeurige cat invullen. De cat heet "apcsradio slowjams" waar ik de muziek uit wil gaan laten draaien.

brian
Gebruikersavatar
Kees
Beheerder
Berichten: 3186
Lid geworden op: 28 nov 2005, 22:07
SAM-versie: 4.2.2.*
Database: MySQL
Windows: 11
Locatie: Bergen op Zoom
Contacteer:

Re: Opdracht in PAL, wat doet dit ?

Ongelezen bericht door Kees »

Uiteraard !
brian

Re: Opdracht in PAL, wat doet dit ?

Ongelezen bericht door brian »

Maar dat scriptje hier boven, is wel compleet. De server neemt het weer over tegen 12:00 uur.
Plaats reactie
  • Vergelijkbare Onderwerpen
    Reacties
    Weergaves
    Laatste bericht