| 682 | } |
| 683 | |
| 684 | bool OptionMode(std::vector<DeviceOptions>* current_devices, std::string argument, Options* options) |
| 685 | { |
| 686 | if(argument.size() == 0) |
| 687 | { |
| 688 | std::cout << "Error: --mode passed with no argument" << std::endl; |
| 689 | return false; |
| 690 | } |
| 691 | |
| 692 | /*---------------------------------------------------------*\ |
| 693 | | If a device is not selected i.e. size() == 0 | |
| 694 | | then add mode to allDeviceOptions | |
| 695 | \*---------------------------------------------------------*/ |
| 696 | bool found = false; |
| 697 | DeviceOptions* currentDevOpts = &options->allDeviceOptions; |
| 698 | |
| 699 | if(current_devices->size() == 0) |
| 700 | { |
| 701 | currentDevOpts->mode = argument; |
| 702 | currentDevOpts->hasOption = true; |
| 703 | found = true; |
| 704 | } |
| 705 | else |
| 706 | { |
| 707 | for(size_t i = 0; i < current_devices->size(); i++) |
| 708 | { |
| 709 | currentDevOpts = ¤t_devices->at(i); |
| 710 | |
| 711 | currentDevOpts->mode = argument; |
| 712 | currentDevOpts->hasOption = true; |
| 713 | found = true; |
| 714 | } |
| 715 | } |
| 716 | |
| 717 | return found; |
| 718 | } |
| 719 | |
| 720 | bool OptionBrightness(std::vector<DeviceOptions>* current_devices, std::string argument, Options* options) |
| 721 | { |