Hi! 2012/7/5 Александр Кукоба <alexan...@kukoba.ru>: > I try to implement following algorithm of playlists scheduling: > there are two playlists: main and advertisements. liquidsoap in series get > tracks from main playlist and after any 5th (for example) track insert track > from ad playlist (but before 6th track from main playlist). > > now I use such construction: > > s = playlist("#{main}") > ads = playlist("#{ads}") > random(weights=[1,4], [ads, s]) > > (also I does not want that ads overlay main stream: I want to insert ad > between previous and next tracks from main playlist) > > I think that I should use queue management - create internal global counter > and on "track played" event check counter and if (counter mod 5) == 0 then > add to queue random track from ad playlist. > > I have tried to carefully consider this email archive and found some > interesting thread: > http://www.mail-archive.com/savonet-users@lists.sourceforge.net/msg02282.html > is there simpler way for solve my problem? > is there restrictions for liquidsoap version? > I does not need cross-fade and I ask this question because I does not know > liquidsoap language well :( > > Current config dynamicaly create stations and i should have an array of > counters. How I can create associative array (dictionary) ? > > Sorry for my stupid (may be) questions, but I tried use google at first :)
Don't worry! I am not very knowledgable on this topic but I think I remember that the problem with random is that is selects.. randomly.. Therefore, even with weights it is not guaranteed that you will have a strict rotation between your playlists.. Speaking of rotating, I think that this is the reason why David introduced later the "rotate" operator: toots@zulu /Volumes % liquidsoap -h rotate Rotate between the sources. (...) * weights : [int] (default: []) Weights of the children (padded with 1), defining for each child how many tracks are played from it per round, if that many are actually available. Have you tried this operator? Romain ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Savonet-users mailing list Savonet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/savonet-users