We are in the process of migrating the Spacial Wiki content to our new Help Center at spacial.com.
Please visit the Help Center for latest Tips and Tricks, Documentation and Troubleshooting.

How to play Top10 requests at a certain time?

From SpacialAudio

Jump to: navigation, search

PAL script to play top10 requests at a specified time

PAL.Loop := True;
PAL.WaitForTime(T['08:00:00']); {Wait for 8am}
var D : TDataSet;
var C : Integer;
D := Query('SELECT songlist.*, count(*) as cnt '+
              'FROM songlist,requestlist '+
              'WHERE songlist.ID = requestlist.songID '+
              '      AND requestlist.code < 700 '+
              'GROUP BY songlist.ID '+
              'ORDER BY cnt DESC LIMIT 10',[],True);
{Add requests to Queue.
We add to the top of the Queue, effectively reversing the
order of the requests - playing #10 first and #1 last}
C := 0;
while not D.EOF do
C := C + 1;
WriteLn('#'+IntToStr(C)+'. '+D['artist']+' - '+D['title']);
PAL.WaitForTime(T['23:59:59']); {Wait for next day}
Personal tools