On this page:
preview-session?
inspector-subject?
inspector-document?
open-program-preview
open-project-preview
preview-scrub!
preview-play!
preview-set-loop-range!
preview-jump-to-section!
preview-jump-to-cue!
preview-session-diagnostics
scene-inspector-subject-at-path
scene-inspector-document
9.3

12 Interactive Preview and Inspection🔗

animate/preview provides the optional GUI and its headless controller API. Requiring it does not initialize a GUI; opening a window does. It uses the same scene sampling and rendering semantics as final output.

procedure

(preview-session? value)  boolean?

  value : any/c
Recognizes a live preview controller session.

procedure

(inspector-subject? value)  boolean?

  value : any/c
Recognizes an immutable semantic inspection subject.

procedure

(inspector-document? value)  boolean?

  value : any/c
Recognizes an immutable GUI-independent inspector snapshot.

procedure

(open-program-preview module-path 
  binding 
  [#:auto-reload? auto-reload? 
  #:fps fps 
  #:start start 
  #:start-block start-block 
  #:section section 
  #:pixel-scale pixel-scale 
  #:repl? repl? 
  #:title title]) 
  preview-session?
  module-path : path-string?
  binding : symbol?
  auto-reload? : boolean? = #t
  fps : exact-positive-integer? = 30
  start : (or/c #f real?) = #f
  start-block : (or/c #f symbol?) = #f
  section : (or/c #f symbol?) = #f
  pixel-scale : positive? = 1
  repl? : boolean? = #f
  title : string? = "Animate"
Loads a module binding containing a scene-program?, compiles it, and opens a hot-reloading preview. At most one of #:start and #:start-block may be supplied. Run the containing program with GRacket (or raco animate preview) rather than a headless Racket process.

procedure

(open-project-preview project    
  [#:target target    
  #:directory directory    
  #:title title])  preview-session?
  project : animate-project?
  target : project-target? = (project-target-all)
  directory : path-string? = (current-directory)
  title : (or/c #f string?) = #f
Prepares and opens an immutable project declaration. A module-binding source uses a restartable subprocess renderer; direct Scene or timeline sources use cooperative in-process cancellation.

procedure

(preview-scrub! session time)  void?

  session : preview-session?
  time : real?
Seeks during a drag. Older pending scrub work is superseded and the current time first uses the preview’s draft quality.

procedure

(preview-play! session)  void?

  session : preview-session?
Starts playback.

procedure

(preview-set-loop-range! session start end)  void?

  session : preview-session?
  start : real?
  end : real?
Stores a half-open loop range. It applies to both visual playback and an available project audio monitor.

procedure

(preview-jump-to-section! session name)  void?

  session : preview-session?
  name : symbol?
Jumps to the named authored section.

procedure

(preview-jump-to-cue! session name)  void?

  session : preview-session?
  name : symbol?
Jumps to the named authored cue.

procedure

(preview-session-diagnostics session)  immutable-hash?

  session : preview-session?
Returns one immutable production-monitor snapshot: requested and displayed sample times, quality, cache state, cancellation count, worker information, and recent rendering measurements.

procedure

(scene-inspector-subject-at-path state    
  path)  inspector-subject?
  state : scene-state?
  path : visual-path?
Builds a stable inspector subject for a sampled Visual path. It promotes a uniquely mapped formula leaf to its precise source-map unit and never guesses between repeated or shared source occurrences.

procedure

(scene-inspector-document scene 
  time 
  [#:subject subject]) 
  inspector-document?
  scene : scene?
  time : real?
  subject : (or/c #f inspector-subject?) = #f
Creates the immutable, GUI-independent inspector model for a scene sample. Formula maps, active string-match plans, relation dependency reports, camera, and preview-only overlays all live in this value; inspecting does not invalidate the bitmap cache.

Limitations: hard cancellation is available only for a module-backed project worker. An arbitrary direct Scene can contain an opaque Racket procedure, so it is cancelable only at cooperative rendering boundaries. Audio monitoring is optional and requires a usable ffplay installation.