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:

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

  • WHEN — captureWindow 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
fun capturesMember(ownerKind: ElementKind, ownerName: String, kind: ElementKind, name: String): Boolean

Whether a member of a captured owner is captured: the owner (ownerKind, ownerName) must be captured and the member (kind, name) must not be excluded. Selecting a guide path therefore brings its transporters with it, and an individual transporter can still be left out.

Link copied to clipboard
fun CaptureSpec.capturesStatistic(kind: ElementKind, name: String, offByDefault: Set<String>): Boolean

Whether the response or counter name of kind is captured: as CaptureSpec.captures says, except that a statistic in offByDefault is captured only when it is included by name.

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.