# Liquidsoap Annotation Reference
This page is intended for plugin developers who are looking to supply additional annotation metadata to Liquidsoap. It is a compilation of information that wasn't available elsewhere online, and is intended only for advanced users.
# Appending Tracks
Append an extra track to every track.
Set the metadata 'liq_append' to 'false' to inhibit appending on one track.
# Crossing Tracks
Common effects like cross-fading can be split into two parts: crossing, and fading. Here we implement crossing, not caring about fading: a arbitrary transition function is passed, taking care of the combination.
A buffer is needed to store the end of a track before combining it with the next track. We could always have a full buffer, but this would involve copying all the time. Instead, we try to fill the buffer only when getting close to the end of track. The problem then is to cope with tracks which are longer than expected, i.e. which end doesn't really fit in the buffer.
This operator works with any type of stream. All three parameters are durations in ticks.
Metadata field which, if present and containing a float, overrides the 'duration' parameter for current track.
# Cue Points
The [cue_cut] class is able to skip over the beginning and end of a track according to cue points. This involves quite a bit of trickery involving clocks, #seek as well as reverting frame contents. Even more trickery would be needed to implement a [cue_split] operator that splits tracks according to cue points: in particular, the frame manipulation would get nasty, involving storing chunks that have been fetched too early, replaying them later, glued with new content.
We use ticks for precision, but store them as Int64 to allow long durations. This should eventually be generalized to all of liquidsoap, removing limitations such as the duration passed to #seek or returned by #remaining. We introduce a few notations to make this comfortable.
Start track after a cue in point and stop it at cue out point. The cue points are given as metadata, in seconds from the begining of tracks.
Metadata for cue in points.
Metadata for cue out points. Note that cue-out should be given relative to the beginning of the file (0:00 of the file itself, not 0:00 as calculated by the cue-in point).
Fade durations (in, initial, out, final) are indicated in total seconds.
Metadata field which, if present and correct, overrides the 'type' parameter for current track.
Options: lin|sin|log|exp (linear, sinusoidal, logarithmic or exponential)
Fade the beginning of tracks.
Fade the beginning of a stream.
Fade the end of tracks.
Fade a stream to silence.
Call a given handler when position in track is equal or more than a given amount of time (the 'offset' parameter)
Metadata field which, if present and containing a float, overrides the 'offset' parameter.
# Prepending Tracks
Prepend an extra track before every track.
Set the metadata 'liq_prepend' to 'false' to inhibit appending on one track.
# Set Volume
Multiply the amplitude of the signal.
Specify the name of a metadata field that, when present and well-formed, overrides the amplification factor for the current track. Well-formed values are floats in decimal notation (e.g. '0.7') which are taken as normal/linear multiplicative factors; values can be passed in decibels with the suffix 'dB' (e.g. '-8.2 dB', but the spaces do not matter).
# Video Fade
Fade the beginning of tracks. Metadata 'liq_video_fade_in' can be used to set the duration for a specific track (float in seconds).
Fade the end of tracks. Metadata 'liq_video_fade_out' can be used to set the duration for a specific track (float in seconds).