| 246 | } |
| 247 | |
| 248 | bool ChannelManager::setExclusiveDriverByName(const char* name) { |
| 249 | // Handle null or empty name: disable everything. |
| 250 | if (!name || !name[0]) { |
| 251 | FL_ERROR("ChannelManager::setExclusiveDriverByName() - Null or empty driver name provided"); |
| 252 | mExclusiveDriver.clear(); |
| 253 | for (auto& entry : mDrivers) { |
| 254 | entry.enabled = false; |
| 255 | } |
| 256 | return false; |
| 257 | } |
| 258 | |
| 259 | // Store exclusive driver name for forward compatibility. |
| 260 | // When non-empty, addDriver() will auto-disable non-matching drivers. |
| 261 | mExclusiveDriver = name; |
| 262 | |
| 263 | // Single-pass: enable only drivers matching the given name. |
| 264 | bool found = false; |
| 265 | for (auto& entry : mDrivers) { |
| 266 | entry.enabled = (entry.name == name); |
| 267 | found = found || entry.enabled; |
| 268 | } |
| 269 | |
| 270 | if (!found) { |
| 271 | FL_ERROR("ChannelManager::setExclusiveDriverByName() - Driver '" << name << "' not found in registry"); |
| 272 | } |
| 273 | return found; |
| 274 | } |
| 275 | |
| 276 | bool ChannelManager::setDriverPriority(const fl::string& name, int priority) { |
| 277 | if (name.empty()) { |