Editor: clip volume slider takes effect live (fix mute that won't un-mute)
The timeline clip volume slider writes audio_volume via patchSceneQuiet, which updates state WITHOUT a re-render, so the player's cached clip.vol stayed stale. Dropping to 0% only "stuck" when some later action happened to rebuild the clips; dragging back above 0 never rebuilt, so the clip stayed muted. _applyFx now reads the scene's audio_volume (and audio_separated) LIVE from the store; it runs every frame during playback, so the slider tracks immediately both ways. Final-render volume already read live, so only preview was affected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
189b1e598b
commit
5ed5fcd59a
@@ -584,6 +584,14 @@
|
||||
// a non-finite volume throws on assignment, which (in the rAF tick) would freeze playback.
|
||||
const keepOrig = (S.get().project || {}).keep_original_audio !== false;
|
||||
let vol = (clip && clip.vol != null) ? +clip.vol : 1;
|
||||
// Read the scene's volume LIVE: the timeline slider changes audio_volume via
|
||||
// patchSceneQuiet (no re-render), so the cached clip.vol would stay stale —
|
||||
// a mute that never un-mutes when dragged back up. _applyFx runs every frame
|
||||
// during playback, so a live read tracks the slider immediately.
|
||||
if (clip && clip.sceneId && S.scene) {
|
||||
const sc = S.scene(clip.sceneId);
|
||||
if (sc) vol = sc.audio_separated ? 0 : (sc.audio_volume != null ? sc.audio_volume : 1);
|
||||
}
|
||||
if (!isFinite(vol)) vol = 1;
|
||||
const nv = keepOrig ? Math.max(0, Math.min(1, vol)) : 0;
|
||||
if (v.volume !== nv) { try { v.volume = nv; } catch (_) {} }
|
||||
|
||||
Reference in New Issue
Block a user