Changeset 6668
- Timestamp:
- 06/20/09 12:55:39 (15 months ago)
- Files:
-
- 1 modified
-
trunk/liquidsoap/src/operators/switch.ml (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/liquidsoap/src/operators/switch.ml
r6527 r6668 455 455 456 456 let () = 457 Lang.add_operator "random" ~category:Lang.TrackProcessing 457 let add name strict descr weight_descr = 458 Lang.add_operator name ~descr ~category:Lang.TrackProcessing 458 459 (common @ 459 460 [ "weights", Lang.list_t Lang.int_t, Some (Lang.list []), 460 Some "Weights of the children in the choice." ; 461 "strict", Lang.bool_t, Some (Lang.bool false), 462 Some "Do not use random but cycle over the uniform distribution." ; 461 Some weight_descr ; 463 462 "", Lang.list_t Lang.source_t, None, None ]) 464 ~descr:"At the beginning of every track, select a random ready child."465 463 (fun p _ -> 466 464 let children = Lang.to_source_list (List.assoc "" p) in … … 473 471 Utils.make_list (List.length children) 1 474 472 in 475 let strict = Lang.to_bool (List.assoc "strict" p) in476 473 let children = 477 474 if List.length weights <> List.length children then … … 488 485 in 489 486 new random ~replay_meta strict ts children) 487 in 488 add "random" false 489 "At the beginning of every track, select a random ready child." 490 "Weights of the children (padded with 1), defining for each child \ 491 the probability that it is selected." ; 492 add "rotate" true 493 "Rotate between the sources." 494 "Weights of the children (padded with 1), defining for each child \ 495 how many tracks are played from it per round, if that many are \ 496 actually available."
