2 PAL scripts samenvoegen

Voor vragen over Playlist Automation Language.
Plaats reactie
Jimboe

2 PAL scripts samenvoegen

Ongelezen bericht door Jimboe »

Hallo allemaal,

Dankzij dit geweldige forum heb ik in no time een mooie stream met SAM op weten te zetten.
Maar toch kom ik niet overal uit :wink:

Ik gebruik nu dit welbekende PAL script voor teksten in de titel:

Code: Selecteer alles

PAL.Loop := True;

var Song : TSongInfo;

PAL.WaitForTime('+00:00:20');

Song := TSongInfo.Create;
Song['title'] := 'eigen muziek uploaden? zie www.striem.nl';
Encoders.SongChange(Song);
Song.Free;

PAL.WaitForTime('+00:00:07');

if ActivePlayer <> nil then
Encoders.SongChange(ActivePlayer.GetSongInfo);

PAL.WaitForTime('+00:00:20');

Song := TSongInfo.Create;
Song['title'] := 'striemende radio, om u geheel te vreden';
Encoders.SongChange(Song);
Song.Free;

PAL.WaitForTime('+00:00:07');

if ActivePlayer <> nil then
Encoders.SongChange(ActivePlayer.GetSongInfo);
 
PAL.WaitForTime('+00:00:20');

Song := TSongInfo.Create;
Song['title'] := 'hou je van langzaam wakker worden bij je croissantje?';
Encoders.SongChange(Song);
Song.Free;

PAL.WaitForTime('+00:00:07');

Song := TSongInfo.Create;
Song['title'] := 'luister dan elke zondag vanaf 12:00 naar Gloomy Sunday';
Encoders.SongChange(Song);
Song.Free;

PAL.WaitForTime('+00:00:07');
En die wil ik graag samen gebruiken met het bekende script voor request-tekstjes in de titel

Code: Selecteer alles

{
  Insert Request Dedication information into encoded stream : script by Xgeek (aka Xgeek)
  $Id: Inject Request Dedication.PAL,v 0.05 2004/11/12

  * This script would not have been possible without the help from FesterHead. Thank You!!!

  What this PAL does:
    * On song change checks to see if the song was requested, and if it was:
    * If no dedication information it will inject ~Requested~ in the title stream after Artist - Title
    * If dedication information it will inject ~Requested by <Name> : Who had this to say:- <Message>~ in the title stream after Artist - Title


  What is configurable:
    * Nothing


  PAL built to run continuously:
    * Switch to a desktop with the 'PAL Scripts' window visible

    * Click '+' (Add new PAL script)

    * Check the 'Automatically start script' box

    * Click the folder icon and navigate to this script

    * Click 'OK'

    * Highlight PAL and click 'Start selected PAL script' (VCR type play button)

    * Save settings by clicking the 'File' menu item and selecting 'Save Configuration'
}

PAL.Loop := True;

WriteLn('New song started');

WriteLn('Waiting 5 Seconds before checking if it is a Request');
// Wait a few seconds just in case this song is a Jingle. If it is, and it is under 10 seconds the script will still get the correct info for the song after.
PAL.WaitForTime(T['+00:00:05']); //Wait 5 secs
PAL.LockExecution;

// Instantiate a Song Info object
var Song : TSongInfo;
Song := TSongInfo.Create;

WriteLn('Checking if song has been Requested......');
if ((ActivePlayer.GetSongInfo['requestID']) = 0) then WriteLn('Song is not a Request');

// Check if current song has a request ID
if ((ActivePlayer.GetSongInfo['requestID']) > 0) then
  Begin
      WriteLn('Song is a Request');
      var reqInfo : TDataSet = Query('SELECT name, msg FROM requestlist WHERE id = ' + ActivePlayer.GetSongInfo['requestID'], [], true);
      var Requested_by : String = reqInfo['name'];
      var Dedication_Message : String = reqInfo['msg'];
      reqInfo.Free;

      If (Requested_by = '') then Requested_by := 'Anonymous';
      If (Dedication_Message = '') then Dedication_Message := 'Nothing...';

      If ((Requested_by = 'Anonymous') and (Dedication_Message = 'Nothing...')) then
         Begin
           WriteLn('Song is a Request without Dedication');
           WriteLn(Requested_by); // This should aways echo Anonymous
           WriteLn(Dedication_Message); // This should aways echo Nothing...
           Song['artist'] := ActivePlayer.GetSongInfo['artist'] + ' - ' + ActivePlayer.GetSongInfo['title'];
           Song['title'] := '~Verzoekje~';
           Encoders.SongChange(Song);
         End
     else
         Begin
           WriteLn('Song is a Request with a Dedication');
           WriteLn(Requested_by);
           WriteLn(Dedication_Message);
           Song['artist'] := ActivePlayer.GetSongInfo['artist'] + ' - ' + ActivePlayer.GetSongInfo['title'];
           Song['title'] := 'Aangevraagd door ' + Requested_by + '"' + Dedication_Message + '"';
           Encoders.SongChange(Song);
        End;
  End;

PAL.UnlockExecution;
WriteLn('Done....');

Song.Free;

WriteLn('Waiting for next song to start');
PAL.WaitForPlayCount(1); {Wait for 1 songs to play}
Wat ik graag zou willen, is dat deze worden samengevoegd, zodat tussen de tekstjes door de request toevoeging zichtbaar is als er een request wordt gedraaid. Is dat mogelijk? Mij lukt het niet...
Jimboe

Re: 2 PAL scripts samenvoegen

Ongelezen bericht door Jimboe »

Wat ook mag: Als een liedje een request is, hoeven de tekstjes tussendoor niet te verschijnen. Dit lijkt me qua script ook makkelijker te realiseren.
Jimboe

Re: 2 PAL scripts samenvoegen

Ongelezen bericht door Jimboe »

Zul je altijd zien: na de vraag hier te hebben gesteld is het me gelukt!

Code: Selecteer alles

PAL.Loop := True;

WriteLn('New song started');

WriteLn('Waiting 5 Seconds before checking if it is a Request');
// Wait a few seconds just in case this song is a Jingle. If it is, and it is under 10 seconds the script will still get the correct info for the song after.
PAL.WaitForTime(T['+00:00:05']); //Wait 5 secs
PAL.LockExecution;

// Instantiate a Song Info object
var Song : TSongInfo;
Song := TSongInfo.Create;

WriteLn('Checking if song has been Requested......');
if ((ActivePlayer.GetSongInfo['requestID']) = 0) then WriteLn('Song is not a Request');

// Check if current song has a request ID
if ((ActivePlayer.GetSongInfo['requestID']) > 0) then
  Begin
      WriteLn('Song is a Request');
      var reqInfo : TDataSet = Query('SELECT name, msg FROM requestlist WHERE id = ' + ActivePlayer.GetSongInfo['requestID'], [], true);
      var Requested_by : String = reqInfo['name'];
      var Dedication_Message : String = reqInfo['msg'];
      reqInfo.Free;

      If (Requested_by = '') then Requested_by := 'Anonymous';
      If (Dedication_Message = '') then Dedication_Message := 'Nothing...';

      If ((Requested_by = 'Anonymous') and (Dedication_Message = 'Nothing...')) then
         Begin
           WriteLn('Song is a Request without Dedication');
           WriteLn(Requested_by); // This should aways echo Anonymous
           WriteLn(Dedication_Message); // This should aways echo Nothing...
           Song['artist'] := ActivePlayer.GetSongInfo['artist'] + ' - ' + ActivePlayer.GetSongInfo['title'];
           Song['title'] := '~Verzoekje~';
           Encoders.SongChange(Song);
           WriteLn('Waiting for next song to start');
           PAL.WaitForPlayCount(1); {Wait for 1 songs to play}
         End
     else
         Begin
           WriteLn('Song is a Request with a Dedication');
           WriteLn(Requested_by);
           WriteLn(Dedication_Message);
           Song['artist'] := ActivePlayer.GetSongInfo['artist'] + ' - ' + ActivePlayer.GetSongInfo['title'];
           Song['title'] := 'Aangevraagd door ' + Requested_by + '. "' + Dedication_Message + '"';
           Encoders.SongChange(Song);
           WriteLn('Waiting for next song to start');
           PAL.WaitForPlayCount(1); {Wait for 1 songs to play}
        End;
  End;
  


PAL.UnlockExecution;
WriteLn('Done....');

Song.Free;

PAL.WaitForTime('+00:00:03');

Song := TSongInfo.Create;
Song['title'] := 'striemende radio. om u geheel te vreden.';
Encoders.SongChange(Song);
Song.Free;

PAL.WaitForTime('+00:00:05');

if ActivePlayer <> nil then
Encoders.SongChange(ActivePlayer.GetSongInfo);

PAL.WaitForTime('+00:00:07');

Song := TSongInfo.Create;
Song['title'] := 'eigen muziek uploaden? zie www.striem.nl';
Encoders.SongChange(Song);
Song.Free;

PAL.WaitForTime('+00:00:05');

if ActivePlayer <> nil then
Encoders.SongChange(ActivePlayer.GetSongInfo);
 
PAL.WaitForTime('+00:00:07');

Song := TSongInfo.Create;
Song['title'] := 'striemende radio. in elk geval minder erg dan ingegroeide teennagels.';
Encoders.SongChange(Song);
Song.Free;

PAL.WaitForTime('+00:00:05');

if ActivePlayer <> nil then
Encoders.SongChange(ActivePlayer.GetSongInfo);
Als er een verzoekje gedraaid wordt, blijft de titel van de plaat constant in beeld met evt. het ingevulde tekstje. Als het geen verzoekje is, rouleren de andere teksten continu. Als er 2 verzoekjes achter elkaar komen, maakt ie eerst het rondje met teksten af voor ie weer bovenaan begint. Als er iemand is die daar iets op weet...? (is niet zo belangrijk)
Plaats reactie
  • Vergelijkbare Onderwerpen
    Reacties
    Weergaves
    Laatste bericht