| 611 | } |
| 612 | |
| 613 | bool OptionZone(std::vector<DeviceOptions>* current_devices, std::string argument, Options* /*options*/, std::vector<RGBController *>& rgb_controllers) |
| 614 | { |
| 615 | bool found = false; |
| 616 | ResourceManager::get()->WaitForDeviceDetection(); |
| 617 | |
| 618 | try |
| 619 | { |
| 620 | int current_zone = std::stoi(argument); |
| 621 | |
| 622 | for(size_t i = 0; i < current_devices->size(); i++) |
| 623 | { |
| 624 | int current_device = current_devices->at(i).device; |
| 625 | |
| 626 | if(current_zone >= static_cast<int>(rgb_controllers[current_device]->zones.size()) || (current_zone < 0)) |
| 627 | { |
| 628 | throw nullptr; |
| 629 | } |
| 630 | |
| 631 | current_devices->at(i).zone = current_zone; |
| 632 | found = true; |
| 633 | } |
| 634 | } |
| 635 | catch(...) |
| 636 | { |
| 637 | std::cout << "Error: Invalid zone ID: " + argument << std::endl; |
| 638 | return false; |
| 639 | } |
| 640 | |
| 641 | return found; |
| 642 | } |
| 643 | |
| 644 | bool CheckColor(std::string argument, DeviceOptions* currentDevOpts) |
| 645 | { |
no test coverage detected