 Simon,
On Fri, Sep 12, 2008 at 10:02 PM, Simon Renquin <djnosmile@...> wrote:
> I'd like to build a customizable transition within a fallback using
> source.id. The problem is that the fallback seem to change my source id :
> Here id my code :
> def backRadioTr(cur, next)
> if source.id(cur) == "clock"
> then
> inFade(cur,next)
> else
> inJingle(delay=3., outPubJingle, cur, next)
> end
> end
Nice try, but you can't hope to do it that way. Cur will often be
wrapped in a transition, so it will have a different ID. You can try
to rely on the metadata from the stream (and set a different "source"
metadata on your different sources e.g. using rewrite_metadata or
annotate protocol), which you can access for example in a
smart_cross() transition. The idea would be to not perform any
transition at the fallback() but do it in the cross, with a sequence
if two consecutive tracks come from the same source, and custom
transitions depending on which are the initial and final sources.
I know it's a bit complicated, and smart_cross() sounds like
overkill... I'll try to think of something better or at least cook an
example for what you want to achieve -- it's a natural request that
just had to come up at some point.
--
David
Hi,
I'd like to build a customizable transition within a fallback using
source.id. The problem is that the fallback seem to change my source
id :
Here id my code :
---------
clock=fallback(id="clock", track_sensitive=false, [t01, t02, t03, t04,
t05, t06, t07, t08, t09, t10, t11, t12, t13, t14, t15, t16, t17, t18,
t19, t20, t21, t22, t23, t24])
def backRadioTr(cur, next)
log("clock : "^source.id(clock))
log("cur : "^source.id(cur))
if source.id(cur) == "clock"
then
inFade(cur,next)
else
inJingle(delay=3., outPubJingle, cur, next)
end
end
ClockedRadio = fallback(transitions=
[outFade, outJingle(delay=1., inPubJingle), backRadioTr],
track_sensitive=false,
[clock, pub, radio])
-------
pub is a request queue and radio is an http input. To goal is to be
able to distinct a fallback from clock to radio and a fallback from
pub to radio. The problem is that when I read the log produced from
a fallback from clock to radio, I get thi :
2008/09/12 21:57:03 [lang:3] clock : clock
2008/09/12 21:57:03 [lang:3] cur : src_120
Well, it seems that it's fallback's fault...
How could I fix this without using 2 different fallback? (Because it
would behave properly with my custom transitions...)
Le 28 Aug 2008 à 13:25, Romain Beauxis a écrit :
> Le Tuesday 26 August 2008 20:14:19 Fred, vous avez écrit :
>> Salut les aminches !
>
> Yopiyop !
>
>> Currently i use a switch based transition* between 2 differents
>> playlist
>> (transition from a track based playlist to a mix based playlist)
>> fade out, then 3 sec of blank, then jingle on top of a fade in.
>>
>> It's running well , but, for me, having:
>> a fade out, then long jingle to announce the program , then fade in.
>> is more nice..
>>
>> Is it possible to arrange that ?
>> My "jingle" is a 20 or 30 secondes long. it's like playing a track
>> as a transition between 2 sources, which is a bit "special".
>>
>> I don't know which kind of "tools" i can use to do this ??
>
> Humm.. I believe you need the core "cross" operator there:
> def seq_with_jingle(a,b) =
> sequence(a,jingle,b)
> end
>
> def custom_cross(a,b) =
> add(normalize=false,[fade.initial(b),fade.final(a)])
> end
>
> def transition(a,b) =
> cross(custom_cross,seq_with_jingle(a,b))
> end
>
> I've not tested it, but the last cross call should do what you
> require: it
> takes the source a,j,b and returns a source with its track crossed
> using the
> custom_cross function.
>
> You can tweak the parameters for each operator of course. Even
> better, you may
> detect (using source.id for instance) in the custom_cross function
> wether a
> or b is the jingle and don't apply any fade to it. That way you
> would really
> have fade.out, jingle, fade.in, all crossed..
> The code would be in this case:
>
> def custom_cross(a,b) =
> a = if source.id(a) != "jingle" then
> fade.final(a)
> else
> a
> end
> b = if source.id(b) != "jingle" then
> fade.initial(b)
> else
> b
> end
> add(normalize=false,[b,a])
> end
>
> Again, not tested :)
>
>
>@...
>
I agree to receive quotes, newsletters and other information from sourceforge.net and its partners regarding IT services and products. I understand that I can withdraw my consent at any time. Please refer to our Privacy Policy or Contact Us for more details