* Allows for the selection of color_mode = MODE_COLORS_RANDOM from the CLI for devices that support it
* For all other implementations will return a random colour from the `human_colors` struct
* To avoid filtering in the profile manager and to ensure that color_mode is set to MODE_COLORS_RANDOM correctly
for HW that has the mode flags
MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_PER_LED_COLOR
The values for speed_min, speed_max, colors_min and colors_max NEED to be initialised to allow for a saved
profile to load correctly in `ProfileManager::LoadDeviceFromListWithOptions`
Commit amended by Adam Honse <calcprogrammer1@gmail.com> to remove Aura SMBus change, will add as its own
commit.
+ Added common library for Logitech Protocol
+ Moved wireless detection to the LogitechProtocolCommon.cpp
+ Adding Direct Mode to the wireless control
+ Copying the mutex from Lightsync controller to avoid interference
+ Adding LED count info to controller constructor
+ Created a new Logitech class
+ Added Feature list enumeration
+ Added DeviceName detection from device
* Changed LogitechGProWirelessController to accomodate generic devices
* LED count from device is now used in RGBController setup
+ Adding Windows specific detection as Linux Kernel handles this already.
+ Adding virtual PIDS for wireless detection
* LOGITECH G403
* LOGITECH G502
* LOGITECH G703
* LOGITECH G900
* LOGITECH G903
* LOGITECH GPRO
+ Adding Logitech G900 Wired Gaming Mouse PID
+ Adding other all lightspeed mice to wired detector for testing
* Genericised and optimised code paths
* Speed up wireless detection
Commit amended for code style by Adam Honse <calcprogrammer1@gmail.com>
* Adding zeroed speed initialisation to modes that do not support speed to avoid bad save values in profile
* Bad values in saved profile will corrupt brightness calculation on load.
* Aligning profile version and header string
* Adding profile validation logging
* Adding success / failure logging for each controller when attempting to load profile
Commit amended by Adam Honse <calcprogrammer1@gmail.com>
source options
* Added cfg_args counter for each in cli_pre_detection()
* Added each to the ignore options in ProcessOptions()
* Includes slight update to OptionHelp()
- Also, and make case insensitive by using the strcasecmp() function. Both for colors and modes. The only improvement I can think of is stripping whitespace beforehand.
- Also, improve digit parsing by using `strtoul()`, previously only FF00FF worked, whereas now we can type things like 0xFF00ff or 0xff00ff.
For example; something like this should work: `OpenRGB.exe -c darkgreen,ff00ff,0xff0000,red,REd,teal,pink,gOLd,AAgoldo,magenta -m breathing`
(`AAgoldo` will throw a `Error: Unknown color: 'AAgoldo', skipping.`; and pick the next color instead, this is intended behavior)
It was not changing the colors since e3e6c034 and had an overflow on
`options->devices.size()` since 0f4ddd16 causing options not to be applied
Second issue was a bit trickier as it was not reproducable when using a
debug build. It seemed like `std::vector<DeviceOptions> devices` had an
overflow. I saw a bunch of warnings regarding comparison with implicit
cast so I figured I'd fix that first and see if it makes a difference.
Turns out it did and fixed the issue.
While toying around, I also noticed that `throw` didn't seem to work,
causing crashes later in the program. It turns out the catch-all clause
`catch (...)` is not necessary matching a `throw NULL` expression as it
might be of type `int`. The solution is to use `thrown nullptr;`
instead.
Reference: https://en.cppreference.com/w/cpp/language/try_catch