feat(autodj): configurable overlap cap (auto or 2–30 s) (#1173)

This commit is contained in:
cucadmuh
2026-06-24 22:00:35 +03:00
committed by GitHub
parent c3e6be537c
commit 58e6efc68c
29 changed files with 250 additions and 17 deletions
@@ -247,9 +247,12 @@ pub async fn audio_play(
state.crossfade_enabled.load(Ordering::Relaxed) && (!manual || manual_blend);
// Per-transition override (dynamic crossfade) caps the fade for this swap;
// otherwise fall back to the global crossfade length. Both clamped the same.
let crossfade_secs_val = crossfade_secs_override
.unwrap_or_else(|| f32::from_bits(state.crossfade_secs.load(Ordering::Relaxed)))
.clamp(0.5, 12.0);
let crossfade_secs_val = if let Some(override_secs) = crossfade_secs_override {
override_secs.clamp(0.5, 30.0)
} else {
f32::from_bits(state.crossfade_secs.load(Ordering::Relaxed))
.clamp(0.5, 12.0)
};
// Measure how much audio Track A actually has left right now.
// By the time audio_play is called, near_end_ticks (2×500ms) + IPC latency