Skip to content

anim-format (runtime format) / ClipClockHost

Interface: ClipClockHost ​

what a clock needs from the clip it drives

Methods ​

admit()? ​

ts
admit?(f): number | null;

where the playhead may go instead of f; null = nowhere (the run is over). Absent = f

Parameters ​

ParameterType
fnumber

Returns ​

number | null


arrived()? ​

ts
arrived?(): void;

a playTo arrived

Returns ​

void


complete()? ​

ts
complete?(): void;

it reached its end without looping

Returns ​

void


edgeBeat()? ​

ts
edgeBeat?(): void;

a playTo ran past the timeline's edge: a beat that shows nothing new

Returns ​

void


effect() ​

ts
effect(a, at): void;

an action that moves no playhead (sounds, visibility, emit, scripts, canned motions, pages …); at = the frame it happens on (the list's own frame on the clip running it, else the target's frame)

Parameters ​

ParameterType
aPlaybackAction
atnumber

Returns ​

void


end()? ​

ts
end?(): void;

a linear timeline ran off its end

Returns ​

void


entered() ​

ts
entered(
   from, 
   actions, 
   beat
): void;

the playhead is now on clock.frame (it was on from): show it, and with actions run its frame actions (clock.runActions(…, false)); beat = the clock moved it (not a jump)

Parameters ​

ParameterType
fromnumber
actionsboolean
beatboolean

Returns ​

void


find() ​

ts
find(path): ClipClock | null;

the clock of the clip a target path names (null = none)

Parameters ​

ParameterType
pathstring

Returns ​

ClipClock | null


frameCount() ​

ts
frameCount(): number;

Returns ​

number


hasStates()? ​

ts
hasStates?(): boolean;

the timeline has a state machine (anim-format states.ts)

Returns ​

boolean


jumped()? ​

ts
jumped?(): void;

a goto / showing moved the playhead (streams silenced by stopSounds may sound again)

Returns ​

void


loopWarning() ​

ts
loopWarning(f): void;

a gotoNow back into a frame visited in this round (void)

Parameters ​

ParameterType
fnumber

Returns ​

void


missing()? ​

ts
missing?(a): void;

a goto / playTo / scene action found no frame

Parameters ​

ParameterType
aPlaybackAction

Returns ​

void


nested() ​

ts
nested(): Iterable<ClipClock>;

every clock nested inside, at any depth, parents first (stopAll)

Returns ​

Iterable<ClipClock>


over()? ​

ts
over?(): boolean;

the run is over (a linear export reached its end)

Returns ​

boolean


random() ​

ts
random(): number;

gotoRandom picks

Returns ​

number


resolve() ​

ts
resolve(
   ref, 
   scene, 
   mode
): number | null;

a goto / playTo / repeat target from the playhead (null = none)

Parameters ​

ParameterType
refClockFrameRef
scenestring | undefined
mode"playTo" | "goto"

Returns ​

number | null


rootClock() ​

ts
rootClock(): ClipClock;

the clock of the topmost clip (it keeps the global fps)

Returns ​

ClipClock


sceneSpans() ​

ts
sceneSpans(): readonly ClockScene[];

Returns ​

readonly ClockScene[]


stateMove()? ​

ts
stateMove?(forward): StateMove | null;

one state-machine beat (stateBeat), called on every beat when defined

Parameters ​

ParameterType
forwardboolean

Returns ​

StateMove | null


stateTaken()? ​

ts
stateTaken?(move, from): void;

a state move was taken (from = the frame it left)

Parameters ​

ParameterType
moveStateMove
fromnumber

Returns ​

void


stopStreams() ​

ts
stopStreams(): void;

stream sounds of this clip stop (a stop / wait)

Returns ​

void


ticking()? ​

ts
ticking?(ms): void;

before the playhead steps (part overlays tick)

Parameters ​

ParameterType
msnumber

Returns ​

void

HereSplash — 2D animation for the web