Note that this Wiki is a work in progress, items may not be updated or may disappear entirely as the pages are updated.

PAL to play an album from track 1 to track N

From SpacialAudio

Jump to: navigation, search

PAL script to play a whole album (cd for you young ones) from track 1 to track N. The PAL below runs at 6pm Wednesday and 6pm Friday.

Feel free to massage as necessary for your station.

The version servicing FesterHead Radio can be found at: http://www.festerhead.com/PAL/album%20concert%20show.pal

All the PAL scripts servicing FesterHead Radio can be found at: http://www.festerhead.com/samweb/pals.php

Note: The versions servicing my station may not be compatible with your station.

An enhancement in the future:

  • Use native SAM2 song selection methods instead of the SQL query.
  • Discern between studio and live albums
*** PAL START ***
// Don't be a dick.  Leave this here.
// Album/Concert Show script by FesterHead (fester@festerhead.com)
// Version 1.1 05/15/2003
//
// Plays a whole album from track 1 to track N
// Declare variables
var theAlbumChooser, theSongList : TDataSet;
var theArtist, theAlbum : String;
// Keep da bugger goin!
PAL.Loop := True;
// Wait for the designated time
if ((now >= T['18:00:00']) and (now <= T['18:00:30']) and (DayOfWeek(Now) = Wednesday)) or
  ((now >= T['18:00:00']) and (now <= T['18:00:30']) and (DayOfWeek(Now) = Friday)) then
 begin
   theAlbumChooser := Query('select *' +
     ' from songlist' +
     ' where songtype = S' +
     ' order by rand() limit 1',[],True);
   WriteLn('Album Show:');
   WriteLn(theAlbumChooser['artist']);
   WriteLn(theAlbumChooser['album']);
   WriteLn();
   theArtist := theAlbumChooser['artist'];
   theAlbum := theAlbumChooser['album'];
   WriteLn('Songs (in reverse order):');
   theSongList := Query('select *' +
     ' from songlist' +
     ' where album = ' + QuotedStr(theAlbumChooser['album']) +
     ' and trackno > 0 ' +
     ' order by trackno desc',[],True);
   // Move pointer to the first record
   theSongList.First;
   while not theSongList.EOF do
     begin
       WriteLn(theSongList['title']);
       Queue.AddFile(theSongList['filename'], ipTop);
       theSongList.Next;
     end;
   theAlbumChooser.Free;
   theSongList.Free;
   // Let's wait for two songs to play...  just in case
   PAL.WaitForPlayCount(2);
end;*** PAL END ***
Personal tools