/** * How the playhead is moving, read from where it lands: playing forward at a * cadence, dragged, or stepped, and which way. Every prepared window that * works ahead of the playhead reads it here, so a drag or a fast rate reads * the same to each. */ /** The widest stride a present is taken to move: 8x of a 30 fps clip on 60 Hz. */ export declare const MAX_PRESENTED_FRAME_STRIDE = 4; /** * Share of a window spent the way the playhead is heading, as the engine's * scrub window spends it. The rest covers the ground just behind, which is * what a reversal lands on before the new heading is established. */ export declare const WINDOW_LEAD_FRACTION = 0.75; export interface PlayheadMotion { /** * The playhead landed at `position`. `settledAdvance` is the widest * forward step playback makes, in the same unit; a move past it, or any * move back, is a jump. */ observe(position: number, settledAdvance: number): void; /** * False while the playhead is dragged: it jumped twice in a row. A single * jump is a seek that lands, and the window may lead it at once. */ readonly settled: boolean; /** Which way the playhead travels: 1, -1, or 0 without enough to say. */ heading(): -1 | 0 | 1; /** Playback started or stopped: the gesture that moved the playhead is over. */ endGesture(): void; } export declare function createPlayheadMotion(now?: () => number): PlayheadMotion; /** * How many frames each present moves, from the last few that moved. A * cadence counts only once it has repeated, which is what separates it from * a seek. */ export interface PresentedFrameStride { observe(step: number): void; /** The narrowest of the repeated strides, 1 until there are enough. */ narrowest(): number; /** How far presents move on average, 1 until there are enough. */ average(): number; /** * The stride every recent present moved, or 1 when they differ: a cadence * that alternates lands on frames no single stride names. */ uniform(): number; reset(): void; } /** * `sampleCount` is how many moves a cadence has to repeat over. A cadence * that is not a whole number of frames, 3.2 at 8x of 24 fps on 60 Hz, moves * 3, 3, 3, 3 and then 4, so a reading that skips frames on it needs more * than four moves to see that. */ export declare function createPresentedFrameStride(sampleCount?: number): PresentedFrameStride; /** * The playhead's own frame plus one schedule batch ahead. A batch is the most * a window commits to in one pass, so a resting playhead holds a single pass * of work, and a step forward still lands on a frame already prepared. */ export declare function getPausedPreparedWindowFrameCount(options: { readonly prefetchFrameCount: number; readonly scheduleBatchSize: number; }): number; //# sourceMappingURL=playhead-motion.d.ts.map