Hi list,

I implemented the two new parameters for the schedule operator:
"strict" and "single". I will eventually write some detailed doc about
them on the wiki, together with many examples.. for now here is a
quick explanation on the following example:

output.alsa(add([
 schedule(strict=true,[("0-1s", sine(440))]),
 schedule(single=[true],[("30-60s", single(".../jingle.mp3"))]),
 schedule(single=[true,false],
   [("0-10s", playlist("/tmp/jingles.m3u")),
    ("",      playlist.safe("/home/dbaelde/lists/playlist.m3u"))])]))

We output the sum of three schedule nodes. The first one has a single
branch, valid during "0-1s", with a since() source. The since plays a
continuous infinite track. A normal schedule node would play the
entire track, even if it goes beyond "0-1s". The strict flag avoids
that. Shouldn't be needed very often.

The second child is another schedule with a single branch. That branch
is in single mode, which means that it won't be selected twice in a
row. However, it can be reselected as soon as one frame after the end
of track. So basically the schedule() node loops on the jingle during
all the interval, and the single flag doesn't change much for the user
-- no one hears a delay of one frame.

The third child is the interesting one for the problem raised in that
thread. It's first branch is in single mode, on the interval "0-10s".
The second one is a safe playlist, in normal mode, on the full
interval. Everytime the schedule() reselects a child during "0-10s" it
will move to the jingles playlist, but will never reselect it after
one track, and will thus move to the normal playlist. If the normal
playlist's track finishes within "0-10s" (another instance, or the
same one) the schedule() goes back to the jingles again, and so on.

Enjoy !
--
David

Reply via email to