diff --git a/scripts/utils.liq b/scripts/utils.liq index b4652f381c..a35af94f31 100644 --- a/scripts/utils.liq +++ b/scripts/utils.liq @@ -434,7 +434,7 @@ end def smart_crossfade (~start_next=5.,~fade_in=3.,~fade_out=3., ~default=(fun (a,b) -> sequence([a, b])), ~high=-15., ~medium=-32., ~margin=4., - ~width=2.,~conservative=false,s) + ~width=2.,~conservative=true,s) fade.out = fade.out(type="sin",duration=fade_out) fade.in = fade.in(type="sin",duration=fade_in) add = fun (a,b) -> add(normalize=false,[b, a]) diff --git a/src/operators/smartcross.ml b/src/operators/smartcross.ml index 42f53202df..5f055a9d79 100644 --- a/src/operators/smartcross.ml +++ b/src/operators/smartcross.ml @@ -332,14 +332,19 @@ object (self) method remaining = match status with | `Idle | `After _ -> source#remaining - | `Limit -> 0 + | `Limit -> 0 (* TODO -1? *) | `Before -> let rem = source#remaining in if rem<0 then -1 else source#remaining + Generator.length gen_before - method is_ready = source#is_ready + (** Contrary to cross.ml, the transition is only created (and stored in + * the source instance variable) after that status has moved from `Limit to + * `After. If is_ready becomes false at this point, source.ml will end the + * track before that the transition (or bare end of track) gets a chance + * to be played. *) + method is_ready = source#is_ready || status = `Limit method abort_track = source#abort_track diff --git a/src/source.ml b/src/source.ml index 27e3491753..34fee643d3 100644 --- a/src/source.ml +++ b/src/source.ml @@ -477,7 +477,10 @@ object (self) * having to worry about availability. * So we add this branch, which makes the whole protocol a bit * sloppy because it removes any constraint tying #is_ready and - * #get. *) + * #get. It prevents the detection of "bad" calls of #get without + * having checked #is_ready. It also makes it really important + * to have #is_ready = true during tracks, otherwise this bit + * of code will forcefully end the track! *) Frame.add_break buf (Frame.position buf) else let b = Frame.breaks buf in