Hi all.
I made a class that makes a random/rotate based on a passed function and
used this class to make a rotate that plays in rounds that are module of the
weight.
Don't know if this should be on snippets or dev, and would apreciate any
feedback or corrections to the code(I'm an OCaml noob).

The code should be put in switch.ml and it can be found here:
http://pastebin.com/biw0uS8r

I use it like this on a .liq file:
#!/usr/local/bin/liquidsoap
always=mksafe(playlist.safe(mode="normal","/home/fabio/Desktop/musicas/so0.pls"))
fives=mksafe(playlist.safe(mode="normal","/home/fabio/Desktop/musicas/so1.pls"))
eights=mksafe(playlist.safe(mode="normal","/home/fabio/Desktop/musicas/so2.pls"))
#it will play a song from always every round, a song from fives in round
5,10,15... a song from eights in 8,16,24...
default=rotate_modulus(weights=[1,5,8],[always,fives,eights])
out(audio_to_stereo(default))

Thanks to everybody who answered my endless questions.
------------------------------------------------------------------------------
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-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to