mirror of
https://github.com/Boof2015/astra-mobile.git
synced 2026-08-15 15:51:08 +02:00
adjust smoothing in now playing spectrum
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user