Commit Graph

54 Commits

Author SHA1 Message Date
morg
12ffcccdcd Externalize colors definitions to separate header file. 2021-11-04 13:50:01 +00:00
Alex
8f8f19c5c1 Fix very verbose cli param 2021-10-15 02:06:56 +00:00
Alex
4af8614fce Add formated loging for device detection
Commits merged and amended for code style by Adam Honse <calcprogrammer1@gmail.com>
2021-07-05 03:23:34 -05:00
Tom Greenwood
7624a70b67 Add Start at Login Option (Windows and Linux implemented, MacOS stubbed)
This merge request adds the following:

1. A new class AutoStart, designed to add login startup entries for Linux (FreeDesktop autostart) and Windows (Shortcut File).
1. CLI options to enable, disable and check for autostart. (--autostart-enable, --autostart-disable and --autostart-check). e.g. OpenRGB.exe --autostart-enable "--startminimized --server --profile Blue" --nodetect --noautoconnect
1. UI options to enable "Start At Login" with several other options (see screenshots in Comments)

Tested on KDE Neon and Windows 10 x64 (x64 build).

Commits squashed and amended for code style by Adam Honse <calcprogrammer1@gmail.com>
2021-06-26 02:45:48 -05:00
Chris
920542e8b6 Adding "random" to the acceptable inputs for the --color switch to align with GUI
* 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.
2021-06-20 23:35:37 -05:00
Chris
259ba898b0 Enumerate Wireless connected Logitech Lightspeed (Unifying) devices
+ 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>
2021-05-31 10:59:04 -07:00
Martin Hartl
94370c24a8 cli: Fix mode specific colors for range 2021-05-14 15:14:11 +02:00
Pol Rius
658eb3a1f7 Initialize profile_loaded properly 2021-05-12 18:27:22 +02:00
Chris
4ae8ea94ea Logging info and adding zeroed speed initialisation to fix #1241
* 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>
2021-04-11 11:59:25 -05:00
morg
b24f989dbc Ignore pre-detection argument (fixes #1300) 2021-04-09 16:48:56 +02:00
Chris
501a1ff489 Updated parsers to allow GUI to run implicitly for -v, -vv and --print-
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()
2021-03-28 22:27:27 +11:00
Chris
d926754745 Adding "--loglevel" to ignore list in cli::ProcessOptions 2021-03-28 00:55:40 -05:00
Chris
d65def0179 Fixing --help string for -p option
* Tweaked the profile mananger to allow to load profiles either with or
without the file extension
* Changed the --help string to reflect the change
2021-03-24 08:18:07 -05:00
k1-801
f1d6c2953d Logger tweaks
Commit amended for code style and minor cleanup by Adam Honse <calcprogrammer1@gmail.com>
2021-03-23 20:20:52 -05:00
Chris
8492a8c76e Prevent profiles loaded on startup from being overwritten 2021-03-23 12:47:27 -05:00
morg
e1faa783b6 Add new CLI option, separate auto-detect and auto-connect 2021-03-08 22:25:37 -06:00
Luca Lovisa
ed48c9634c Fix cli profile mode loading 2021-03-01 23:14:36 +01:00
jath03
84861ef989 Fixing profile loading #1135 2021-02-26 08:17:44 -06:00
jath03
e4ec0fa46b Fixed GUI not starting when configuration flags are used 2021-01-07 22:39:29 -08:00
Alex Avance
5f5d50ffd8 Enable profile loading for gui and server 2021-01-04 02:15:57 +00:00
jath03
5c50cc2ca9 Stopped GUI from starting when only --server flag is set 2020-12-26 03:20:10 -06:00
Adam Honse
a90edce03b Fix loading profiles from command line 2020-12-05 13:42:43 -06:00
Adam Honse
31e35884dd Add --config option where you can pass in a custom path for configuration files 2020-12-02 17:38:49 -06:00
Adam Honse
ddfcd1caf9 Split CLI processing into pre- and post-detection functions and add --localconfig and --nodetect options 2020-12-01 23:51:56 -06:00
Adam Honse
128bfc7792 Move network clients to Resource Manager 2020-09-22 12:17:54 -05:00
Adam Honse
f568253c51 Clean up more warnings 2020-09-02 18:25:58 -05:00
k1-801
8b8451017e Non-important warnings removed
Commit amended by Adam Honse <calcprogrammer1@gmail.com> due to merging from a different branch.
2020-09-01 23:29:00 -05:00
Adam Honse
634ec9f488 Wait on asynchronous device detection before performing CLI operations that require device list 2020-08-07 23:01:20 -05:00
Adam Honse
8667211180 Move console attachment to main and only perform if running in a terminal. (!102) 2020-08-05 21:49:20 -05:00
Adam Honse
dee23ec52e Use synchronous mode update function in CLI 2020-07-22 23:29:32 -05:00
Adam Honse
25f9e2a110 Add --client command line argument for opening network clients 2020-07-05 04:25:46 -05:00
Adam Honse
dfb2e52e7b Add --i2c-tools to help text with warning, set GUI flag if --i2c-tools is specified 2020-06-28 21:41:00 -05:00
Adam Honse
7d2877a8e9 Don't exit after loading a profile from the command line 2020-06-28 11:21:56 -05:00
Adam Honse
15ace9d094 Add flag to start application minimized to tray 2020-06-28 02:30:23 -05:00
Adam Honse
58aba0a147 Allow specifying --gui and --server together 2020-06-28 02:18:28 -05:00
Térence Clastres
b79ff124e6 Replace Sleep() by std::thread::sleep_for() 2020-06-24 09:28:11 -05:00
Adam Honse
60baf6d05f Remove duplicate line 2020-06-24 08:26:09 -05:00
Swyter
cb9b22804a Implement human color parsing in the command-line by using the standardized CSS 3 subset, well known for styling. Interpret first as text to avoid problems like 'darkgreen' being picked up as 0xDA.
- 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)
2020-06-23 23:15:10 -05:00
Térence Clastres
d2dfd03551 Use the default SDK port constant in the CLI 2020-06-23 23:10:41 -05:00
Térence Clastres
f3bdee9bd2 CLI: Allow --mode flag to be case insensitive
Also fix handling when no argument passed
2020-06-23 23:10:29 -05:00
Térence Clastres
0286a5dd58 CLI: Add daemon/server mode 2020-06-20 14:39:01 -05:00
Térence Clastres
b3cadbae5d Fix CLI
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
2020-06-19 16:46:57 -05:00
Adam Honse
eaa3b9a368 Add command line option to enable i2c tools 2020-05-12 11:01:46 -05:00
Adam Honse
aa1ad8db85 Add zone resizing to CLI 2020-04-04 02:53:55 -05:00
Adam Honse
fdbaf9bf63 Fix segfault in CLI 2020-03-22 22:18:30 -05:00
Adam Honse
08a1197b7e Fix arguments not parsing in CLI, add mode specific color support to CLI 2020-03-22 16:22:59 -05:00
Adam Honse
87a9ea5b14 Add some comments to the CLI code and clean up some warnings 2020-03-22 03:49:08 -05:00
Adam Honse
2b8d25559a Move help and version functions to the same place as the other arguments 2020-03-22 01:48:57 -05:00
Adam Honse
3db9189cbb Fix current device ID in CLI 2020-03-22 01:01:01 -05:00
Adam Honse
a0c379e8c7 Add profile saving to command line 2020-03-22 00:26:06 -05:00