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

Function OptionListDevices

cli.cpp:444–545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442}
443
444void OptionListDevices(std::vector<RGBController *>& rgb_controllers)
445{
446 ResourceManager::get()->WaitForDeviceDetection();
447
448 for(std::size_t controller_idx = 0; controller_idx < rgb_controllers.size(); controller_idx++)
449 {
450 RGBController *controller = rgb_controllers[controller_idx];
451
452 /*---------------------------------------------------------*\
453 | Print device name |
454 \*---------------------------------------------------------*/
455 std::cout << controller_idx << ": " << controller->name << std::endl;
456
457 /*---------------------------------------------------------*\
458 | Print device type |
459 \*---------------------------------------------------------*/
460 std::cout << " Type: " << device_type_to_str(controller->type) << std::endl;
461
462 /*---------------------------------------------------------*\
463 | Print device description |
464 \*---------------------------------------------------------*/
465 if(!controller->description.empty())
466 {
467 std::cout << " Description: " << controller->description << std::endl;
468 }
469
470 /*---------------------------------------------------------*\
471 | Print device version |
472 \*---------------------------------------------------------*/
473 if(!controller->version.empty())
474 {
475 std::cout << " Version: " << controller->version << std::endl;
476 }
477
478 /*---------------------------------------------------------*\
479 | Print device location |
480 \*---------------------------------------------------------*/
481 if(!controller->location.empty())
482 {
483 std::cout << " Location: " << controller->location << std::endl;
484 }
485
486 /*---------------------------------------------------------*\
487 | Print device serial |
488 \*---------------------------------------------------------*/
489 if(!controller->serial.empty())
490 {
491 std::cout << " Serial: " << controller->serial << std::endl;
492 }
493
494 /*---------------------------------------------------------*\
495 | Print device modes |
496 \*---------------------------------------------------------*/
497 if(!controller->modes.empty())
498 {
499 std::cout << " Modes:";
500
501 int current_mode = controller->GetMode();

Callers 1

ProcessOptionsFunction · 0.85

Calls 7

device_type_to_strFunction · 0.85
QuoteIfNecessaryFunction · 0.85
getFunction · 0.50
sizeMethod · 0.45
emptyMethod · 0.45
GetModeMethod · 0.45

Tested by

no test coverage detected