Source / Track processing
chop
Regularly insert track boundaries in a stream (useful for testing tracks).
Type:
(?every : {float}, ?metadata : {[string * string]}, source('a)) -> source('a)
Arguments:
every(of type{float}, which defaults to3.): Duration of a track (in seconds).metadata(of type{[string * string]}, which defaults to[]): Metadata for tracks.(unlabeled)(of typesource('a)): The stream.
Methods:
buffered(of type() -> [string * float]): Length of buffered data.duration(of type() -> float): Estimation of the duration of the current track.elapsed(of type() -> float): Elapsed time in the current track.fallible(of typebool): Indicate if a source may fail, i.e. may not be ready to stream.id(of type() -> string): Identifier of the source.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor outputs and sources such asinput.http.is_ready(of type() -> bool): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up(of type() -> bool): Indicate that the source can be asked to produce some data at any time. This istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.last_metadata(of type() -> [string * string]?): Return the last metadata from the source.log(of type{level : (() -> int?).{set : (int) -> unit}}): Get or set the source's log level, from1to5.on_metadata(of type((([string * string]) -> unit)) -> unit): Call a given handler on metadata packets.on_shutdown(of type((() -> unit)) -> unit): Register a function to be called when source shuts down.on_track(of type((([string * string]) -> unit)) -> unit): Call a given handler on new tracks.on_wake_up(of type((() -> unit)) -> unit): Register a function to be called after the source is asked to get ready. This is when, for instance, the source's final ID is set.remaining(of type() -> float): Estimation of remaining time in the current track.seek(of type(float) -> float): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync(of type() -> bool): Is the source currently controlling its own real-time loop.skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
fallback.skip
Special track insensitive fallback that always skips current song before switching.
Type:
(source('a), ?fallback : source('a)?) -> source('a)
where 'a is a set of internal tracks
Arguments:
(unlabeled)(of typesource('a) where 'a is a set of internal tracks): The main source.fallback(of typesource('a)? where 'a is a set of internal tracks, which defaults tonull): The fallback source. Defaults toblankifnull.
Methods:
buffered(of type() -> [string * float]): Length of buffered data.duration(of type() -> float): Estimation of the duration of the current track.elapsed(of type() -> float): Elapsed time in the current track.fallible(of typebool): Indicate if a source may fail, i.e. may not be ready to stream.id(of type() -> string): Identifier of the source.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor outputs and sources such asinput.http.is_ready(of type() -> bool): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up(of type() -> bool): Indicate that the source can be asked to produce some data at any time. This istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.last_metadata(of type() -> [string * string]?): Return the last metadata from the source.log(of type{level : (() -> int?).{set : (int) -> unit}}): Get or set the source's log level, from1to5.on_metadata(of type((([string * string]) -> unit)) -> unit): Call a given handler on metadata packets.on_shutdown(of type((() -> unit)) -> unit): Register a function to be called when source shuts down.on_track(of type((([string * string]) -> unit)) -> unit): Call a given handler on new tracks.on_wake_up(of type((() -> unit)) -> unit): Register a function to be called after the source is asked to get ready. This is when, for instance, the source's final ID is set.remaining(of type() -> float): Estimation of remaining time in the current track.seek(of type(float) -> float): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync(of type() -> bool): Is the source currently controlling its own real-time loop.skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
map_first_track
Apply a function to the first track of a source
Type:
(?id : string?, ((source('a)) -> source('a)), source('a)) -> source('a)
Arguments:
id(of typestring?, which defaults to"map_first_track"): Force the value of the source ID.(unlabeled)(of type(source('a)) -> source('a)): The applied function.(unlabeled)(of typesource('a)): The input source.
Methods:
buffered(of type() -> [string * float]): Length of buffered data.duration(of type() -> float): Estimation of the duration of the current track.elapsed(of type() -> float): Elapsed time in the current track.fallible(of typebool): Indicate if a source may fail, i.e. may not be ready to stream.id(of type() -> string): Identifier of the source.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor outputs and sources such asinput.http.is_ready(of type() -> bool): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up(of type() -> bool): Indicate that the source can be asked to produce some data at any time. This istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.last_metadata(of type() -> [string * string]?): Return the last metadata from the source.log(of type{level : (() -> int?).{set : (int) -> unit}}): Get or set the source's log level, from1to5.on_metadata(of type((([string * string]) -> unit)) -> unit): Call a given handler on metadata packets.on_shutdown(of type((() -> unit)) -> unit): Register a function to be called when source shuts down.on_track(of type((([string * string]) -> unit)) -> unit): Call a given handler on new tracks.on_wake_up(of type((() -> unit)) -> unit): Register a function to be called after the source is asked to get ready. This is when, for instance, the source's final ID is set.remaining(of type() -> float): Estimation of remaining time in the current track.seek(of type(float) -> float): Seek forward, in seconds (returns the amount of time effectively seeked).selected(of type() -> source('A)?): Currently selected source.self_sync(of type() -> bool): Is the source currently controlling its own real-time loop.skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
native.fallback
At the beginning of each track, select the first ready child.
Type:
(?id : string?, ?track_sensitive : bool, [source('a)]) -> source('a)
Arguments:
id(of typestring?, which defaults tonull): Force the value of the source ID.track_sensitive(of typebool, which defaults totrue): Re-select only on end of tracks.(unlabeled)(of type[source('a)])
Methods:
buffered(of type() -> [string * float]): Length of buffered data.duration(of type() -> float): Estimation of the duration of the current track.elapsed(of type() -> float): Elapsed time in the current track.fallible(of typebool): Indicate if a source may fail, i.e. may not be ready to stream.id(of type() -> string): Identifier of the source.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor outputs and sources such asinput.http.is_ready(of type() -> bool): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up(of type() -> bool): Indicate that the source can be asked to produce some data at any time. This istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.last_metadata(of type() -> [string * string]?): Return the last metadata from the source.log(of type{level : (() -> int?).{set : (int) -> unit}}): Get or set the source's log level, from1to5.on_metadata(of type((([string * string]) -> unit)) -> unit): Call a given handler on metadata packets.on_shutdown(of type((() -> unit)) -> unit): Register a function to be called when source shuts down.on_track(of type((([string * string]) -> unit)) -> unit): Call a given handler on new tracks.on_wake_up(of type((() -> unit)) -> unit): Register a function to be called after the source is asked to get ready. This is when, for instance, the source's final ID is set.remaining(of type() -> float): Estimation of remaining time in the current track.seek(of type(float) -> float): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync(of type() -> bool): Is the source currently controlling its own real-time loop.set(of type(source('A)) -> unit): Set the source.skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
native.once
Create a source that plays only one track of the input source.
Type:
(source('a)) -> source('a)
Arguments:
(unlabeled)(of typesource('a))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.duration(of type() -> float): Estimation of the duration of the current track.elapsed(of type() -> float): Elapsed time in the current track.fallible(of typebool): Indicate if a source may fail, i.e. may not be ready to stream.id(of type() -> string): Identifier of the source.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor outputs and sources such asinput.http.is_ready(of type() -> bool): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up(of type() -> bool): Indicate that the source can be asked to produce some data at any time. This istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.last_metadata(of type() -> [string * string]?): Return the last metadata from the source.log(of type{level : (() -> int?).{set : (int) -> unit}}): Get or set the source's log level, from1to5.on_metadata(of type((([string * string]) -> unit)) -> unit): Call a given handler on metadata packets.on_shutdown(of type((() -> unit)) -> unit): Register a function to be called when source shuts down.on_track(of type((([string * string]) -> unit)) -> unit): Call a given handler on new tracks.on_wake_up(of type((() -> unit)) -> unit): Register a function to be called after the source is asked to get ready. This is when, for instance, the source's final ID is set.remaining(of type() -> float): Estimation of remaining time in the current track.seek(of type(float) -> float): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync(of type() -> bool): Is the source currently controlling its own real-time loop.skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
native.sequence
Play only one track of every successive source, except for the last one which is played as much as available.
Type:
(?id : string?,
[source('a)
.{
buffered : () -> [string * float],
duration : () -> float,
elapsed : () -> float,
fallible : bool,
id : () -> string,
is_active : () -> bool,
is_ready : () -> bool,
is_up : () -> bool,
last_metadata : () -> [string * string]?,
log :
{level : (() -> int?).{set : (int) -> unit}
},
on_metadata : ((([string * string]) -> unit)) -> unit,
on_shutdown : ((() -> unit)) -> unit,
on_track : ((([string * string]) -> unit)) -> unit,
on_wake_up : ((() -> unit)) -> unit,
remaining : () -> float,
seek : (float) -> float,
self_sync : () -> bool,
skip : () -> unit,
time : () -> float
}]) -> source('a)
Arguments:
id(of typestring?, which defaults tonull): Force the value of the source ID.(unlabeled)(of type[source('a) .{ buffered : () -> [string * float], duration : () -> float, elapsed : () -> float, fallible : bool, id : () -> string, is_active : () -> bool, is_ready : () -> bool, is_up : () -> bool, last_metadata : () -> [string * string]?, log : {level : (() -> int?).{set : (int) -> unit} }, on_metadata : ((([string * string]) -> unit)) -> unit, on_shutdown : ((() -> unit)) -> unit, on_track : ((([string * string]) -> unit)) -> unit, on_wake_up : ((() -> unit)) -> unit, remaining : () -> float, seek : (float) -> float, self_sync : () -> bool, skip : () -> unit, time : () -> float }]): List of sources to play tracks from.
Methods:
buffered(of type() -> [string * float]): Length of buffered data.duration(of type() -> float): Estimation of the duration of the current track.elapsed(of type() -> float): Elapsed time in the current track.fallible(of typebool): Indicate if a source may fail, i.e. may not be ready to stream.id(of type() -> string): Identifier of the source.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor outputs and sources such asinput.http.is_ready(of type() -> bool): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up(of type() -> bool): Indicate that the source can be asked to produce some data at any time. This istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.last_metadata(of type() -> [string * string]?): Return the last metadata from the source.log(of type{level : (() -> int?).{set : (int) -> unit}}): Get or set the source's log level, from1to5.on_metadata(of type((([string * string]) -> unit)) -> unit): Call a given handler on metadata packets.on_shutdown(of type((() -> unit)) -> unit): Register a function to be called when source shuts down.on_track(of type((([string * string]) -> unit)) -> unit): Call a given handler on new tracks.on_wake_up(of type((() -> unit)) -> unit): Register a function to be called after the source is asked to get ready. This is when, for instance, the source's final ID is set.remaining(of type() -> float): Estimation of remaining time in the current track.seek(of type(float) -> float): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync(of type() -> bool): Is the source currently controlling its own real-time loop.skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
native.switch
Select the first source whose predicate is true in a list. If the second argument is a getter, the source will be dynamically created.
Type:
(?id : string?, ?track_sensitive : bool, [{bool} * source('a)]) -> source('a)
Arguments:
id(of typestring?, which defaults tonull): Force the value of the source ID.track_sensitive(of typebool, which defaults totrue): Re-select only on end of tracks.(unlabeled)(of type[{bool} * source('a)]): Sources with the predicate telling when they can be played.
Methods:
buffered(of type() -> [string * float]): Length of buffered data.duration(of type() -> float): Estimation of the duration of the current track.elapsed(of type() -> float): Elapsed time in the current track.fallible(of typebool): Indicate if a source may fail, i.e. may not be ready to stream.id(of type() -> string): Identifier of the source.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor outputs and sources such asinput.http.is_ready(of type() -> bool): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up(of type() -> bool): Indicate that the source can be asked to produce some data at any time. This istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.last_metadata(of type() -> [string * string]?): Return the last metadata from the source.log(of type{level : (() -> int?).{set : (int) -> unit}}): Get or set the source's log level, from1to5.on_metadata(of type((([string * string]) -> unit)) -> unit): Call a given handler on metadata packets.on_shutdown(of type((() -> unit)) -> unit): Register a function to be called when source shuts down.on_track(of type((([string * string]) -> unit)) -> unit): Call a given handler on new tracks.on_wake_up(of type((() -> unit)) -> unit): Register a function to be called after the source is asked to get ready. This is when, for instance, the source's final ID is set.remaining(of type() -> float): Estimation of remaining time in the current track.seek(of type(float) -> float): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync(of type() -> bool): Is the source currently controlling its own real-time loop.set(of type(source('A)) -> unit): Set the source.skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
notify_metadata
Use notify to display metadata info.
Type:
(?urgency : string, ?icon : string, ?timeout : float,
?display : (([string * string]) -> string), ?title : string, 'b
.{on_metadata : ((([string * string]) -> unit)) -> 'a}) -> 'a
Arguments:
urgency(of typestring, which defaults to"low"): Urgency (low|normal|critical).icon(of typestring, which defaults to"stock_smiley-22"): Icon filename or stock icon to display.timeout(of typefloat, which defaults to3.): Timeout in seconds.display(of type([string * string]) -> string, which defaults to<fun>): Function used to display a metadata packet.title(of typestring, which defaults to"Liquidsoap: new track"): Title of the notification message.(unlabeled)(of type'b.{on_metadata : ((([string * string]) -> unit)) -> 'a})
osd_metadata
Use X On Screen Display to display metadata info.
Type:
(?color : string, ?position : string, ?font : string,
?display : (([string * string]) -> string), 'b
.{on_metadata : ((([string * string]) -> unit)) -> 'a}) -> 'a
Arguments:
color(of typestring, which defaults to"green"): Color of the text.position(of typestring, which defaults to"top"): Position of the text (top|middle|bottom).font(of typestring, which defaults to"-*-courier-*-r-*-*-*-240-*-*-*-*-*-*"): Font used (xfontsel is your friend...)display(of type([string * string]) -> string, which defaults to<fun>): Function used to display a metadata packet.(unlabeled)(of type'b.{on_metadata : ((([string * string]) -> unit)) -> 'a})
overlap_sources
Rotate between overlapping sources. Next track starts according to 'liq_start_next' offset metadata.
Type:
(?id : string?, ?normalize : bool, ?start_next : string,
?weights : [{float}], [source('a)]) -> source('a)
where
'a is a set of tracks to be muxed into a source and a set of internal tracks
Arguments:
id(of typestring?, which defaults to"overlap_sources"): Force the value of the source ID.normalize(of typebool, which defaults tofalse)start_next(of typestring, which defaults to"liq_start_next"): Metadata field indicating when the next track should start, relative to current track's time.weights(of type[{float}], which defaults to[]): Relative weight of the sources in the sum. The empty list stands for the homogeneous distribution.(unlabeled)(of type[source('a)] where 'a is a set of tracks to be muxed into a source and a set of internal tracks): Sources to toggle from
Methods:
buffered(of type() -> [string * float]): Length of buffered data.duration(of type() -> float): Estimation of the duration of the current track.elapsed(of type() -> float): Elapsed time in the current track.fallible(of typebool): Indicate if a source may fail, i.e. may not be ready to stream.id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Insert metadata in the source. Thenew_trackparameter indicates whether a track boundary should also be inserted (by default, no track is inserted).is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor outputs and sources such asinput.http.is_ready(of type() -> bool): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up(of type() -> bool): Indicate that the source can be asked to produce some data at any time. This istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.last_metadata(of type() -> [string * string]?): Return the last metadata from the source.log(of type{level : (() -> int?).{set : (int) -> unit}}): Get or set the source's log level, from1to5.on_metadata(of type((([string * string]) -> unit)) -> unit): Call a given handler on metadata packets.on_shutdown(of type((() -> unit)) -> unit): Register a function to be called when source shuts down.on_track(of type((([string * string]) -> unit)) -> unit): Call a given handler on new tracks.on_wake_up(of type((() -> unit)) -> unit): Register a function to be called after the source is asked to get ready. This is when, for instance, the source's final ID is set.remaining(of type() -> float): Estimation of remaining time in the current track.seek(of type(float) -> float): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync(of type() -> bool): Is the source currently controlling its own real-time loop.skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
playlog
Keep a record of played files. This is primarily useful to know when a song was last played and avoid repetitions.
Type:
(?duration : float, ?persistency : string?,
?hash : (([string * string]) -> string)) -> unit
Arguments:
duration(of typefloat, which defaults toinf): Duration (in seconds) after which songs are forgotten. By default, songs are not forgotten which means that the playlog will contain all the songs ever played.persistency(of typestring?, which defaults tonull): Set a file name where the values are stored and loaded in case the script is restarted.hash(of type([string * string]) -> string, which defaults to<fun>): Function to extract an identifier from the metadata. By default, the filename is used but we could return the artist to know when a song from a given artist was last played for instance.
Methods:
add(of type([string * string]) -> unit): Record that file with given metadata has been played.last(of type([string * string]) -> float): How long ago a file was played (in seconds),infinityis returned if the song has never been played.
rotate.merge
Same operator as rotate but merges tracks from each sources. For instance, rotate.merge([intro,main,outro]) creates a source that plays a sequence [intro,main,outro] as single track and loops back.
Type:
(?id : string?, ?transitions : [(source('a), source('a)) -> source('a)],
?weights : [{int}], [source('a)]) -> source('a)
where
'a is a set of tracks to be muxed into a source and a set of internal tracks
Arguments:
id(of typestring?, which defaults to"rotate.merge"): Force the value of the source ID.transitions(of type[(source('a), source('a)) -> source('a)] where 'a is a set of tracks to be muxed into a source and a set of internal tracks, which defaults to[]): Transition functions, padded withfun (x,y) -> yfunctions.weights(of type[{int}], which defaults to[]): Weights of the children (padded with 1), defining for each child how many tracks are played from it per round, if that many are actually available.(unlabeled)(of type[source('a)] where 'a is a set of tracks to be muxed into a source and a set of internal tracks): Sequence of sources to be merged
Methods:
buffered(of type() -> [string * float]): Length of buffered data.duration(of type() -> float): Estimation of the duration of the current track.elapsed(of type() -> float): Elapsed time in the current track.fallible(of typebool): Indicate if a source may fail, i.e. may not be ready to stream.id(of type() -> string): Identifier of the source.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor outputs and sources such asinput.http.is_ready(of type() -> bool): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up(of type() -> bool): Indicate that the source can be asked to produce some data at any time. This istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.last_metadata(of type() -> [string * string]?): Return the last metadata from the source.log(of type{level : (() -> int?).{set : (int) -> unit}}): Get or set the source's log level, from1to5.on_metadata(of type((([string * string]) -> unit)) -> unit): Call a given handler on metadata packets.on_shutdown(of type((() -> unit)) -> unit): Register a function to be called when source shuts down.on_track(of type((([string * string]) -> unit)) -> unit): Call a given handler on new tracks.on_wake_up(of type((() -> unit)) -> unit): Register a function to be called after the source is asked to get ready. This is when, for instance, the source's final ID is set.remaining(of type() -> float): Estimation of remaining time in the current track.seek(of type(float) -> float): Seek forward, in seconds (returns the amount of time effectively seeked).selected(of type() -> source('A)? where 'A is a set of tracks to be muxed into a source and a set of internal tracks): Currently selected source.self_sync(of type() -> bool): Is the source currently controlling its own real-time loop.skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
server.insert_metadata
Register a server/telnet command to update a source's metadata. Returns a new source, which will receive the updated metadata. The command has the following format: insert key1="val1",key2="val2",...
Type:
(?id : string?, source('a)) -> source('a)
Arguments:
id(of typestring?, which defaults tonull): Force the value of the source ID.(unlabeled)(of typesource('a))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.duration(of type() -> float): Estimation of the duration of the current track.elapsed(of type() -> float): Elapsed time in the current track.fallible(of typebool): Indicate if a source may fail, i.e. may not be ready to stream.id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Insert metadata in the source. Thenew_trackparameter indicates whether a track boundary should also be inserted (by default, no track is inserted).is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor outputs and sources such asinput.http.is_ready(of type() -> bool): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up(of type() -> bool): Indicate that the source can be asked to produce some data at any time. This istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.last_metadata(of type() -> [string * string]?): Return the last metadata from the source.log(of type{level : (() -> int?).{set : (int) -> unit}}): Get or set the source's log level, from1to5.on_metadata(of type((([string * string]) -> unit)) -> unit): Call a given handler on metadata packets.on_shutdown(of type((() -> unit)) -> unit): Register a function to be called when source shuts down.on_track(of type((([string * string]) -> unit)) -> unit): Call a given handler on new tracks.on_wake_up(of type((() -> unit)) -> unit): Register a function to be called after the source is asked to get ready. This is when, for instance, the source's final ID is set.remaining(of type() -> float): Estimation of remaining time in the current track.seek(of type(float) -> float): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync(of type() -> bool): Is the source currently controlling its own real-time loop.skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
skipper
Regularly skip tracks from a source (useful for testing skipping).
Type:
(?every : {float}, source('a).{skip : () -> unit, time : () -> float}) ->
source('a)
Arguments:
every(of type{float}, which defaults to5.): How often to skip tracks.(unlabeled)(of typesource('a).{skip : () -> unit, time : () -> float}): The stream.
Methods:
buffered(of type() -> [string * float]): Length of buffered data.duration(of type() -> float): Estimation of the duration of the current track.elapsed(of type() -> float): Elapsed time in the current track.fallible(of typebool): Indicate if a source may fail, i.e. may not be ready to stream.id(of type() -> string): Identifier of the source.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor outputs and sources such asinput.http.is_ready(of type() -> bool): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up(of type() -> bool): Indicate that the source can be asked to produce some data at any time. This istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.last_metadata(of type() -> [string * string]?): Return the last metadata from the source.log(of type{level : (() -> int?).{set : (int) -> unit}}): Get or set the source's log level, from1to5.on_metadata(of type((([string * string]) -> unit)) -> unit): Call a given handler on metadata packets.on_shutdown(of type((() -> unit)) -> unit): Register a function to be called when source shuts down.on_track(of type((([string * string]) -> unit)) -> unit): Call a given handler on new tracks.on_wake_up(of type((() -> unit)) -> unit): Register a function to be called after the source is asked to get ready. This is when, for instance, the source's final ID is set.remaining(of type() -> float): Estimation of remaining time in the current track.seek(of type(float) -> float): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync(of type() -> bool): Is the source currently controlling its own real-time loop.skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.