Module Switch


module Switch: sig .. end
Abstract operator which selects one of its children sources either at the beginning of a track or at every frame, depending on a parametrizable predicate. A few specializations of it are defined below.

type transition = Lang.value 

type child = {
   source : Source.source;
   transition : transition;
   mutable cur_meta : Request.metadata option;
}
type track_mode =
| Sensitive
| Insensitive
The switch can either happen at any time in the stream (insensitive) or only at track limits (sensitive).
class virtual switch : kind:Frame.content_kind -> name:string -> ?mode:track_mode -> ?replay_meta:bool -> child list -> object .. end

Common tools for Lang bindings of switch operators
val common : Lang.t -> (string * Lang.t * Lang.value option * string option) list
val default_transition : Frame.content_kind -> Lang.value
val extract_common : kind:Frame.content_kind ->
(string * Lang.value) list ->
int -> bool * track_mode * Lang.value list

Switch: switch according to user-defined predicates.
val satisfied : Lang.value -> bool
val trivially_true : Lang.value -> bool
val third : 'a * 'b * 'c -> 'c
class lang_switch : kind:Frame.content_kind -> track_mode -> ?replay_meta:bool -> (Lang.value * bool * child) list -> object .. end
class fallback : kind:Frame.content_kind -> ?replay_meta:bool -> track_mode -> child list -> object .. end
Fallback selector: switch to the first ready source.
exception Found of child
Random switch
class random : kind:Frame.content_kind -> ?replay_meta:bool -> bool -> track_mode -> (int * child) list -> object .. end