Hello. I'm trying to make a script that will play a jingle ebfore playing any other track.
/ Playlist script by DarthMan™
// define current/next song, active player variables
var iCurrentSong, iNextSong : TSongInfo;
var iActivePlayer : TPlayer;
var bPlayListGenerated : Boolean = False;
// continuous loop
pal.loop := True;
// lock pal execution
iActivePlayer := ActivePlayer;
iCurrentSong := iActivePlayer.GetSongInfo;
iNextSong := Queue.NextInQueue;
// if current song is not null and is type song, not jingle etc and there is no next track
if iCurrentSong <> nil then
if ((iCurrentSong['songtype'] = 'S') and (iNextSong = nil)) then
Cat['Jingles (All)'].QueueBottom(smRandom, NoRules);
bPlayListGenerated := ((iCurrentSong <> nil) and (iNextSong <> nil));
//unlock pal execution
//free the variables if the playlist was generated
if bPlayListGenerated = True then
//wait for count
Pal.WaitForPlayCount(1); //Restart after 1 play
What could be wrong?
It works, then 2nd time it doesn,t 3rd time it works again etc.