Skip to Content
It is currently December 11th, 2019, 7:29 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: "requests"
PostPosted: May 31st, 2014, 8:46 am 
Offline
Junior User
Junior User

Joined: May 31st, 2014, 8:18 am
Posts: 61
I can take requests from my web site. When I get more than one request they line up next to each other in the que. Is there a way to put a non request between the requested song thru a pal?


Top
 Profile  
Reply with quote  
 Post subject: Re: "requests"
PostPosted: May 31st, 2014, 9:36 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7888
Location: Aachen (Germany)
It would be way easier to simply delay requests for a certain amount of time (say 4 minutes or so).
You can find that option in the Request Policy Config.

If you really need a PAL to monitor the queue wether two adjacent tracks are both requests, you'd have to run a PAL that's always on and checks the first two queue items if they were requested.

This one should work.
Code:
VAR first, second : TSongInfo;
PAL.Loop := True;
PAL.WaitForPlayCount(1);
PAL.LockExecution;
first := Queue.NextInQueue;
second := Queue.NextInQueue;
Queue.Add(second, ipTop);
IF (first['requestID'] > 0 AND second['requestID'] > 0) THEN
  CAT['Tracks'].QueueTop(smRandom, EnforceRules);
Queue.Add(first, ipTop);
PAL.UnlockExecution;

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

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


Top
 Profile  
Reply with quote  
 Post subject: Re: "requests"
PostPosted: May 31st, 2014, 10:01 am 
Offline
Junior User
Junior User

Joined: May 31st, 2014, 8:18 am
Posts: 61
I tried to run this but I get a compiler error in line 8 after the second [ requesteID] > 0


Top
 Profile  
Reply with quote  
 Post subject: Re: "requests"
PostPosted: May 31st, 2014, 11:15 am 
Offline
SVS Member
SVS Member

Joined: October 15th, 2003, 11:59 pm
Posts: 4736
Location: Los Angeles - A Little West Of Nashville
It should be this:
Code:
VAR first, second : TSongInfo;

PAL.Loop := True;
PAL.WaitForPlayCount(1);
PAL.LockExecution;

first := Queue.NextInQueue;
second := Queue.NextInQueue;
Queue.Add(second, ipTop);

 IF ( (first['requestID'] > 0) AND (second['requestID'] > 0) ) THEN
   CAT['Tracks'].QueueTop(smRandom, EnforceRules);Queue.Add(first, ipTop);

PAL.UnlockExecution;

_________________
- 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  
 Post subject: Re: "requests"
PostPosted: May 31st, 2014, 11:23 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7888
Location: Aachen (Germany)
Sorry, my fault. You need to enclose each of the comparisons in a separate brackets.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

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


Top
 Profile  
Reply with quote  
 Post subject: Re: "requests"
PostPosted: May 31st, 2014, 2:16 pm 
Offline
Junior User
Junior User

Joined: May 31st, 2014, 8:18 am
Posts: 61
Seems to work just great, thank you


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

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 9 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