Track

class Track(val clips: List<Clip>, val content: TrackContent = TrackContent.AudioAndVideo, val effects: List<EffectSpec> = emptyList(), val audio: AudioLevel = AudioLevel.Inherit, val start: Duration = Duration.ZERO, val looping: Boolean = false, val fadeIn: Duration = Duration.ZERO, val fadeOut: Duration = Duration.ZERO)(source)

One layer of a composition: clips laid end to end, playing alongside the other tracks.

Tracks run at the same time. The first track is the primary one, which sets the output frame and is the only one that may carry video. Every later track is an audio-only bed, like music or a voice over, and its audio is mixed with the rest. A later track that carries video is refused at plan time.

Track effects apply to every clip on the track, which is the cheap way to grade a run of clips at once. They are lowered onto each clip individually, so an effect whose result depends on where a frame sits in the track cannot be expressed here. Nothing in the built-in catalogue is like that.

Constructors

Link copied to clipboard
constructor(clips: List<Clip>, content: TrackContent = TrackContent.AudioAndVideo, effects: List<EffectSpec> = emptyList(), audio: AudioLevel = AudioLevel.Inherit, start: Duration = Duration.ZERO, looping: Boolean = false, fadeIn: Duration = Duration.ZERO, fadeOut: Duration = Duration.ZERO)

Properties

Link copied to clipboard

What to do with this track's audio before it is mixed.

Link copied to clipboard

The sources to play, in order.

Link copied to clipboard

Which media streams this track contributes.

Link copied to clipboard

How long this track runs, counting from the start of the composition.

Link copied to clipboard

Effects applied to every clip on this track, after each clip's own.

Link copied to clipboard

How long the audio takes to rise from silence, starting where the track does. It multiplies audio rather than replacing it, so a fade over a level or an envelope reaches what that asked for.

Link copied to clipboard

How long the audio takes to fall to silence before the track ends, which for a looping track is where the composition ends.

Link copied to clipboard

Whether the track repeats until the longest non-looping track ends. The run of clips is laid down again from the top as many times as it takes, and the last pass is cut where it runs past the end. A composition needs at least one non-looping track to have a duration at all.

Link copied to clipboard

Where in the composition this track begins. The track is silent before it, and the primary track shows the composition's EditComposition.fill there. A negative start is refused with dev.jordond.filmstrip.FilmstripError.InvalidComposition when the composition is planned.

Functions

Link copied to clipboard

A copy at a different audio level.

Link copied to clipboard
fun withClips(clips: List<Clip>): Track

A copy with different clips.

Link copied to clipboard

A copy that contributes different streams.

Link copied to clipboard

A copy with different track-level effects.

Link copied to clipboard
fun withFadeIn(fadeIn: Duration): Track

A copy whose audio rises from silence over fadeIn.

Link copied to clipboard
fun withFadeOut(fadeOut: Duration): Track

A copy whose audio falls to silence over fadeOut.

Link copied to clipboard
fun withLooping(looping: Boolean): Track

A copy that loops, or plays its clips once.

Link copied to clipboard
fun withStart(start: Duration): Track

A copy that begins at a different point in the composition.