effectcraft/crates/render/src
bflatastic 93856382e7 Preview: Audio, Lock and Shy keep the cache; playback with audio waits for frames (#103)
Toggling a layer's Audio, Lock or Shy switch (or Hide Shy Layers) threw
away every cached frame: the RAM preview identity hashes each comp's
address, which any edit replaces, and the layer and disk cache keys
hashed every switch. None of these change pixels.

- Switches::pixels, Layer::same_pixels and Comp::same_pixels (exhaustive
  field lists, so a new field must be considered) and Comp::pixel_form.
- Layer cache keys hash Switches::pixels; the disk cache's comp content
  key hashes Comp::pixel_form.
- Frames::identity: when a new revision's comps draw the same pixels as
  those of the comp's last new identity, that identity (and the project
  holding its comps' addresses) is kept, so the frames stay, also when the
  switch is toggled back.

With audio on, playback skipped frames that weren't rendered yet. Now the
sound waits: until the frames ahead (to the end of the preview, or what
fits in the RAM preview) are cached, every frame shows as it renders,
silently, like a preview without audio; then the sound starts in sync.
Reaching an uncached frame stops the sound instead of skipping frames.

Tests: audio_lock_and_shy_switches_keep_the_frames (frames.rs, nested
comps and toggling back), audio_lock_and_shy_keep_cached_layers (engine),
the disk key in tests_disk_cache, and
preview_with_audio_shows_every_frame_and_sounds_once_cached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 01:46:35 +07:00
..
shapes Never crash: render and gpu crates without panic!() 2026-10-04 14:20:37 -04:00
text M4.11: one motion blur gate for layers, masks, effects and Advanced 3D 2026-10-05 01:55:34 +07:00
three_d G2: improve editing reliability and Windows rendering fidelity 2026-10-06 00:00:31 -05:00
audio.rs G2: improve editing reliability and Windows rendering fidelity 2026-10-06 00:00:31 -05:00
auto.rs M13.13: gpu texture pool, Auto per-comp backend choice, warp-family GPU ports 2026-10-03 10:31:31 -04:00
cache.rs Preview: Audio, Lock and Shy keep the cache; playback with audio waits for frames (#103) 2026-10-07 01:46:35 +07:00
color.rs Never crash: render and gpu crates without panic!() 2026-10-04 14:20:37 -04:00
disk_cache.rs Preview: Audio, Lock and Shy keep the cache; playback with audio waits for frames (#103) 2026-10-07 01:46:35 +07:00
eval.rs M4.9: Preserve frame rate when nested or in render queue, Preserve resolution when nested 2026-10-05 01:33:14 +07:00
lib.rs M4.13: motion blur of collapsed precomps and of animated shape / text content 2026-10-05 12:35:30 +07:00
masks.rs M4.11: one motion blur gate for layers, masks, effects and Advanced 3D 2026-10-05 01:55:34 +07:00
passes.rs M13.30: web depth and polish 2026-10-04 02:57:17 -04:00
shapes.rs M13.8: Advanced 3D iris depth of field, collapsed precomps, extruded strokes 2026-10-03 07:47:25 -04:00
styles.rs M9.4: layer styles render + commands 2026-10-02 00:00:00 -04:00
tests.rs Never crash: render and gpu crates without panic!() 2026-10-04 14:20:37 -04:00
tests_audio_fx.rs CMP-7: Essential Graphics controls, master properties, .ectemplate templates, Responsive Design — Time 2026-10-02 22:44:06 -04:00
tests_auto.rs M13.13: gpu texture pool, Auto per-comp backend choice, warp-family GPU ports 2026-10-03 10:31:31 -04:00
tests_aux.rs M9.11: 3D Channel effects on auxiliary channels 2026-10-02 21:28:37 -04:00
tests_collapse.rs G2: improve editing reliability and Windows rendering fidelity 2026-10-06 00:00:31 -05:00
tests_color.rs CMP-7: Essential Graphics controls, master properties, .ectemplate templates, Responsive Design — Time 2026-10-02 22:44:06 -04:00
tests_frame_blend.rs CMP-7: Essential Graphics controls, master properties, .ectemplate templates, Responsive Design — Time 2026-10-02 22:44:06 -04:00
tests_mask_blur.rs M4.11: one motion blur gate for layers, masks, effects and Advanced 3D 2026-10-05 01:55:34 +07:00
tests_nested.rs M4.10: a nested comp shows nothing before it starts or after it ends 2026-10-05 01:47:54 +07:00
tests_paint.rs M13.1/M13.2: paint (Brush, Clone Stamp, Eraser) and puppet pins 2026-10-02 09:12:10 -04:00
tests_remap.rs M5.2–M5.5: keyframe clipboard, easy ease, velocity/interpolation dialogs, roving, time remap/stretch/reverse/freeze, graph editor, separate dimensions, pick-whip 2026-10-01 21:47:29 -04:00
tests_roi.rs M13.5: extended viewer (custom 3D views / Draft 3D render the pasteboard around the comp frame; view.extendedViewer) 2026-10-03 05:14:12 -04:00
tests_styles.rs M9.4: layer styles render + commands 2026-10-02 00:00:00 -04:00
tests_time.rs M9.5: time effects (Echo, Posterize Time, Time Difference, Time Displacement, Timewarp, CC Force Motion Blur, CC Wide Time, Pixel Motion Blur) 2026-10-01 23:42:11 -04:00
text.rs M13.12: Variable Font Axes animators change advances (text re-spaced) 2026-10-03 09:34:15 -04:00