FastLED 3.10.8
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 534 of file channel.cpp.hpp.

534 {
535 mRgbOrder = config.rgb_order;
536 if (config.mName.has_value()) {
537 mName = config.mName.value();
538 }
539 setLeds(config.mLeds);
540 // Replace Channel-owned options and synchronize the base rendering fields.
541 mSettings = config.options;
542#if !FL_COLOR_PROFILE_RUNTIME && !defined(FL_IS_AVR)
543 // Tiny options cannot carry a replacement profile; applying them is a
544 // legacy transition, just like the base correction/temperature setters.
546#endif
547 mBus = config.options.mBus;
548 mBusWhich = config.options.mBusWhich;
550 auto& events = ChannelEvents::instance();
551#if FL_COLOR_PROFILE_RUNTIME
552 if (reconcileColorProfile(config.options)) {
553 events.onColorProfileFallback(ColorProfileEvent{id(), colorProfileStatus(), {}});
554 }
555#endif
556 events.onChannelConfigured(*this, config);
557}
CLEDController & setLeds(CRGB *data, int nLeds) FL_NO_EXCEPT
Set the default array of LEDs to be used by this controller.
EOrder mRgbOrder
Definition channel.h:415
fl::u8 mBusWhich
Definition channel.h:439
i32 id() const FL_NO_EXCEPT override
Get the channel ID.
Definition channel.h:106
ColorProfileStatus colorProfileStatus() const FL_NO_EXCEPT
Definition channel.h:275
void syncLegacySettings() FL_NO_EXCEPT
bool mStaticProfileCleared
Definition channel.h:461
fl::string mName
Definition channel.h:456
ChannelOptions mSettings
Definition channel.h:459
static ChannelEvents & instance() FL_NO_EXCEPT

References colorProfileStatus(), fl::FL_NO_EXCEPT, id(), fl::ChannelEvents::instance(), mBus, mBusWhich, mName, mRgbOrder, mSettings, mStaticProfileCleared, fl::CLEDController::setLeds(), and syncLegacySettings().

+ Here is the call graph for this function: