Fred wrote:
> 1/ 15h00 a 16h00 je joue une playlist de tracks
> 2/ 16h00 a 17h00 je switche avec transition et joue une playlist de mix
> (=track de + d'une heure)
> 3/ 17h00 a 18h00 je dois revenir a la playlist de tracks
> comme le fallback est track_sensitive=false liquidsoap fade-out puis arrête
> le mix,
> passe la transition et switche sur la source des tracks.
> Jusque là tout est normal.
> 4/ Si a 18h00 je dois a nouveau passer les mixs, Liquidsoap
> switche et me rejoue le même mix qu'il avait commencé entre 16h a 17h (???)
> il ne renvoie pas les metadata et ne le loggue même pas !!
Hi Fred,
This is a normal behaviour: you your fallback() switches, it leaves the mix
source alone, out of time; when it comes back to it, it is as if nothing
happened in between. It is generally a good thing: if the child source keeps
streaming in the void, then when you come back to it it might have consumed ten
tracks and be in the middle on the eleventh.
But as you noticed, it is not wanted sometimes. Romain already fixed that,
by writing a special operator: fallback.skip(). It is already in the utils.liq
library so you can use it in your scripts without adding anything.
However, it might not be good enough for you so I'll show you the code,
explain it and tell you how to adapt it.
# Special track insensitive fallback that
# always skip current song before switching.
# @category Source / Track Processing
# @param ~input The input source
# @param f The fallback source
def fallback.skip(~input,f)
def transition(a,b) =
source.skip(a)
# This eats the last remaining frame from a
sequence([a,b])
end
fallback(track_sensitive=false,transitions=[transition,transition],[input,f])
end
The default transition is a fallback is to play one track after the other, i.e.
sequence([a,b]). Here, we have a fallback with almost that default transition,
except that it first tells a to end its track. By doing so, it ensures that
the source will be at a beginning of track when it is streamed again. (The
tricky thing here is to write sequence([a,b]) instead of just b: it matters,
since after telling source "a" to end its track, the ending of the track should
be consumed. With "b" alone instead of the sequence, you would find "a" at the
end of a track when you come back to it instead of the beginning of the next
one.)
In your case, you want to skip the end of the mix track. But you want more than
the sequencing transition used in fallback.skip(). You can keep your current
code, and add a source.skip(a) in your transition.
def goldorak(mixin_jingle,a,b)
source.skip(a)
sequence([ fade.final(duration=8.,a),
mixin_jingle,
fade.initial(duration=7.,b) ])
end
Have fun,
David
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users