CaptureSpec

@Serializable
data class CaptureSpec(val mode: CaptureMode = CaptureMode.ALL, val include: List<ElementSelector> = emptyList(), val exclude: List<ElementSelector> = emptyList(), val captureWindow: CaptureWindow? = null)(source)

The animation capture configuration (Phase 9): what and when to record, separate from the presentation/layout. Two axes:

  • WHATmode is CaptureMode.ALL (default; every animatable element, today's behavior) or CaptureMode.SELECTED (only include, minus exclude).

  • WHENcaptureWindow bounds capture to [startTime, endTime]; null = whole run.

Defaults reproduce current behavior exactly (capture-all, no window), so embedding this in TracingConfig is additive. The selectors are not matched against a model here — that author-time validation is Phase 9A.5; the attachment consumes this spec to register emitters selectively (9A.4) and to compose the windowed sink + opening-frame snapshot (9B).

Constructors

Link copied to clipboard
constructor(mode: CaptureMode = CaptureMode.ALL, include: List<ElementSelector> = emptyList(), exclude: List<ElementSelector> = emptyList(), captureWindow: CaptureWindow? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun captures(kind: ElementKind, name: String): Boolean

Whether the element identified by kind and name should be captured: in CaptureMode.ALL everything is captured except exclude; in CaptureMode.SELECTED only include is captured, minus exclude. (exclude always wins.) Used by the trace attachment to register emitters selectively (9A.4).

Link copied to clipboard

Validates this capture spec against inventory (9A.5): every include/exclude ElementSelector must name an element the inventory actually exposes for its ElementKind. A selector that names a non-existent element (or names one of the wrong kind) silently captures nothing, so this surfaces the typo at author time with a nearest-name hint drawn from that kind's names.