Select best driver for channel data (used by Channel::showPixels)
- Parameters
-
| data | Channel data to route (chipset configuration) |
| affinity | Engine affinity name (empty = no affinity, dynamic selection) |
- Returns
- Shared pointer to selected driver, or nullptr if none compatible
- Note
- Iterates drivers by priority (already sorted descending) and returns first that canHandle()
-
This is called lazily in Channel::showPixels() if no driver is bound
Definition at line 408 of file manager.cpp.hpp.
408 {
409 if (!data) {
410 FL_ERROR(
"ChannelManager::selectDriverForChannel() - Null channel data");
411 return fl::shared_ptr<IChannelDriver>();
412 }
413
414
415
416
417
418
419
420 do {
421 if (affinity.
empty()) {
422 break;
423 }
425 if (!driver) {
426 break;
427 }
428 if (!driver->canHandle(data)) {
429 FL_WARN_ONCE(
"ChannelManager: Affinity driver '" << affinity <<
"' cannot handle channel data (chipset/bus mismatch). Falling back to AUTO/priority dispatch.");
430 break;
431 }
432 return driver;
433 } while (false);
434
435
436
437 for (
const auto& entry :
mDrivers) {
438 if (!entry.enabled) continue;
439 if (entry.driver->canHandle(data)) {
440 return entry.driver;
441 }
442 }
443
444 FL_ERROR(
"ChannelManager: No compatible driver found for channel data");
445 return fl::shared_ptr<IChannelDriver>();
446}
fl::shared_ptr< IChannelDriver > findDriverByName(const fl::string &name) const FL_NO_EXCEPT
Silent counterpart to getDriverByName().
fl::vector< EngineEntry > mDrivers
Shared drivers sorted by priority descending (higher values first)
bool empty() const FL_NO_EXCEPT
#define FL_WARN_ONCE(...)
References fl::basic_string::empty(), findDriverByName(), FL_ERROR, FL_WARN_ONCE, and mDrivers.
Referenced by fl::SlimSpiBridgeController< CHIPSET, RGB_ORDER, B, B_WHICH >::resolveDriver(), and fl::Channel::resolveDynamicDriver().