Files
amethyst/commonsUI
davotoula 5b8e6e5b0a refactor(audio): simplify the visualizer pacing and stop it polling while idle
Cleanup pass over the visualizer fix:

- Fold SpectrumPacer into SpectrumTrail. It had one caller and only wrapped an
  ArrayDeque; its unused 64-frame default contradicted the real 24-frame cap.
  Its three tests were already covered by SpectrumTrailTest.
- Size the PcmTapRegistry flow buffer from SpectrumTrail.MAX_BACKLOG_FRAMES
  instead of a separate 63. Both drop the stalest frame, so the visualizer
  keeps the same newest frames either way; the trail's cap is the one that
  actually bounds how far the picture can lag the sound.
- Move the cluster-delivery test into SpectrumAudioBufferSinkTest on its
  existing monoPcm/sineShorts helpers instead of a second PCM encoder.
  Re-checked against the old 2-slot buffer: it still fails with 2 of 8.
- Park the pacing loop off the frame clock while nothing is queued. It woke
  the main thread every vsync (up to 120 Hz) even when paused, which was new
  work for the non-animated bars and radial styles. It parks only after a
  nextOrNull has seen the empty queue, so the starvation reset still runs and
  the next cluster is not dumped at once to catch up.
- Keep the cluster-timing explanation in the SpectrumTrail KDoc only. It had
  been restated in six places and the copies had already drifted (210 vs
  220 ms). Also corrects the SpectrumCanvas KDoc's redraw-rate claim, which
  only held for bars and radial.
2026-09-27 08:49:09 +02:00
..