Am 26.06.2011 22:50, schrieb David Baelde:
> Hi,
>
> Congratulations for your scripts. However there was a simpler
> solution. For dropping the currently playing song, skipping is the
> only way. When I said that, I thought it was clear that for other
> requests in the queue, there are other ways. They will make for
> simpler scripts are cleaner streams.
>
> With a queue you can skip a queued request. This won't make it
> disappear but it'll be ignored when time comes to be played. So you
> could (1) get the list of all queued RID using "<queue>.queue" (2)
> ignore them all ("<queue>.ignore" server command) (3) skip the first
> one, after which everything will be gone.
>
> With an editable queue (request.equeue) you actually have a remove command.
>
> I apologize in advance for the annoyance of using this mix of script
> and server commands. Initially it was all server commands, now the
> scripts have taken over. It'll get better in the future when
> everything is integrated nicely as scripts.
>
> Cheers,
yep, you are right, here is the simple and more elegant variant of the
script, if anyone is interested:
req = request.queue(id="req")
def clear_queue(s) =
ret = server.execute("req.queue")
ret = list.hd(ret)
ret = string.split(separator=" ",ret)
list.iter(fun(x) -> begin foo = server.execute("req.ignore
#{x}") end,ret)
source.skip(s)
end
server.register(namespace="req",
description="Flush queue and stop request source.",
usage="stop",
"stop",
fun (s) -> begin clear_queue(req) "Done." end)
thx 4 the help,
mccurly
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users