adjust smoothing in now playing spectrum

This commit is contained in:
Boof2015
2026-07-15 14:50:56 -04:00
parent b290cfed7a
commit b5f1ca9e99
9 changed files with 55 additions and 19 deletions
+6 -2
View File
@@ -68,11 +68,13 @@ class ScopeDriver {
// Render thread (single consumer). Snapshot the most recent fftSize mono
// samples, run the FFT, copy up to `cap` dB magnitudes into `out`.
// Returns the number of bins written.
size_t fillSpectrum(float* out, size_t cap) {
size_t fillSpectrum(float* out, size_t cap, float smoothing) {
if (out == nullptr || cap == 0) {
return 0;
}
spectrum_.setSmoothing(smoothing);
const int sr = pendingSampleRate_.load(std::memory_order_acquire);
if (sr != appliedSampleRate_) {
spectrum_.setSampleRate(static_cast<float>(sr));
@@ -209,11 +211,13 @@ class ScopeDriver {
}
// Render thread. Latest post-EQ spectrum window -> `out` (dB magnitudes).
size_t fillSpectrumPostEq(float* out, size_t cap) {
size_t fillSpectrumPostEq(float* out, size_t cap, float smoothing) {
if (out == nullptr || cap == 0) {
return 0;
}
postEqSpectrum_.setSmoothing(smoothing);
const int sr = pendingSampleRate_.load(std::memory_order_acquire);
if (sr != postEqAppliedSampleRate_) {
postEqSpectrum_.setSampleRate(static_cast<float>(sr));