MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / OptionZone

Function OptionZone

cli.cpp:613–642  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

611}
612
613bool 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
644bool CheckColor(std::string argument, DeviceOptions* currentDevOpts)
645{

Callers 1

ProcessOptionsFunction · 0.85

Calls 3

getFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected