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

Function ParseMode

cli.cpp:315–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313}
314
315unsigned int ParseMode(DeviceOptions& options, std::vector<RGBController *> &rgb_controllers)
316{
317 // no need to check if --mode wasn't passed
318 if (options.mode.size() == 0)
319 {
320 return rgb_controllers[options.device]->active_mode;
321 }
322
323 /*---------------------------------------------------------*\
324 | Search through all of the device modes and see if there is|
325 | a match. If no match is found, print an error message. |
326 \*---------------------------------------------------------*/
327 for(unsigned int mode_idx = 0; mode_idx < rgb_controllers[options.device]->modes.size(); mode_idx++)
328 {
329 if (strcasecmp(rgb_controllers[options.device]->modes[mode_idx].name.c_str(), options.mode.c_str()) == 0)
330 {
331 return mode_idx;
332 }
333 }
334
335 std::cout << "Error: Mode '" + options.mode + "' not available for device '" + rgb_controllers[options.device]->name + "'" << std::endl;
336 return false;
337}
338
339DeviceOptions* GetDeviceOptionsForDevID(Options *opts, int device)
340{

Callers 1

ApplyOptionsFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected