Skip to Content
It is currently March 1st, 2021, 5:08 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: June 5th, 2018, 7:55 pm 
Offline
Senior User
Senior User

Joined: July 23rd, 2007, 2:22 am
Posts: 141
I have a lot of long tracks in my collection that are much longer than 5 minutes. Most of them are Disney music loops that can run into more than an hour long. If I decide I don't want to play those tracks without taking them out of my playlist, can someone provide me with or point me to a script that will play nothing longer than X minutes (e.g. 5 minutes) unless someone specifically makes a request for that track out of the playlist?

Thanks!
Dan

_________________
Park Magic Radio
http://parkmagicradio.ca


Top
 Profile  
Reply with quote  
PostPosted: June 6th, 2018, 4:38 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8152
Location: Cologne (Germany)
Why so complicated?
SAM will only play what you tell it to anyways.
Just move those tracks into a separate category (or even multiple categories) so they're not covered by your Clockwheel.
Users on your website will still see the tracks (because they're still type S) and will be able to request them, but your AutoDJ/Queue mode will not automatically pick them up for playing.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: June 6th, 2018, 9:42 pm 
Offline
Senior User
Senior User

Joined: July 23rd, 2007, 2:22 am
Posts: 141
I didn't think of that. But I've done that now. :)

_________________
Park Magic Radio
http://parkmagicradio.ca


Top
 Profile  
Reply with quote  
PostPosted: June 7th, 2018, 2:31 am 
Offline
SVS Member
SVS Member

Joined: October 15th, 2003, 11:59 pm
Posts: 4743
Location: Los Angeles - A Little West Of Nashville
If you want to do it in a PAL script:

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);

_________________
- DJ Dee
- Spacial Volunteer Support (SVS)
- Custom PAL services: www.palscripts.com
- http://www.AlternativeHD.com
- http://www.lahotcountry.com


Top
 Profile  
Reply with quote  
PostPosted: June 8th, 2018, 9:46 am 
Offline
Senior User
Senior User

Joined: July 23rd, 2007, 2:22 am
Posts: 141
Thanks DJ Dee!

_________________
Park Magic Radio
http://parkmagicradio.ca


Top
 Profile  
Reply with quote  
PostPosted: August 21st, 2020, 11:13 pm 
Offline
Senior User
Senior User

Joined: July 23rd, 2007, 2:22 am
Posts: 141
This PAL script won't do if someone requests a song. After the requested song is added to the queue, the script sees that a song has been added and adds another song to the queue. Can it be re-written so that it selects and plays songs under 5 minutes, or at the very least, recognizes when someone requests a song? One could potentially have 50+ requested songs waiting in the queue. Thanks!

_________________
Park Magic Radio
http://parkmagicradio.ca


Top
 Profile  
Reply with quote  
PostPosted: August 22nd, 2020, 12:05 am 
Offline
SVS Member
SVS Member

Joined: October 15th, 2003, 11:59 pm
Posts: 4743
Location: Los Angeles - A Little West Of Nashville
Yes it can, but time is money. I don’t have the time to do this for nothing.

Maybe someone else will fix it for free for you.

But if not, go to http://palscripts.com

_________________
- DJ Dee
- Spacial Volunteer Support (SVS)
- Custom PAL services: www.palscripts.com
- http://www.AlternativeHD.com
- http://www.lahotcountry.com


Top
 Profile  
Reply with quote  
PostPosted: August 22nd, 2020, 1:08 am 
Offline
Senior User
Senior User

Joined: July 23rd, 2007, 2:22 am
Posts: 141
Thank you dj, I figured it out. Instead of PAL.WaitForPlayCount(1); I used PAL.WaitForQueue(3); so the script will wait until there are 3 songs in the queue, then add one at random that is less than 5 minutes long. If someone makes a request, SAM places the request at the bottom of the queue, and the PAL script will simply wait until there are 3 songs left in the queue and randomly add another one.

I do appreciate your quick response, and I appreciate the time and effort.

Cheers,
Dan

_________________
Park Magic Radio
http://parkmagicradio.ca


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 37 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group