LayerTimeline

class LayerTimeline(val id: String)

Per-source (per-layer) counterpart to the global Timeline companion state: tracks this layer's own valid-time lists, requested/downloaded interval bookkeeping, current phase indices and meld, and staggered (sparse-then-fill) download progress. One instance is registered per source id in Timeline.sourceTimeHash.

Constructors

Link copied to clipboard
constructor(id: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Index into reqStrings/reqLongs for the lower interval of the currently displayed pair, as last resolved by calcRenderVarFromDownloadedTimes.

Link copied to clipboard

Index into reqStrings/reqLongs for the upper interval of the currently displayed pair, as last resolved by calcRenderVarFromDownloadedTimes.

Link copied to clipboard

Set by updateStaggeredPlaybackState when the fill-interval download wave should be scheduled via Timeline.requestStaggeredFillDownload; consumed and cleared by the caller that schedules it.

Link copied to clipboard
val id: String

The source id this timeline tracks.

Link copied to clipboard

The most recent meld value retained while paused or while viewportPlaybackReady is false, so the displayed frame holds steady instead of resetting.

Link copied to clipboard
var meld: Float

Crossfade fraction (0.0-1.0) between the intervals at currentA and currentB for this layer, as last computed by calcRenderVarFromDownloadedTimes.

Link copied to clipboard

True while this layer's own playback is frozen independent of the global timeline (e.g. holding position while waiting on viewport tiles).

Link copied to clipboard

Current stage of this layer's staggered (sparse-then-fill) download/playback progression; advanced by updateStaggeredPlaybackState.

Link copied to clipboard

Frozen interval shown while viewportPlaybackReady is false.

Link copied to clipboard

True when every viewport tile is ready for computeGlobalAnimationTarget.

Functions

Link copied to clipboard

Adds element if it is not already present in this list, returning whether it was added.

Link copied to clipboard

Recomputes meld/currentA/currentB/phaseAString/phaseBString for this layer from the global playhead (Timeline.currentPhaseA/Timeline.currentPhaseB/Timeline.dataMeld) mapped onto this layer's actually-downloaded reqLongs/reqStrings. Holds at lastMeld instead of advancing while paused or while viewportPlaybackReady is false, or if the global valid-time lists are empty.

Link copied to clipboard
fun commitDisplayPhases(phaseA: String, phaseB: String, displayMeld: Float, playbackReady: Boolean, holdPhase: String?)

Commits the resolved display state for this layer's current frame: stores phaseA/phaseB/ displayMeld as the new phaseAString/phaseBString/meld (and lastMeld), updates viewportPlaybackReady, and records the currently visible phase into viewportHoldPhase (or holdPhase when not playback-ready) so a subsequent frame can retain it if the next target isn't ready.

Link copied to clipboard

Global timeline position mapped onto this layer's valid timeStrings / timeLongs. Used as the animation target for viewport-complete playback gating in RenderPass.

Link copied to clipboard

Filters which layer valid-time indices are enqueued for download in the current pass.

Link copied to clipboard
fun findInterpolationValuesFromAllValidTimes(targetValue: Long, sortedList: List<Long>): InterpolationResult?

Finds the two values in a sorted list that a target value falls between, and calculates the fractional distance between them.

Link copied to clipboard

Called after this layer's timeStrings/timeLongs change (new valid times resolved for the current range): rebuilds the sparse lists, resets staggeredPhase based on useStaggeredDownload, and clears the requested-interval bookkeeping (reqStrings/ reqLongs/reqIsPass2) so stale entries resolved against a previous date range cannot linger and permanently block full-range readiness.

Link copied to clipboard

Atomic snapshot of both playback lists together — playbackTimeStrings and playbackTimeLongs called separately can each be individually consistent yet still return a torn pair (one generation of longs paired with a different generation of strings) if refreshSparseLists runs between the two calls.

Link copied to clipboard

Companion to playbackTimeStrings: the matching epoch-second list, using the sparse subset while useSparsePlayback applies and the full list otherwise.

Link copied to clipboard

Intervals used for animation target and viewport hold while sparse or loading fill.

Link copied to clipboard

Rebuilds sparseTimeStrings/sparseTimeLongs from every other entry (even indices) of timeStrings/timeLongs, under timeListsLock so a concurrent reader never observes a partially-cleared list.

Link copied to clipboard

Intervals to try to keep on screen when the next target is not ready yet.

Link copied to clipboard
fun updateStaggeredPlaybackState(allReadyForPhase: (String) -> Boolean): Boolean

Advances sparse → fill → full playback. Returns true when the fill-interval download wave should be scheduled via Timeline.requestStaggeredFillDownload.

Link copied to clipboard

True when this layer has enough valid intervals (STAGGERED_MIN_INTERVAL_COUNT or more) to use staggered sparse-then-fill downloading instead of requesting every interval at once.

Link copied to clipboard

Phase string currently shown (or last shown) for retain-on-playback.