FastLED 3.9.15
Loading...
Searching...
No Matches

◆ setCustomGains()

void fl::audio::SpectralEqualizer::setCustomGains ( span< const float > gains)

Set custom per-band gains (switches to Custom curve)

Parameters
gainsPer-band gain multipliers (size must match numBands)

Definition at line 103 of file spectral_equalizer.cpp.hpp.

103 {
104 if (gains.size() != mConfig.numBands) {
105 FL_WARN("SpectralEqualizer: custom gains size mismatch ("
106 << gains.size() << " != " << mConfig.numBands << ")");
107 return;
108 }
109
110 // Copy custom gains
111 mConfig.customGains.clear();
112 mConfig.customGains.reserve(gains.size());
113 for (size i = 0; i < gains.size(); ++i) {
114 mConfig.customGains.push_back(gains[i]);
115 mGains[i] = gains[i];
116 }
117
118 // Switch to custom curve
120}
SpectralEqualizerConfig mConfig
vector< float > mGains
Per-band gain multipliers.
#define FL_WARN(X)
Definition log.h:276

References fl::audio::Custom, FL_WARN, mConfig, mGains, and fl::span< T, Extent >::size().

Referenced by ~SpectralEqualizer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: