Hi Folks,
We use Clockwheel scripts to get SAM to queue up songs. For example, here is one such Clockwheel that we are using that has just one simple line:
Code:
//SamsJams10.cwf
// added 04Jan2019
Cat['Music (All)'].QueueBottom(smRandom, EnforceRules);
We are looking for a way to add an ‘extra rule’ here where the clock wheel would only select songs that are 5 minutes of less in length. Is there a way to modify the above clockwheel to achieve this?
I have read this thread:
http://support.spacialaudio.com/forums/viewtopic.php?f=23&t=54708&p=220120&hilit=clockwheel#p220120Which shows this code:
Code:
var theSongChooser : TDataSet;
PAL.Loop := true;
//
// Choose a song less than 5 mintues (3000000 msec)
//
theSongChooser := Query('SELECT artist, title, filename, duration, id ' +
'FROM songlist ' +
'WHERE songtype = ''S'' ' +
'AND duration < ''300000'' ' +
'ORDER BY RAND() LIMIT 1', [], true);
//
// Add it to Queue
//
Queue.AddFile(theSongChooser['filename'], ipBottom);
WriteLn('Added: ' + QuotedStr(theSongChooser['artist']) + ' --- ' + QuotedStr(theSongChooser['title']));
WriteLN ( 'Duration: ' + IntToStr(theSongChooser['duration']) + ' milliseconds or ' + (FloatToStr(theSongChooser['duration']/60000)) + ' Minutes');
PAL.WaitForPlayCount(1);
It looks promising, but I am not sure how to modify our clockwheel script to adopt this behaviour. Where do I put our category 'Music (All)’, how can I specify QueueBottom and the smRandom?
I apologize in advance that we are not coders. Any advice is much appreciated. If someone can help us with the code, we would appreciate it greatly.
Thank you
-Eric in Stella, Ontario Canada (Amherst Island Radio 92.1 FM)