FastLED
3.9.15
Loading...
Searching...
No Matches
◆
getHistoricalFFT()
const
fft::Bins
* fl::audio::Context::getHistoricalFFT
(
int
framesBack
)
const
Definition at line
120
of file
audio_context.cpp.hpp
.
120
{
121
if
(framesBack < 0 || framesBack >=
static_cast<
int
>
(
mFFTHistory
.size())) {
122
return
nullptr
;
123
}
124
// Ring buffer lookup: walk backwards from the most-recently-written slot.
125
// Adding history.size() before the modulo avoids negative values from
126
// the subtraction, since C++ modulo of negative ints is implementation-defined.
127
const
int
n =
static_cast<
int
>
(
mFFTHistory
.size());
128
int
index = (
mFFTHistoryIndex
- 1 - framesBack + n) % n;
129
return
&
mFFTHistory
[index];
130
}
fl::audio::Context::mFFTHistory
vector< fft::Bins > mFFTHistory
Definition
audio_context.h:92
fl::audio::Context::mFFTHistoryIndex
int mFFTHistoryIndex
Definition
audio_context.h:94
References
mFFTHistory
, and
mFFTHistoryIndex
.
fl
audio
Context
Generated on Tue Jun 16 2026 00:07:08 for FastLED by
1.13.2