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

◆ applyConfig()

void fl::Channel::applyConfig ( const ChannelConfig & config)

Apply reconfigurable settings from a ChannelConfig.

Parameters
configThe configuration to apply
Note
Does NOT change: mChipset, mDriver, mId

Definition at line 287 of file channel.cpp.hpp.

287 {
288 mRgbOrder = config.rgb_order;
289 if (config.mName.has_value()) {
290 mName = config.mName.value();
291 }
292 setLeds(config.mLeds);
293 // Sync mSettings from incoming options so the mWhiteCfg variant survives
294 // to showPixels(). Setters below are idempotent overlays on the same data.
295 mSettings = config.options;
296 setCorrection(config.options.mCorrection);
297 setTemperature(config.options.mTemperature);
298 setDither(config.options.mDitherMode);
299 applyWhiteCfg(*this, config.options);
300 auto& events = ChannelEvents::instance();
301 events.onChannelConfigured(*this, config);
302}
CLEDController & setCorrection(CRGB correction) FL_NOEXCEPT
The color corrction to use for this controller, expressed as a CRGB object.
CLEDController & setLeds(CRGB *data, int nLeds) FL_NOEXCEPT
Set the default array of LEDs to be used by this controller.
CLEDController & setDither(fl::u8 ditherMode=BINARY_DITHER) FL_NOEXCEPT
Set the dithering mode for this controller to use.
CLEDController & setTemperature(CRGB temperature) FL_NOEXCEPT
Set the color temperature, aka white point, for this controller.
EOrder mRgbOrder
Definition channel.h:255
fl::string mName
Definition channel.h:277
ChannelOptions mSettings
Definition channel.h:278
void applyWhiteCfg(CLEDController &ctrl, const ChannelOptions &options) FL_NOEXCEPT
Apply the white-channel selection from ChannelOptions to a CLEDController.
static ChannelEvents & instance()

References fl::ChannelEvents::instance(), fl::ChannelOptions::mCorrection, fl::ChannelOptions::mDitherMode, fl::ChannelConfig::mLeds, mName, fl::ChannelConfig::mName, mRgbOrder, mSettings, fl::ChannelOptions::mTemperature, fl::ChannelConfig::options, fl::ChannelConfig::rgb_order, fl::CLEDController::setCorrection(), fl::CLEDController::setDither(), fl::CLEDController::setLeds(), and fl::CLEDController::setTemperature().

+ Here is the call graph for this function: