Ok no rush, on second thoughts maybe this would make more sense on the
switch.
Maybe instead of given a restrictive parameter just that the rotate works
like this, we could make a function based switch (like the func_random
class,but that would accept functions coming from LS ) and have a few
predefined functions that select the switch, in that way liquidsoap could
pass an "checker" that selects the right source.
like:
----------------------------------------My .liq
file---------------------------------------

def check(round,weight)
  if(round>weight) then true else false
 end


sources=switch(checker=check,weights=[1,2,3],[src1,src2,src3])
--------------------------------------------------------------------------------------------------------
And the predefined checking sources could be constants or something like
that.
sources=switch(checker=Checker.modulus,weights=[1,2,3],[src1,src2,src3])#check
if the round %weight=0


Em 6 de outubro de 2011 17:28, David Baelde <david.bae...@ens-lyon.org>escreveu:

> Thanks very much for this second patch!
>
> I'm not sure I'll have time to integrate it before the 1.0 release
> though. The main question for me is how to name it and document it:
> rotate_modulus doesn't really explain the difference with rotate.
> Perhaps it would be a better API that your code is used when a certain
> parameter (maybe wait=true, strict=true...?) is passed to rotate. It
> could also be that this parameter would make sense for a switch (wait
> for the first source whose predicate is true, rather than select the
> first source that is ready and has a true predicate).
>
> I think it would be more useful to have it integrated in liquidsoap
> rather than put in the snippets page, because few people would be
> ready to modify and recompile the sources.
>
> I'll get back to this asap,
> --
> David
>
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Savonet-devl mailing list
Savonet-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-devl

Répondre à