Layer Timeline
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.
Properties
Index into reqStrings/reqLongs for the lower interval of the currently displayed pair, as last resolved by calcRenderVarFromDownloadedTimes.
Index into reqStrings/reqLongs for the upper interval of the currently displayed pair, as last resolved by calcRenderVarFromDownloadedTimes.
Set by updateStaggeredPlaybackState when the fill-interval download wave should be scheduled via Timeline.requestStaggeredFillDownload; consumed and cleared by the caller that schedules it.
Current stage of this layer's staggered (sparse-then-fill) download/playback progression; advanced by updateStaggeredPlaybackState.
Frozen interval shown while viewportPlaybackReady is false.
True when every viewport tile is ready for computeGlobalAnimationTarget.
Functions
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.
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.
Global timeline position mapped onto this layer's valid timeStrings / timeLongs. Used as the animation target for viewport-complete playback gating in RenderPass.
Filters which layer valid-time indices are enqueued for download in the current pass.
Finds the two values in a sorted list that a target value falls between, and calculates the fractional distance between them.
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.
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.
Companion to playbackTimeStrings: the matching epoch-second list, using the sparse subset while useSparsePlayback applies and the full list otherwise.
Intervals used for animation target and viewport hold while sparse or loading fill.
Rebuilds sparseTimeStrings/sparseTimeLongs from every other entry (even indices) of timeStrings/timeLongs, under timeListsLock so a concurrent reader never observes a partially-cleared list.
Intervals to try to keep on screen when the next target is not ready yet.
Advances sparse → fill → full playback. Returns true when the fill-interval download wave should be scheduled via Timeline.requestStaggeredFillDownload.
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.
Phase string currently shown (or last shown) for retain-on-playback.