Compare commits

..
Author SHA1 Message Date
Adam Honse 567cdfcb6b Implement size verification on RGBController set description functions 2026-04-13 23:46:42 -05:00
Adam Honse e045ea9bf1 Clean up zone initialization dialog 2026-04-13 11:43:23 -05:00
Adam Honse 5bb2245307 Require local client permission for DeleteProfile, SaveProfile, UploadProfile, SetSettings, and SaveSettings operations, some general cleanup 2026-04-13 11:43:23 -05:00
Adam Honse 7bd6f67d75 Sanitize profile filenames 2026-04-13 11:43:23 -05:00
Adam Honse 03806ebe6b Add RescanDevices to plugin API 2026-04-13 11:43:23 -05:00
Adam Honse d4fcd40e3d Implement segment groups in zone editor 2026-04-13 11:43:23 -05:00
Adam Honse 91ecdaa9b7 Rework server initialization
* Only create server instance if server is actually needed
    * Pass initial server host and port through ResourceManager
    * Allow setting default server host and port in Server settings
2026-04-13 11:43:22 -05:00
stephen iacovelli f11b3057d3 Sort profiles list alphabetically 2026-04-13 11:43:22 -05:00
Adam Honse 5b335962f2 Organize OpenRGBSettingsPage with Group Boxes 2026-04-13 11:43:22 -05:00
Kasslim a1f75de3d9 Correct spelling Busses -> Buses
Commits merged by Adam Honse <[email protected]>
2026-04-13 11:43:22 -05:00
诺诺 5c7b084aa9 Add Nollie controller OS2.1 2026-04-13 11:43:22 -05:00
Adam Honse e6cebf4a61 Initial implementation of OpenRGB SDK protocol Wireshark dissector 2026-04-13 11:43:22 -05:00
Adam Honse ed07e5224f Add ACK to network packets processed by NetworkServer 2026-04-13 11:43:22 -05:00
Adam Honse 592c7ff4ed Only update device view when RGBController::UpdateLEDs signal is sent to OpenRGBDevicePage, fix device view not refreshing if multiple LEDs are selected 2026-04-13 11:43:22 -05:00
Adam Honse 22cc5da057 Don't emit selection update on mouse click event to avoid sending unnecessary events, also only send one type of event per mouse release event. Fix LED box not being updated 2026-04-13 11:43:22 -05:00
Adam Honse 6b0bf07838 Have dummy controller shut down its background thread immediately during constructor to save resources 2026-04-13 11:43:22 -05:00
Adam Honse b3383358c1 DeviceView code cleanup, formatting, commenting 2026-04-13 11:43:22 -05:00
Adam Honse 656579aff0 Fix selecting LEDs in device view 2026-04-13 11:43:22 -05:00
Adam Honse 3cbd28f6fe TabLabel sets its own tooltip so all tabs have a tooltip rather than just devices 2026-04-13 11:43:22 -05:00
Adam Honse e4d8dd9a48 Resize tabs when width is small 2026-04-13 11:43:22 -05:00
Adam Honse 3b11bd146c Rework adding segments with ConfigureZone 2026-04-13 11:43:22 -05:00
Adam Honse 1cbb5a48ac Zone and Segment type updates
* Add zone flags to indicate if fields are manually configurable and if they have been manually configured
  * Add flags field to segment type
  * Add segment flags for group start and group member
  * Add color mode support flags to zone (RGB, RBG, GRB, GBR, BRG, BGR)
  * Add color mode enum to zone
  * Update zone and segment description functions to support new fields
  * Rename the effects-only configurable size flag
  * Remove zone type and matrix map configuration from E1.31 manual configuration, use zone editor instead
  * Rework DeviceResizeZone to DeviceConfigureZone
  * Rework most ARGB controllers to allow zone customizations
  * Rework DRGBController to define devices in DRGBDevices list (similar to RazerDevices)
  * Rework NollieController to define devices in NollieDevices list (similar to RazerDevices)
2026-04-13 11:43:22 -05:00
Adam Honse 5a6eb93db4 Add matrix map automatic generation to matrix map editor 2026-04-13 11:43:22 -05:00
Adam Honse a02c9aa527 RGBController API changes and segment configuration updates
* Make the Get/Set RGBControler descriptor functions static
  * Add functions for getting the matrix_map_type for zone and segment matrix maps
  * Rename zone resize dialog to zone editor dialog
  * Add additional segment types
  * Add option to import segments configuration from JSON file in zone editor dialog
  * Update device view to be able to display matrix segment types
  * Add matrix map editor dialog for creating/editing segment matrix maps
  * Add option to export segments configuration to JSON file in zone editor dialog
2026-04-13 11:43:22 -05:00
Adam Honse ed27303085 When updating existing profile without profile editor dialog, keep saved states for unavailable controllers, base color, and only update plugins already part of the existing profile 2026-04-13 11:43:22 -05:00
Adam Honse ee7e3e70e0 When saving sizes/manual configuration, keep any existing controllers that are not currently available 2026-04-13 11:43:22 -05:00
Adam Honse 2915d8151c Rework how manual configuration (previously sizes) are loaded to newly detected controllers, load active profile to newly detected controllers 2026-04-13 11:43:21 -05:00
Adam Honse 2b6355b4d0 Profile editor dialog 2026-04-13 11:43:21 -05:00
Adam Honse 2282351925 Rework API interface passed into plugins from ResourceManagerInterface to OpenRGBPluginAPIInterface 2026-04-13 11:43:21 -05:00
Adam Honse b7c8afca65 [next] Active profile tracking 2026-04-13 11:43:21 -05:00
Adam Honse e6d04d3c1e Apply profiles server-side rather than client-side, signal active profile update, forward loaded profile to local client for plugins 2026-04-13 11:43:21 -05:00
Adam Honse 97b7261bd1 Split HID and wrapped HID detector lists into specific detectors (with exact VID/PID matching) and generic detectors (with only IPU matching) and prioritize specific detectors when detecting HID devices 2026-04-13 11:43:21 -05:00
Adam Honse 3b0c85592e Move RGBController base destructor functionality into RGBController::Shutdown() so that update thread can be stopped before deleting the controller. Shutdown() must be called in every RGBController implementation before deleting the controller. Also some fixes to the NetworkServer to avoid deadlocking and disconnect issues 2026-04-13 11:43:21 -05:00
Adam Honse 5176f7ff7d Add detectors for filtering on IPU only (no VID/PID) 2026-04-13 11:43:21 -05:00
Adam Honse 11fca22a5b Drop support for old hidapi versions that don't support usage information 2026-04-13 11:43:21 -05:00
Adam Honse 0389531658 Add some validity checks to mode setters and getters in RGBController 2026-04-13 11:43:21 -05:00
Adam Honse 7aa5b61845 [next] SDK v6: Implement client and server flags to indicate capabilities and... 2026-04-13 11:43:21 -05:00
Adam Honse 61fe4fb19d SDK documentation updates 2026-04-13 11:43:21 -05:00
Adam Honse f75139f792 Expose LogManager in ResourceManager so that plugins can use it 2026-04-13 11:43:21 -05:00
Adam Honse 23cacbe117 Update NetworkClient to use log manager and use common name constant in server logs 2026-04-13 11:43:21 -05:00
Adam Honse c26e15fd7b Use std::string.assign when setting strings in the SDK protocol and description handlers so that string size limit is enforced, then strip out null terminators 2026-04-13 11:43:21 -05:00
Adam Honse e8495115b5 Add optional HID device hotplug support (requires https://gitlab.com/OpenRGBDevelopers/hidapi-hotplug) 2026-04-13 11:43:21 -05:00
Adam Honse e1b84ba874 SDK v6: Use unique IDs for identifying RGBControllers in SDK protocol 2026-04-13 11:43:21 -05:00
Adam Honse 31d02f64b2 Rework list handling in ResourceManager by having NetworkClient own its own list rather than sharing ResourceManager's list 2026-04-13 11:43:20 -05:00
Adam Honse e546dc63e8 Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions 2026-04-13 11:43:20 -05:00
Adam Honse 8374a650f6 Detection progress SDK integration, NetworkClient callback rework 2026-04-13 11:43:20 -05:00
Adam Honse 84d3656f4d Split out detection system from ResourceManager into DetectionManager
* Split detection system out into its own class, DetectionManager
    * Clean up ResourceManger's many callbacks into just two, one for detection and one general purpose
2026-04-13 11:43:20 -05:00
Adam Honse 1d963193ae SDK Version 6 Updates
* SDK Protocol
    * Server sends its name to client
    * ProfileManager
      * Rename existing profile commands
      * Add Upload Profile, Download Profile, and Get Active Profile commands
    * SettingsManager
      * Add Get, Set, and Save Settings commands
    * Add zone::active_mode, zone::mode fields for zone-specific modes
    * Add NET_PACKET_ID_RGBCONTROLLER_UPDATEZONEMODE packet for updating zone modes
    * Add segment::matrix_map to segment packet
    * Add NET_PACKET_ID_RGBCONTROLLER_SIGNALUPDATE packet for passing SignalUpdate signal from server to clients
  * NetworkServer
    * Formatting cleanup
    * Use per-controller threads for handling NetworkServer controller-specific packets to avoid delays from controller mutexes
  * NetworkClient
    * Formatting cleanup
  * RGBController
    * Clean up and modularize descriptor functions
2026-04-13 11:43:20 -05:00
Adam Honse 66921e1cd9 Rework Profiles to use JSON format
* Update OpenRGB Plugin Interface to include functions for loading/saving profile JSON data into OpenRGB profiles
    * Update ProfileManager to handle auto-load profiles (Exit, Open, Resume, Suspend) and move their settings to ProfileManager section
    * Update ProfileManager to store profiles in "profiles" folder in .json format
    * Update ProfileManager to store size profile in sizes.json
    * Update ProfileManager to perform device UpdateMode/UpdateColors when loading profile
    * Code cleanup of ProfileManager and profile-related code
2026-04-13 11:43:20 -05:00
Adam Honse add92d7f73 RGBController API Overhaul
* Reorganize and clean up RGBController API functions
    * Add functions to get protected RGBController member values
    * Make NetworkClient, ProfileManager, and ResourceManager friend classes so they can access protected members
    * Protected previously-public RGBController members
        * Information strings (name, vendor, description, version, serial location)
        * Device type
        * Active mode
        * Flags
        * LEDs vector
        * LED alternate names vector
        * Modes vector
        * Colors vector
        * Zones vector
    * Add CONTROLLER_FLAG_HIDDEN to allow plugins to hide controllers from control GUI
    * Add update reason codes to RGBController update callback and signal updates on more RGBController events
    * Add loop zone types and segmented zone type
    * Add matrix map field to segments
    * Rework matrix_map_type from using pointers to vector to prevent memory leaks
    * Rework KeyboardLayoutManager to return new matrix_map_type
    * Add access mutex to RGBController API
    * Add per-zone modes ot RGBController API
    * Add JSON description functions to RGBController API
2026-04-13 11:43:20 -05:00
Adam Honse e42e79538c Move plugin SDK integration from callback into plugin API and PluginManager 2026-04-13 11:43:20 -05:00
Adam Honse c87f343f8b Update Plugin API to 5 and SDK Protocol to 6 2026-04-13 11:43:19 -05:00
Adam Honse fc24044a48 Update default builds to Qt6
* Update Debian packages to use Qt6
  * Update Fedora packages to use Qt6
  * Update default AppImage builds to use Qt6
  * Update default Windows builds to use Qt6
  * Update default MacOS builds to use Qt6
2026-04-13 11:43:19 -05:00
331 changed files with 13992 additions and 45287 deletions
+16 -4
View File
@@ -536,7 +536,10 @@ before_script:
- macos
stage: build
script:
- ./scripts/build-macos.sh qt6 arm
- eval $(/opt/homebrew/bin/brew shellenv)
- qmake OpenRGB.pro
- make -j16
- macdeployqt OpenRGB.app -codesign=OpenRGB
artifacts:
name: "${CI_PROJECT_NAME}_MacOS_ARM64_${CI_COMMIT_SHORT_SHA}"
@@ -552,7 +555,10 @@ before_script:
- macos
stage: build
script:
- ./scripts/build-macos.sh qt5 arm
- eval $(/opt/homebrew/bin/brew shellenv)
- /opt/homebrew/opt/qt@5/bin/qmake OpenRGB.pro
- make -j16
- /opt/homebrew/opt/qt@5/bin/macdeployqt OpenRGB.app -codesign=OpenRGB
artifacts:
name: "${CI_PROJECT_NAME}_MacOS_Qt5_ARM64_${CI_COMMIT_SHORT_SHA}"
@@ -568,7 +574,10 @@ before_script:
- macos
stage: build
script:
- ./scripts/build-macos.sh qt6 intel
- eval $(/usr/local/bin/brew shellenv)
- arch -x86_64 /usr/local/bin/qmake OpenRGB.pro
- arch -x86_64 make -j16
- arch -x86_64 /usr/local/bin/macdeployqt OpenRGB.app -codesign=OpenRGB
artifacts:
name: "${CI_PROJECT_NAME}_MacOS_Intel_${CI_COMMIT_SHORT_SHA}"
@@ -584,7 +593,10 @@ before_script:
- macos
stage: build
script:
- ./scripts/build-macos.sh qt5 intel
- eval $(/usr/local/bin/brew shellenv)
- arch -x86_64 /usr/local/opt/qt@5/bin/qmake OpenRGB.pro
- arch -x86_64 make -j16
- arch -x86_64 /usr/local/opt/qt@5/bin/macdeployqt OpenRGB.app -codesign=OpenRGB
artifacts:
name: "${CI_PROJECT_NAME}_MacOS_Intel_Qt5_${CI_COMMIT_SHORT_SHA}"
-4
View File
@@ -69,7 +69,3 @@ OpenRGB is written in C++, uses the Qt framework for UI, and uses the QMake buil
Translation files are located in [`OpenRGB/qt/i18n/`](https://gitlab.com/CalcProgrammer1/OpenRGB/-/tree/master/qt/i18n), where languages are formatted using ISO 639-1 format: `OpenRGB_xx_XX.ts` — `xx_XX` representing the language code.
In order to translate a file, you need to [fork](https://gitlab.com/CalcProgrammer1/OpenRGB/-/forks/new) the project, create a new file for your language with `lupdate` (or edit an exisiting one), edit the file with `qtlinguist`, commit, push, and create a merge request.
## AI Guidelines
OpenRGB is an open source project developed by humans for humans. As a general rule, AI generated submissions are not permitted. The licensing behind AI generated code is problematic. If you choose to use AI for assistance in your development process, we can't stop you, but do not credit the AI in commits (no AI authorship/co-authorship). Ultimately, you as a human developer are responsible for the code you submit and it is expected that any code you submit you fully understand and have manually vetted before submission. Merge requests that appear to be straight from an AI output, commits with AI tool authorship or co-authorship tags, or otherwise AI generated submissions are subject to closure.
@@ -205,6 +205,7 @@ void RGBController_BloodyB820R::SetupZones()
{
led new_led;
new_led.name = led_names[led_index];
new_led.value = led_index;
leds.push_back(new_led);
}
@@ -67,13 +67,13 @@ void BloodyMouseController::InitDevice()
hid_send_feature_report(dev, buffer, BLOODYMOUSE_WRITE_PACKET_SIZE);
}
void BloodyMouseController::SetLedsDirect(std::vector<RGBColor> colors, std::vector<uint8_t> offsets)
void BloodyMouseController::SetLedsDirect(std::vector<RGBColor> colors)
{
uint8_t buffer[BLOODYMOUSE_WRITE_PACKET_SIZE] = { 0x07, 0x03, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00 };
for(uint8_t i = 0; i < colors.size(); i++)
{
uint8_t offset = 3 * (offsets[i]) + BLOODYMOUSE_DATA_BYTE;
uint8_t offset = 3 * (colors[i] >> 24) + BLOODYMOUSE_DATA_BYTE;
buffer[offset] = RGBGetRValue(colors[i]);
buffer[offset + 1] = RGBGetGValue(colors[i]);
@@ -58,7 +58,7 @@ public:
std::string GetLocation();
std::string GetName();
void SetLedsDirect(std::vector<RGBColor> colors, std::vector<uint8_t> offsets);
void SetLedsDirect(std::vector<RGBColor> colors);
private:
uint16_t pid;
@@ -142,7 +142,7 @@ void RGBController_BloodyMouse::SetupZones()
{
led new_led;
offsets.push_back(mz.zone_leds[lp_idx]);
new_led.value = mz.zone_leds[lp_idx];
if(bool_single)
{
@@ -163,7 +163,14 @@ void RGBController_BloodyMouse::SetupZones()
void RGBController_BloodyMouse::DeviceUpdateLEDs()
{
controller->SetLedsDirect(colors, offsets);
std::vector<RGBColor> colour;
for(size_t i = 0; i < colors.size(); i++)
{
RGBColor c = colors[i] | (leds[i].value << 24);
colour.push_back(c);
}
controller->SetLedsDirect(colour);
}
void RGBController_BloodyMouse::DeviceUpdateZoneLEDs(int /*zone*/)
@@ -39,5 +39,4 @@ public:
private:
BloodyMouseController* controller;
std::vector<uint8_t> offsets;
};
@@ -186,7 +186,7 @@ void AMBXController::SetLEDColor(unsigned int led, RGBColor color)
std::this_thread::sleep_for(std::chrono::milliseconds(2));
}
void AMBXController::SetLEDColors(const unsigned int* leds, RGBColor* colors, unsigned int count)
void AMBXController::SetLEDColors(unsigned int* leds, RGBColor* colors, unsigned int count)
{
for(unsigned int i = 0; i < count; i++)
{
+1 -1
View File
@@ -44,7 +44,7 @@ public:
bool IsInitialized();
void SetLEDColor(unsigned int led, RGBColor color);
void SetLEDColors(const unsigned int* leds, RGBColor* colors, unsigned int count);
void SetLEDColors(unsigned int* leds, RGBColor* colors, unsigned int count);
private:
libusb_context* usb_context;
@@ -9,15 +9,6 @@
#include "RGBController_AMBX.h"
static const unsigned int led_values[] =
{
AMBX_LIGHT_LEFT,
AMBX_LIGHT_RIGHT,
AMBX_LIGHT_WALL_LEFT,
AMBX_LIGHT_WALL_CENTER,
AMBX_LIGHT_WALL_RIGHT
};
/**------------------------------------------------------------------*\
@name Philips amBX
@category Accessory
@@ -80,22 +71,27 @@ void RGBController_AMBX::SetupZones()
// Set up LEDs
led left_light;
left_light.name = "Left";
left_light.value = AMBX_LIGHT_LEFT;
leds.push_back(left_light);
led right_light;
right_light.name = "Right";
right_light.value = AMBX_LIGHT_RIGHT;
leds.push_back(right_light);
led wall_left;
wall_left.name = "Wall Left";
wall_left.value = AMBX_LIGHT_WALL_LEFT;
leds.push_back(wall_left);
led wall_center;
wall_center.name = "Wall Center";
wall_center.value = AMBX_LIGHT_WALL_CENTER;
leds.push_back(wall_center);
led wall_right;
wall_right.name = "Wall Right";
wall_right.value = AMBX_LIGHT_WALL_RIGHT;
leds.push_back(wall_right);
SetupColors();
@@ -108,7 +104,16 @@ void RGBController_AMBX::DeviceUpdateLEDs()
return;
}
controller->SetLEDColors(led_values, colors.data(), static_cast<unsigned int>(colors.size()));
unsigned int led_values[5];
RGBColor led_colors[5];
for(unsigned int led_idx = 0; led_idx < leds.size(); led_idx++)
{
led_values[led_idx] = leds[led_idx].value;
led_colors[led_idx] = colors[led_idx];
}
controller->SetLEDColors(led_values, led_colors, static_cast<unsigned int>(leds.size()));
}
void RGBController_AMBX::DeviceUpdateZoneLEDs(int zone)
@@ -133,17 +138,17 @@ void RGBController_AMBX::DeviceUpdateZoneLEDs(int zone)
start_idx += zones[z_idx].leds_count;
}
unsigned int tmp_values[5];
RGBColor tmp_colors[5];
unsigned int led_values[5];
RGBColor led_colors[5];
for(unsigned int led_idx = 0; led_idx < zone_size; led_idx++)
{
unsigned int current_idx = start_idx + led_idx;
tmp_values[led_idx] = led_values[current_idx];
tmp_colors[led_idx] = colors[current_idx];
led_values[led_idx] = leds[current_idx].value;
led_colors[led_idx] = colors[current_idx];
}
controller->SetLEDColors(tmp_values, tmp_colors, zone_size);
controller->SetLEDColors(led_values, led_colors, zone_size);
}
void RGBController_AMBX::DeviceUpdateSingleLED(int led)
@@ -153,7 +158,7 @@ void RGBController_AMBX::DeviceUpdateSingleLED(int led)
return;
}
unsigned int led_value = led_values[led];
unsigned int led_value = leds[led].value;
RGBColor color = colors[led];
controller->SetLEDColor(led_value, color);
}
@@ -11,33 +11,6 @@
#include "RGBController_AMDWraithPrism.h"
/*---------------------------------------------------------*\
| LED maps |
\*---------------------------------------------------------*/
const unsigned char led_values[] =
{
// Logo
0x00,
// Fan
0x01,
// Ring
0x08,
0x07,
0x06,
0x05,
0x04,
0x03,
0x02,
0x10,
0x0F,
0x0E,
0x0D,
0x0C,
0x0B,
0x0A,
0x09
};
/**------------------------------------------------------------------*\
@name AMD Wraith Prism
@category Cooler
@@ -166,6 +139,14 @@ RGBController_AMDWraithPrism::~RGBController_AMDWraithPrism()
void RGBController_AMDWraithPrism::SetupZones()
{
/*-----------------------------------------------------*\
| LED maps |
\*-----------------------------------------------------*/
const unsigned int logo_leds[1] = { 0x00 };
const unsigned int fan_leds[1] = { 0x01 };
const unsigned int ring_leds[15] = { 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x10,
0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09 };
/*-----------------------------------------------------*\
| Set up zones |
\*-----------------------------------------------------*/
@@ -200,6 +181,7 @@ void RGBController_AMDWraithPrism::SetupZones()
{
led logo_led;
logo_led.name = "Logo LED";
logo_led.value = logo_leds[led_idx];
leds.push_back(logo_led);
}
@@ -207,6 +189,7 @@ void RGBController_AMDWraithPrism::SetupZones()
{
led fan_led;
fan_led.name = "Fan LED";
fan_led.value = fan_leds[led_idx];
leds.push_back(fan_led);
}
@@ -214,6 +197,7 @@ void RGBController_AMDWraithPrism::SetupZones()
{
led ring_led;
ring_led.name = "Ring LED";
ring_led.value = ring_leds[led_idx];
leds.push_back(ring_led);
}
@@ -234,7 +218,7 @@ void RGBController_AMDWraithPrism::DeviceUpdateLEDs()
leds_count = 0;
for(std::size_t led_idx = 0; led_idx < 2; led_idx++)
{
led_ids[leds_count] = led_values[led_idx];
led_ids[leds_count] = (unsigned char)leds[led_idx].value;
color_buf[leds_count] = colors[led_idx];
leds_count++;
@@ -247,7 +231,7 @@ void RGBController_AMDWraithPrism::DeviceUpdateLEDs()
leds_count = 0;
for(std::size_t led_idx = 0; led_idx < ( colors.size() - 2 ); led_idx++)
{
led_ids[leds_count] = led_values[led_idx + 2];
led_ids[leds_count] = (unsigned char)leds[led_idx + 2].value;
color_buf[leds_count] = colors[led_idx + 2];
leds_count++;
@@ -31,7 +31,7 @@ AOCKeyboardController::~AOCKeyboardController()
std::string AOCKeyboardController::GetDeviceLocation()
{
return("HID: " + location);
return("HID " + location);
}
std::string AOCKeyboardController::GetDeviceName()
@@ -286,7 +286,7 @@ void RGBController_AOCKeyboard::SetupZones()
led new_led;
new_led.name = new_kb.GetKeyNameAt(led_idx);
led_values.push_back(new_kb.GetKeyValueAt(led_idx));
new_led.value = new_kb.GetKeyValueAt(led_idx);
leds.push_back(new_led);
}
@@ -303,7 +303,7 @@ void RGBController_AOCKeyboard::DeviceUpdateLEDs()
for(unsigned int led_idx = 0; led_idx < leds.size(); led_idx++)
{
color_buf[led_values[led_idx]] = colors[led_idx];
color_buf[leds[led_idx].value] = colors[led_idx];
}
controller->SetCustom(&color_buf[0]);
@@ -29,6 +29,5 @@ public:
void DeviceUpdateMode();
private:
AOCKeyboardController* controller;
std::vector<unsigned int> led_values;
AOCKeyboardController* controller;
};
@@ -27,7 +27,7 @@ AOCMouseController::~AOCMouseController()
std::string AOCMouseController::GetDeviceLocation()
{
return("HID: " + location);
return("HID " + location);
}
std::string AOCMouseController::GetDeviceName()
@@ -27,7 +27,7 @@ AOCMousematController::~AOCMousematController()
std::string AOCMousematController::GetDeviceLocation()
{
return("HID: " + location);
return("HID " + location);
}
std::string AOCMousematController::GetDeviceName()
@@ -269,9 +269,9 @@ void RGBController_PolychromeUSB::SetupZones()
new_led.name = zones[channel_idx].name;
new_led.name.append(", LED ");
new_led.name.append(std::to_string(led_ch_idx + 1));
new_led.value = channel_idx;
leds.push_back(new_led);
led_values.push_back(channel_idx);
}
}
@@ -296,7 +296,7 @@ void RGBController_PolychromeUSB::SetupZones()
\*---------------------------------------------------------*/
for(std::size_t led_idx = 0; led_idx < leds.size(); led_idx++)
{
unsigned char led = (unsigned char)led_values[led_idx];
unsigned char led = (unsigned char)leds[led_idx].value;
colors[led_idx] = zones_info[led].color;
}
@@ -359,7 +359,7 @@ void RGBController_PolychromeUSB::DeviceUpdateZoneLEDs(int zone)
void RGBController_PolychromeUSB::DeviceUpdateSingleLED(int led)
{
unsigned int channel = led_values[led];
unsigned int channel = leds[led].value;
unsigned char set_mode = zones_info[channel].mode;
if(set_mode > modes.size())
@@ -33,7 +33,6 @@ public:
private:
PolychromeUSBController* controller;
std::vector<unsigned int> led_values;
std::vector<PolychromeZoneInfo> zones_info;
unsigned char GetDeviceMode(unsigned char zone);
@@ -36,7 +36,7 @@ ASRockASRRGBSMBusController::~ASRockASRRGBSMBusController()
std::string ASRockASRRGBSMBusController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -158,11 +158,6 @@ void RGBController_ASRockASRRGBSMBus::SetupZones()
\*---------------------------------------------------------*/
leds.push_back(*new_led);
/*---------------------------------------------------------*\
| Initialize led_values vector |
\*---------------------------------------------------------*/
led_values.push_back(0);
SetupColors();
}
@@ -189,9 +184,9 @@ void RGBController_ASRockASRRGBSMBus::DeviceUpdateSingleLED(int led)
| If the LED value is non-zero, this LED overrides the LED |
| index |
\*---------------------------------------------------------*/
if(led_values[led] != 0)
if(leds[led].value != 0)
{
led = led_values[led];
led = leds[led].value;
}
controller->SetColorsAndSpeed(led, red, grn, blu);
@@ -30,5 +30,4 @@ public:
private:
ASRockASRRGBSMBusController* controller;
std::vector<unsigned int> led_values;
};
@@ -36,7 +36,7 @@ ASRockPolychromeV1SMBusController::~ASRockPolychromeV1SMBusController()
std::string ASRockPolychromeV1SMBusController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -285,13 +285,13 @@ void RGBController_ASRockPolychromeV1SMBus::SetupZones()
led* new_led = new led();
new_led->name = polychrome_v1_zone_names[zone_idx];
new_led->value = zone_idx;
/*---------------------------------------------------------*\
| Push new LED to LEDs vector |
\*---------------------------------------------------------*/
leds.push_back(*new_led);
zoneIndexMap.push_back(zone_idx);
led_values.push_back(zone_idx);
}
}
@@ -32,9 +32,7 @@ public:
void DeviceUpdateMode();
private:
ASRockPolychromeV1SMBusController* controller;
std::vector<unsigned int> led_values;
std::vector<uint8_t> zoneIndexMap;
uint8_t getModeIndex(uint8_t mode_value);
ASRockPolychromeV1SMBusController* controller;
uint8_t getModeIndex(uint8_t mode_value);
std::vector<uint8_t> zoneIndexMap;
};
@@ -37,7 +37,7 @@ ASRockPolychromeV2SMBusController::~ASRockPolychromeV2SMBusController()
std::string ASRockPolychromeV2SMBusController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -256,14 +256,11 @@ void RGBController_ASRockPolychromeV2SMBus::SetupZones()
new_led->name = polychrome_v2_zone_names[zone_idx];
new_led->name.append(" " + std::to_string(led_idx + 1));
new_led->value = 0;
if(zone_idx == POLYCHROME_V2_ZONE_ADDRESSABLE)
{
led_values.push_back(0x19);
}
else
{
led_values.push_back(0);
new_led->value = 0x19;
}
/*---------------------------------------------------------*\
@@ -314,9 +311,9 @@ void RGBController_ASRockPolychromeV2SMBus::DeviceUpdateSingleLED(int led)
| If the LED value is non-zero, this LED overrides the LED |
| index |
\*---------------------------------------------------------*/
if(led_values[led] != 0)
if(leds[led].value != 0)
{
led = led_values[led];
led = leds[led].value;
}
controller->SetColorsAndSpeed(led, red, grn, blu);
@@ -32,6 +32,5 @@ public:
void DeviceUpdateMode();
private:
ASRockPolychromeV2SMBusController* controller;
std::vector<unsigned int> led_values;
ASRockPolychromeV2SMBusController* controller;
};
@@ -91,9 +91,9 @@ DetectedControllers DetectASRockSMBusControllers(std::vector<i2c_smbus_interface
for(unsigned int bus = 0; bus < buses.size(); bus++)
{
IF_MOBO_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
IF_MOBO_SMBUS(buses[bus]->pci_vendor, buses[bus]->pci_device)
{
if(buses[bus]->info.pci_subsystem_vendor == ASROCK_SUB_VEN)
if(buses[bus]->pci_subsystem_vendor == ASROCK_SUB_VEN)
{
LOG_DEBUG(SMBUS_CHECK_DEVICE_MESSAGE_EN, ASROCK_DETECTOR_NAME, bus, VENDOR_NAME, SMBUS_ADDRESS);
// Check for Polychrome controller at 0x6A
@@ -313,7 +313,7 @@ void RGBController_AlienwareAW410K::SetupZones()
{
led new_led;
new_led.name = led_names[led_idx].name;
led_values.push_back(led_names[led_idx].idx);
new_led.value = led_names[led_idx].idx;
leds.push_back(new_led);
}
@@ -329,14 +329,14 @@ void RGBController_AlienwareAW410K::DeviceUpdateLEDs()
for(std::size_t led_idx = 0; led_idx < leds.size(); led_idx++)
{
SelectedButtons key;
SelectedButtons key;
key.idx = led_values[led_idx];
key.red = RGBGetRValue(colors[led_idx]);
key.green = RGBGetGValue(colors[led_idx]);
key.blue = RGBGetBValue(colors[led_idx]);
key.idx = (unsigned char)leds[led_idx].value;
key.red = RGBGetRValue(colors[led_idx]);
key.green = RGBGetGValue(colors[led_idx]);
key.blue = RGBGetBValue(colors[led_idx]);
frame_buf_keys.push_back(key);
frame_buf_keys.push_back(key);
}
controller->SendInitialize();
@@ -358,7 +358,7 @@ void RGBController_AlienwareAW410K::DeviceUpdateZoneLEDs(int zone)
void RGBController_AlienwareAW410K::DeviceUpdateSingleLED(int led)
{
controller->DeviceUpdateSingleLED(led_values[led], RGBGetRValue(colors[led]), RGBGetGValue(colors[led]), RGBGetBValue(colors[led]));
controller->DeviceUpdateSingleLED(leds[led].value, RGBGetRValue(colors[led]), RGBGetGValue(colors[led]), RGBGetBValue(colors[led]));
}
void RGBController_AlienwareAW410K::DeviceUpdateMode()
@@ -32,5 +32,4 @@ public:
private:
AlienwareAW410KController* controller;
std::vector<RGBColor> current_colors;
std::vector<unsigned char> led_values;
};
@@ -312,7 +312,7 @@ void RGBController_AlienwareAW510K::SetupZones()
{
led new_led;
new_led.name = led_names[led_idx].name;
led_values.push_back(led_names[led_idx].idx);
new_led.value = led_names[led_idx].idx;
leds.push_back(new_led);
}
@@ -328,7 +328,7 @@ void RGBController_AlienwareAW510K::DeviceUpdateLEDs()
for(std::size_t led_idx = 0; led_idx < leds.size(); led_idx++)
{
if(current_colors[led_idx] == new_colors[led_idx])
if (current_colors[led_idx]==new_colors[led_idx])
{
/*-------------------------------------------------*\
| Don't send if key color is not changed |
@@ -336,14 +336,28 @@ void RGBController_AlienwareAW510K::DeviceUpdateLEDs()
continue;
}
SelectedKeys key;
if(RGBGetRValue(colors[led_idx]) != 0x00 || RGBGetBValue(colors[led_idx]) != 0x00 || RGBGetBValue(colors[led_idx]) != 0x00)
{
SelectedKeys key;
key.idx = led_values[led_idx];
key.red = RGBGetRValue(colors[led_idx]);
key.green = RGBGetGValue(colors[led_idx]);
key.blue = RGBGetBValue(colors[led_idx]);
key.idx = (unsigned char)leds[led_idx].value;
key.red = RGBGetRValue(colors[led_idx]);
key.green = RGBGetGValue(colors[led_idx]);
key.blue = RGBGetBValue(colors[led_idx]);
frame_buf_keys.push_back(key);
frame_buf_keys.push_back(key);
}
else
{
SelectedKeys key;
key.idx = (unsigned char)leds[led_idx].value;
key.red = RGBGetRValue(colors[led_idx]);
key.green = RGBGetGValue(colors[led_idx]);
key.blue = RGBGetBValue(colors[led_idx]);
frame_buf_keys.push_back(key);
}
}
controller->SendInitialize();
@@ -365,7 +379,7 @@ void RGBController_AlienwareAW510K::DeviceUpdateZoneLEDs(int zone)
void RGBController_AlienwareAW510K::DeviceUpdateSingleLED(int led)
{
controller->DeviceUpdateSingleLED(led_values[led], RGBGetRValue(colors[led]), RGBGetGValue(colors[led]), RGBGetBValue(colors[led]));
controller->DeviceUpdateSingleLED(leds[led].value, RGBGetRValue(colors[led]), RGBGetGValue(colors[led]), RGBGetBValue(colors[led]));
}
void RGBController_AlienwareAW510K::DeviceUpdateMode()
@@ -31,5 +31,4 @@ public:
private:
AlienwareAW510KController* controller;
std::vector<RGBColor> current_colors;
std::vector<unsigned char> led_values;
};
@@ -11,13 +11,6 @@
#include "RGBController_AlienwareAW3423DWF.h"
static const unsigned char led_values[] =
{
0x01,
0x02,
0x08
};
/**------------------------------------------------------------------*\
@name AW3423DWF
@category Accessory
@@ -70,6 +63,7 @@ void RGBController_AlienwareAW3423DWF::SetupZones()
led Logo_LED;
Logo_LED.name = "Logo";
Logo_LED.value = 0x01;
leds.push_back(Logo_LED);
zone Number;
@@ -82,6 +76,7 @@ void RGBController_AlienwareAW3423DWF::SetupZones()
led Number_LED;
Number_LED.name = "Number";
Number_LED.value = 0x02;
leds.push_back(Number_LED);
zone PowerButton;
@@ -94,6 +89,7 @@ void RGBController_AlienwareAW3423DWF::SetupZones()
led PowerButton_LED;
PowerButton_LED.name = "Power Button";
PowerButton_LED.value = 0x08;
leds.push_back(PowerButton_LED);
SetupColors();
@@ -132,7 +128,7 @@ void RGBController_AlienwareAW3423DWF::DeviceUpdateSingleLED(int led)
unsigned char red = RGBGetRValue(colors[led]);
unsigned char grn = RGBGetGValue(colors[led]);
unsigned char blu = RGBGetBValue(colors[led]);
controller->SendColor(led_values[led], red, grn, blu);
controller->SendColor(leds[led].value, red, grn, blu);
}
void RGBController_AlienwareAW3423DWF::DeviceUpdateMode()
@@ -11,13 +11,6 @@
#include "RGBController_AlienwareMonitor.h"
static const unsigned char led_values[] =
{
0x01,
0x02,
0x08
};
/**------------------------------------------------------------------*\
@name Alienware Monitor
@category Accessory
@@ -70,6 +63,7 @@ void RGBController_AlienwareMonitor::SetupZones()
led Logo_LED;
Logo_LED.name = "Logo";
Logo_LED.value = 0x01;
leds.push_back(Logo_LED);
zone Number;
@@ -82,6 +76,7 @@ void RGBController_AlienwareMonitor::SetupZones()
led Number_LED;
Number_LED.name = "Number";
Number_LED.value = 0x02;
leds.push_back(Number_LED);
zone PowerButton;
@@ -94,6 +89,7 @@ void RGBController_AlienwareMonitor::SetupZones()
led PowerButton_LED;
PowerButton_LED.name = "Power Button";
PowerButton_LED.value = 0x08;
leds.push_back(PowerButton_LED);
SetupColors();
@@ -132,7 +128,7 @@ void RGBController_AlienwareMonitor::DeviceUpdateSingleLED(int led)
unsigned char red = RGBGetRValue(colors[led]);
unsigned char grn = RGBGetGValue(colors[led]);
unsigned char blu = RGBGetBValue(colors[led]);
controller->SendColor(led_values[led], red, grn, blu);
controller->SendColor(leds[led].value, red, grn, blu);
}
void RGBController_AlienwareMonitor::DeviceUpdateMode()
@@ -38,69 +38,76 @@ static const unsigned int zone_sizes[] =
LED_COUNT,
};
static const char* led_names[] =
typedef struct
{
KEY_EN_ESCAPE,
KEY_EN_1,
KEY_EN_2,
KEY_EN_3,
KEY_EN_4,
KEY_EN_5,
KEY_EN_6,
KEY_EN_7,
KEY_EN_8,
KEY_EN_9,
KEY_EN_0,
KEY_EN_MINUS,
KEY_EN_EQUALS,
KEY_EN_BACKSPACE,
KEY_EN_TAB,
KEY_EN_Q,
KEY_EN_W,
KEY_EN_E,
KEY_EN_R,
KEY_EN_T,
KEY_EN_Y,
KEY_EN_U,
KEY_EN_I,
KEY_EN_O,
KEY_EN_P,
KEY_EN_LEFT_BRACKET,
KEY_EN_RIGHT_BRACKET,
KEY_EN_ANSI_BACK_SLASH,
KEY_EN_CAPS_LOCK,
KEY_EN_A,
KEY_EN_S,
KEY_EN_D,
KEY_EN_F,
KEY_EN_G,
KEY_EN_H,
KEY_EN_J,
KEY_EN_K,
KEY_EN_L,
KEY_EN_SEMICOLON,
KEY_EN_QUOTE,
KEY_EN_ANSI_ENTER,
KEY_EN_LEFT_SHIFT,
KEY_EN_Z,
KEY_EN_X,
KEY_EN_C,
KEY_EN_V,
KEY_EN_B,
KEY_EN_N,
KEY_EN_M,
KEY_EN_COMMA,
KEY_EN_PERIOD,
KEY_EN_FORWARD_SLASH,
KEY_EN_RIGHT_SHIFT,
KEY_EN_LEFT_CONTROL,
KEY_EN_LEFT_WINDOWS,
KEY_EN_LEFT_ALT,
KEY_EN_SPACE,
KEY_EN_RIGHT_ALT,
KEY_EN_RIGHT_FUNCTION,
KEY_EN_MENU,
KEY_EN_RIGHT_CONTROL,
const char * name;
const unsigned char idx;
} annepro2_led_type;
static const annepro2_led_type led_names[] =
{
/* Key Label Index */
{ KEY_EN_ESCAPE, 0 },
{ KEY_EN_1, 1 },
{ KEY_EN_2, 2 },
{ KEY_EN_3, 3 },
{ KEY_EN_4, 4 },
{ KEY_EN_5, 5 },
{ KEY_EN_6, 6 },
{ KEY_EN_7, 7 },
{ KEY_EN_8, 8 },
{ KEY_EN_9, 9 },
{ KEY_EN_0, 10 },
{ KEY_EN_MINUS, 11 },
{ KEY_EN_EQUALS, 12 },
{ KEY_EN_BACKSPACE, 13 },
{ KEY_EN_TAB, 14 },
{ KEY_EN_Q, 15 },
{ KEY_EN_W, 16 },
{ KEY_EN_E, 17 },
{ KEY_EN_R, 18 },
{ KEY_EN_T, 19 },
{ KEY_EN_Y, 20 },
{ KEY_EN_U, 21 },
{ KEY_EN_I, 22 },
{ KEY_EN_O, 23 },
{ KEY_EN_P, 24 },
{ KEY_EN_LEFT_BRACKET, 25 },
{ KEY_EN_RIGHT_BRACKET, 26 },
{ KEY_EN_ANSI_BACK_SLASH, 27 },
{ KEY_EN_CAPS_LOCK, 28 },
{ KEY_EN_A, 29 },
{ KEY_EN_S, 30 },
{ KEY_EN_D, 31 },
{ KEY_EN_F, 32 },
{ KEY_EN_G, 33 },
{ KEY_EN_H, 34 },
{ KEY_EN_J, 35 },
{ KEY_EN_K, 36 },
{ KEY_EN_L, 37 },
{ KEY_EN_SEMICOLON, 38 },
{ KEY_EN_QUOTE, 39 },
{ KEY_EN_ANSI_ENTER, 40 },
{ KEY_EN_LEFT_SHIFT, 41 },
{ KEY_EN_Z, 42 },
{ KEY_EN_X, 43 },
{ KEY_EN_C, 44 },
{ KEY_EN_V, 45 },
{ KEY_EN_B, 46 },
{ KEY_EN_N, 47 },
{ KEY_EN_M, 48 },
{ KEY_EN_COMMA, 49 },
{ KEY_EN_PERIOD, 50 },
{ KEY_EN_FORWARD_SLASH, 51 },
{ KEY_EN_RIGHT_SHIFT, 52 },
{ KEY_EN_LEFT_CONTROL, 53 },
{ KEY_EN_LEFT_WINDOWS, 54 },
{ KEY_EN_LEFT_ALT, 55 },
{ KEY_EN_SPACE, 56 },
{ KEY_EN_RIGHT_ALT, 57 },
{ KEY_EN_RIGHT_FUNCTION, 58 },
{ KEY_EN_MENU, 59 },
{ KEY_EN_RIGHT_CONTROL, 60 },
};
/**------------------------------------------------------------------*\
@@ -170,7 +177,8 @@ void RGBController_AnnePro2::SetupZones()
for(unsigned int led_idx = 0; led_idx < total_led_count; led_idx++)
{
led new_led;
new_led.name = led_names[led_idx];
new_led.name = led_names[led_idx].name;
new_led.value = led_names[led_idx].idx;
leds.push_back(new_led);
}
@@ -186,7 +194,7 @@ void RGBController_AnnePro2::DeviceUpdateLEDs()
| TODO: Send packets with multiple LED frames |
\*---------------------------------------------------------*/
std::size_t led_real_idx = 0;
for(std::size_t led_idx = 0; led_idx < colors.size(); led_idx++)
for(std::size_t led_idx = 0; led_idx < leds.size(); led_idx++)
{
frame_buf[(led_real_idx * 3) + 0] = RGBGetRValue(colors[led_idx]);
frame_buf[(led_real_idx * 3) + 1] = RGBGetGValue(colors[led_idx]);
@@ -75,6 +75,7 @@ void RGBController_Arctic::SetupZones()
led Led;
Led.name = LedZone.name + " LED";
Led.value = channel;
zones.push_back(LedZone);
leds.push_back(Led);
@@ -351,14 +351,11 @@ void RGBController_AsusAuraCoreLaptop::SetupZones()
new_zone.leds_count = new_kb.GetKeyCount();
for(unsigned int led_idx = 0; led_idx < new_zone.leds_count; led_idx++)
{
led new_led;
unsigned int new_led_value;
led new_led;
new_led.name = new_kb.GetKeyNameAt(led_idx);
new_led_value = new_kb.GetKeyValueAt(led_idx);
max_led_value = std::max(max_led_value, new_led_value);
led_values.push_back(new_led_value);
new_led.value = new_kb.GetKeyValueAt(led_idx);
max_led_value = std::max(max_led_value, new_led.value);
leds.push_back(new_led);
}
}
@@ -388,12 +385,24 @@ void RGBController_AsusAuraCoreLaptop::SetupZones()
for(size_t led_idx = 0; led_idx < leds.size(); led_idx++)
{
buffer_map[led_values[led_idx]] = &colors[led_idx];
buffer_map[leds[led_idx].value] = &colors[led_idx];
}
}
void RGBController_AsusAuraCoreLaptop::DeviceUpdateLEDs()
{
for(size_t i = 85; i < leds.size(); i++)
{
LOG_DEBUG("[%s] Setting %s @ LED index %d and buffer index %d to R: %02X G: %02X B: %02X",
name.c_str(),
leds[i].name.c_str(),
i,
leds[i].value,
RGBGetRValue(colors[i]),
RGBGetGValue(colors[i]),
RGBGetBValue(colors[i]));
}
controller->SetLedsDirect(buffer_map);
}
@@ -33,7 +33,6 @@ public:
private:
RGBColor null_color = 0;
std::vector<RGBColor *> buffer_map;
std::vector<unsigned int> led_values;
AsusAuraCoreLaptopController* controller;
};
@@ -32,7 +32,7 @@ std::string AuraGPUController::GetDeviceName()
std::string AuraGPUController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -79,7 +79,7 @@ void AuraGPUController::AuraGPURegisterWrite(unsigned char reg, unsigned char va
bool AuraGPUController::SaveOnlyApplies()
{
switch (bus->info.pci_subsystem_device)
switch (bus->pci_subsystem_device)
{
case ASUS_VEGA64_STRIX:
return false;
@@ -21,7 +21,7 @@
bool TestForAsusAuraGPUController(i2c_smbus_interface* bus, unsigned char address)
{
if(bus->info.pci_vendor == AMD_GPU_VEN && !is_amd_gpu_i2c_bus(bus))
if(bus->pci_vendor == AMD_GPU_VEN && !is_amd_gpu_i2c_bus(bus))
{
return false;
}
@@ -471,8 +471,8 @@ void RGBController_AuraKeyboard::SetupZones()
{
led new_led;
new_led.name = led_names[led_idx].name;
new_led.value = led_names[led_idx].idx;
led_values.push_back(led_names[led_idx].idx);
leds.push_back(new_led);
}
@@ -493,7 +493,7 @@ void RGBController_AuraKeyboard::DeviceUpdateLEDs()
\*---------------------------------------------------------*/
for(std::size_t led_idx = 0; led_idx < leds.size(); led_idx++)
{
frame_buf[(led_idx * 4) + 0] = led_values[led_idx];
frame_buf[(led_idx * 4) + 0] = leds[led_idx].value;
frame_buf[(led_idx * 4) + 1] = RGBGetRValue(colors[led_idx]);
frame_buf[(led_idx * 4) + 2] = RGBGetGValue(colors[led_idx]);
frame_buf[(led_idx * 4) + 3] = RGBGetBValue(colors[led_idx]);
@@ -54,5 +54,4 @@ public:
private:
AuraKeyboardController* controller;
AuraKeyboardMappingLayoutType layout;
std::vector<unsigned char> led_values;
};
@@ -22,7 +22,6 @@
#define AURA_ROG_GLADIUS_II_WIRELESS_1_PID 0x189E
#define AURA_ROG_GLADIUS_II_WIRELESS_2_PID 0x18A0
#define AURA_ROG_GLADIUS_III_PID 0x197B
#define AURA_ROG_GLADIUS_III_CORE_PID 0x1C8D
#define AURA_ROG_GLADIUS_III_WIRELESS_USB_PID 0x197D
#define AURA_ROG_GLADIUS_III_WIRELESS_2_4_PID 0x197F
#define AURA_ROG_GLADIUS_III_WIRELESS_BT_PID 0x1981
@@ -218,20 +217,6 @@ static std::map<int,mouse_type> aura_mouse_devices =
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_WAVE, AURA_MOUSE_MODE_REACTIVE, AURA_MOUSE_MODE_COMET, AURA_MOUSE_MODE_BATTERY }
}
},
{
AURA_ROG_GLADIUS_III_CORE_PID, // ROG Gladius III Core
{
0,
0,
0,
100,
false,
1,
false,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_NONE, AURA_MOUSE_MODE_REACTIVE }
}
},
{
AURA_ROG_GLADIUS_III_WIRELESS_USB_PID, // ROG Gladius III Wireless USB
{
@@ -207,8 +207,8 @@ void RGBController_AuraMouse::SetupZones()
led mouse_led;
mouse_led.name = mouse_zone.name + " LED";
mouse_led.value = *zone_it;
led_values.push_back(*zone_it);
leds.push_back(mouse_led);
}
@@ -247,7 +247,7 @@ void RGBController_AuraMouse::DeviceUpdateSingleLED(int led)
uint8_t grn = RGBGetGValue(colors[led]);
uint8_t blu = RGBGetBValue(colors[led]);
controller->SendUpdate(led_values[led], modes[active_mode].value, red, grn, blu, 0, false, 0, modes[active_mode].brightness);
controller->SendUpdate(leds[led].value, modes[active_mode].value, red, grn, blu, 0, false, 0, modes[active_mode].brightness);
}
void RGBController_AuraMouse::DeviceUpdateMode()
@@ -31,6 +31,5 @@ public:
private:
AuraMouseController* controller;
std::vector<uint8_t> led_values;
uint16_t pid;
};
@@ -141,6 +141,7 @@ void RGBController_AsusROGSpatha::SetupZones()
led spatha_led;
spatha_led.name = zones_names[i];
spatha_led.value = 1;
leds.push_back(spatha_led);
}
@@ -99,6 +99,7 @@ void RGBController_AsusROGStrixEvolve::SetupZones()
led mouse_led;
mouse_led.name = "Underglow";
mouse_led.value = 1;
leds.push_back(mouse_led);
@@ -19,10 +19,7 @@ AsusAuraRyuoAIOController::AsusAuraRyuoAIOController(hid_device* dev_handle, con
| Manually adding device info for now |
| TODO: Implement config table accurately |
\*-----------------------------------------------------*/
uint8_t leds = (dev_name.find("Ryujin") != std::string::npos) ? 5 : 12;
device_info.push_back({0x00, 0x00, leds, 0, AuraDeviceType::FIXED});
device_info.push_back({0x00, 0x00, 12, 0, AuraDeviceType::FIXED});
}
AsusAuraRyuoAIOController::~AsusAuraRyuoAIOController()
@@ -163,6 +163,7 @@ void RGBController_AsusAuraRyuoAIO::SetupZones()
new_led.name = zones[zone_idx].name;
new_led.name.append(" LED " + std::to_string(lp_idx));
new_led.value = lp_idx;
leds.push_back(new_led);
}
@@ -520,7 +520,7 @@ void RGBController_AuraTUFKeyboard::SetupZones()
{
led new_led;
new_led.name = keyboard[layout].led_names[led_id].name;
led_values.push_back(keyboard[layout].led_names[led_id].id);
new_led.value = keyboard[layout].led_names[led_id].id;
leds.push_back(new_led);
}
@@ -538,7 +538,7 @@ void RGBController_AuraTUFKeyboard::DeviceUpdateLEDs()
for(size_t i = 0; i < colors.size(); i++)
{
led_color_list.push_back({ led_values[i], colors[i] });
led_color_list.push_back({ leds[i].value, colors[i] });
}
controller->UpdateLeds(led_color_list);
@@ -560,7 +560,7 @@ void RGBController_AuraTUFKeyboard::DeviceUpdateSingleLED(int led)
unsigned char green = RGBGetGValue(colors[led]);
unsigned char blue = RGBGetBValue(colors[led]);
controller->UpdateSingleLed(led_values[led], red, green, blue);
controller->UpdateSingleLed(leds[led].value, red, green, blue);
}
static const uint8_t direction_map[2][6] =
@@ -53,5 +53,4 @@ public:
private:
AuraTUFKeyboardController* controller;
uint16_t pid;
std::vector<uint8_t> led_values;
};
@@ -120,7 +120,6 @@
#define AURA_TERMINAL_PID 0x1889
#define ROG_STRIX_LC120_PID 0x879E
#define AURA_RYUO_AIO_PID 0x1887
#define AURA_RYUJIN_AIO_PID 0x18AE
#define ASUS_ROG_ALLY_PID 0x1ABE
#define ASUS_ROG_ALLY_X_PID 0x1B4C
@@ -464,7 +463,6 @@ REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Origin COD",
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Wireless", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_WIRELESS_1_PID, 1, 0xFF13);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Wireless", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_WIRELESS_2_PID, 2, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Core", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_CORE_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Wireless USB", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_WIRELESS_USB_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Wireless 2.4Ghz", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_WIRELESS_2_4_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Wireless Bluetooth", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_WIRELESS_BT_PID, 0, 0xFF01);
@@ -525,7 +523,6 @@ REGISTER_HID_DETECTOR_PU("ASUS ROG PG32UQ", DetectAs
REGISTER_HID_DETECTOR ("ASUS ROG AURA Terminal", DetectAsusAuraUSBTerminal, AURA_USB_VID, AURA_TERMINAL_PID);
REGISTER_HID_DETECTOR_PU ("ASUS ROG Strix LC", DetectAsusAuraUSBROGStrixLC, AURA_USB_VID, ROG_STRIX_LC120_PID, 0x00FF, 1);
REGISTER_HID_DETECTOR_PU ("ASUS ROG Ryuo AIO", DetectAsusAuraUSBRyuoAIO, AURA_USB_VID, AURA_RYUO_AIO_PID, 0xFF72, 0x00A1);
REGISTER_HID_DETECTOR_PU ("ASUS ROG Ryujin AIO", DetectAsusAuraUSBRyuoAIO, AURA_USB_VID, AURA_RYUJIN_AIO_PID, 0xFF72, 0x00A1);
REGISTER_HID_DETECTOR_I ("ASUS ROG Throne", DetectAsusAuraUSBHeadsetStand, AURA_USB_VID, AURA_ROG_THRONE_PID, 0);
REGISTER_HID_DETECTOR_I ("ASUS ROG Throne QI", DetectAsusAuraUSBHeadsetStand, AURA_USB_VID, AURA_ROG_THRONE_QI_PID, 0);
REGISTER_HID_DETECTOR_I ("ASUS ROG Throne QI GUNDAM", DetectAsusAuraUSBHeadsetStand, AURA_USB_VID, AURA_ROG_THRONE_QI_GUNDAM_PID, 0);
@@ -164,6 +164,7 @@ void RGBController_AsusROGStrixLC::SetupZones()
new_led.name = zones[zone_idx].name;
new_led.name.append(" LED " + std::to_string(lp_idx));
new_led.value = lp_idx;
leds.push_back(new_led);
}
@@ -71,6 +71,7 @@ void RGBController_StrixClaw::SetupZones()
led scroll_wheel_led;
scroll_wheel_led.name = "Scroll Wheel LED";
scroll_wheel_led.value = 1;
leds.push_back(scroll_wheel_led);
@@ -87,6 +88,7 @@ void RGBController_StrixClaw::SetupZones()
led logo_led;
logo_led.name = "Logo LED";
logo_led.value = 1;
leds.push_back(logo_led);
@@ -241,9 +241,9 @@ void RGBController_ClevoKeyboard::SetupZones()
led new_led;
new_led.name = new_kb.GetKeyNameAt(led_idx);
new_led.value = new_kb.GetKeyValueAt(led_idx);
leds.push_back(new_led);
led_values.push_back(new_kb.GetKeyValueAt(led_idx));
}
SetupColors();
@@ -258,7 +258,7 @@ void RGBController_ClevoKeyboard::SetupZones()
for(size_t led_idx = 0; led_idx < leds.size(); led_idx++)
{
buffer_map[led_values[led_idx]] = &colors[led_idx];
buffer_map[leds[led_idx].value] = &colors[led_idx];
}
}
@@ -32,6 +32,5 @@ public:
private:
ClevoKeyboardController* controller;
std::vector<RGBColor*> buffer_map;
std::vector<unsigned int> led_values;
RGBColor null_color;
};
@@ -26,7 +26,7 @@ ColorfulGPUController::~ColorfulGPUController()
std::string ColorfulGPUController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -45,7 +45,7 @@ void ColorfulGPUController::SetDirect(RGBColor color)
uint8_t g = RGBGetGValue(color);
uint8_t b = RGBGetBValue(color);
if(this->bus->info.pci_subsystem_device == COLORFUL_IGAME_RTX_4070_VULCAN_OCV)
if(this->bus->pci_subsystem_device == COLORFUL_IGAME_RTX_4070_VULCAN_OCV)
{
uint8_t data_pkt[COLORFUL_PACKET_LENGTH_V2] = { 0xAA, 0xEF, 0x01, 0x04, 0x88, 0x26 };
for(int i=6; i < COLORFUL_PACKET_LENGTH_V2 -2; i = i + 3)
@@ -1,4 +1,4 @@
/*---------------------------------------------------------*\
/*---------------------------------------------------------*\
| ColorfulGPUControllerDetect.cpp |
| |
| Detector for Colorful GPU |
@@ -52,7 +52,7 @@ REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Advanced OC 12G L-V", Detec
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ultra W OC 12G L-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ultra W OC 12G L-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_GA106_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ultra W OC 12G L-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G_2, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Ultra W OC LHR-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Ultra W OC LHR-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Ultra W OC LHR-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G_2, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3070_ADVANCED_OCV, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060TI_ADVANCED_OC, 0x61);
@@ -76,8 +76,6 @@ REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4080 Ultra W OC-V", Detec
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4080 Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4080_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4080_ULTRAW_OCV2, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4090 Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4090_ADVANCED_OCV, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4090 Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4090_ADVANCED_OCV2, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5060 Ultra W OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5060_ULTRAW_OC, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5060 Ti Ultra W DUO OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060TI_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5060TI_ULTRAW_DUO_OC, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5060 Ti Ultra W DUO OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060TI_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5060TI_ULTRAW_DUO_OC_2, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5060 Ti Ultra W DUO OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060TI_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5060TI_ULTRAW_DUO_OC, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5070 Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5070_ULTRAW_OCV, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5070 Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5070_ULTRAW_OCV2, 0x61);
@@ -24,7 +24,7 @@ ColorfulTuringGPUController::~ColorfulTuringGPUController()
std::string ColorfulTuringGPUController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -17,7 +17,7 @@ DetectedControllers DetectColorfulTuringGPUControllers(i2c_smbus_interface* bus,
{
DetectedControllers detected_controllers;
if(bus->info.port_id == 1)
if(bus->port_id == 1)
{
ColorfulTuringGPUController* controller = new ColorfulTuringGPUController(bus, i2c_addr, name);
RGBController_ColorfulTuringGPU* rgb_controller = new RGBController_ColorfulTuringGPU(controller);
@@ -159,7 +159,7 @@ void RGBController_CMGD160Controller::SetupZones()
{
led l;
l.name = "Front LED " + std::to_string(i + 1);
l.value = i;
leds.push_back(l);
}
@@ -175,7 +175,7 @@ void RGBController_CMGD160Controller::SetupZones()
{
led l;
l.name = "Back LED " + std::to_string(i + 1);
l.value = i;
leds.push_back(l);
}
@@ -146,10 +146,12 @@ void RGBController_CMMM711Controller::Init_Controller()
led wheel_led;
wheel_led.name = "Scroll Wheel LED";
wheel_led.value = 0;
leds.push_back(wheel_led);
led logo_led;
logo_led.name = "Logo LED";
logo_led.value = 1;
leds.push_back(logo_led);
}
@@ -139,6 +139,7 @@ void RGBController_CMMM712Controller::Init_Controller()
led logo_led;
logo_led.name = "Logo LED";
logo_led.value = 0;
leds.push_back(logo_led);
}
@@ -183,24 +183,28 @@ void RGBController_CMMMController::Init_Controller()
mouse_zone.leds_count = leds_count;
zones.push_back(mouse_zone);
int value = 0;
uint16_t pid = controller->GetProductID();
led wheel_led;
wheel_led.name = "Scroll Wheel";
wheel_led.value = value;
leds.push_back(wheel_led);
value++;
if(pid == 0x0065 || pid == 0x0097)
{
led buttons_led;
buttons_led.name = "Buttons";
buttons_led.value = value;
leds.push_back(buttons_led);
value++;
}
led logo_led;
logo_led.name = "Logo";
logo_led.value = value;
leds.push_back(logo_led);
}
@@ -162,7 +162,7 @@ void RGBController_CMMonitorController::SetupZones()
{
led l;
l.name = std::to_string(i + 1);
l.value = i;
leds.push_back(l);
}
@@ -169,6 +169,7 @@ void RGBController_CMR6000Controller::SetupZones()
led GP_led;
GP_led.name = "Logo";
GP_led.value = 0;
leds.push_back(GP_led);
SetupColors();
@@ -52,7 +52,7 @@ unsigned char CorsairDRAMController::GetProtocolVersion()
std::string CorsairDRAMController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -366,7 +366,7 @@ void CorsairDRAMController::ReadDeviceInfo()
/*-----------------------------------------------------*\
| Log Device Information Data |
\*-----------------------------------------------------*/
if(LogManager::get()->GetLogLevel() >= LL_TRACE)
if(LogManager::get()->getLoglevel() >= LL_TRACE)
{
char device_info_buf[256];
unsigned int pos;
@@ -44,9 +44,9 @@ bool TestForCorsairDRAMController(i2c_smbus_interface *bus, unsigned char addres
res = bus->i2c_smbus_read_byte_data(address, 0x44);
if(!(res == 0x01 || res == 0x03 || res == 0x04))
if(!(res == 0x03 || res == 0x04))
{
LOG_DEBUG("[%s] Failed: expected 0x01, 0x03, or 0x04, got %04X", CORSAIR_DRAM_NAME, res);
LOG_DEBUG("[%s] Failed: expected 0x03 or 0x04, got %04X", CORSAIR_DRAM_NAME, res);
return false;
}
@@ -59,7 +59,7 @@ DetectedControllers DetectCorsairDRAMControllers(std::vector<i2c_smbus_interface
for(unsigned int bus = 0; bus < buses.size(); bus++)
{
IF_DRAM_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
IF_DRAM_SMBUS(buses[bus]->pci_vendor, buses[bus]->pci_device)
{
LOG_DEBUG("[%s] Testing bus %d", CORSAIR_DRAM_NAME, bus);
@@ -152,8 +152,8 @@ void RGBController_CorsairV2HW::SetupZones()
led new_led;
new_led.name = new_kb.GetKeyNameAt(led_idx);
led_values.push_back(new_kb.GetKeyValueAt(led_idx));
max_led_value = std::max(max_led_value, led_values.back());
new_led.value = new_kb.GetKeyValueAt(led_idx);
max_led_value = std::max(max_led_value, new_led.value);
leds.push_back(new_led);
}
}
@@ -176,7 +176,7 @@ void RGBController_CorsairV2HW::SetupZones()
new_led.name = new_zone.name + " ";
new_led.name.append(std::to_string( led_idx ));
led_values.push_back((unsigned int)leds.size());
new_led.value = (unsigned int)leds.size();
leds.push_back(new_led);
}
@@ -209,7 +209,7 @@ void RGBController_CorsairV2HW::SetupZones()
for(size_t led_idx = 0; led_idx < leds.size(); led_idx++)
{
buffer_map[led_values[led_idx]] = &colors[led_idx];
buffer_map[leds[led_idx].value] = &colors[led_idx];
}
}
@@ -34,7 +34,6 @@ public:
private:
CorsairPeripheralV2Controller* controller;
std::vector<unsigned int> led_values;
RGBColor null_color = 0;
std::vector<RGBColor *> buffer_map;
@@ -139,8 +139,8 @@ void RGBController_CorsairV2SW::SetupZones()
led new_led;
new_led.name = new_kb.GetKeyNameAt(led_idx);
led_values.push_back(new_kb.GetKeyValueAt(led_idx));
max_led_value = std::max(max_led_value, led_values.back());
new_led.value = new_kb.GetKeyValueAt(led_idx);
max_led_value = std::max(max_led_value, new_led.value);
leds.push_back(new_led);
}
}
@@ -163,7 +163,7 @@ void RGBController_CorsairV2SW::SetupZones()
new_led.name = new_zone.name + " ";
new_led.name.append(std::to_string( led_idx ));
led_values.push_back((unsigned int)leds.size());
new_led.value = (unsigned int)leds.size();
leds.push_back(new_led);
}
@@ -196,7 +196,7 @@ void RGBController_CorsairV2SW::SetupZones()
for(size_t led_idx = 0; led_idx < leds.size(); led_idx++)
{
buffer_map[led_values[led_idx]] = &colors[led_idx];
buffer_map[leds[led_idx].value] = &colors[led_idx];
}
}
@@ -36,7 +36,6 @@ public:
private:
CorsairPeripheralV2Controller* controller;
std::vector<unsigned int> led_values;
RGBColor null_color = 0;
std::vector<RGBColor *> buffer_map;
@@ -34,7 +34,7 @@ std::string CorsairVengeanceController::GetDeviceName()
std::string CorsairVengeanceController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -409,7 +409,7 @@ void RGBController_CougarKeyboard::SetupZones()
{
led new_led;
new_led.name = led_names[led_index];
new_led.value = led_index;
leds.push_back(new_led);
}
}
@@ -23,7 +23,7 @@ CreativeSoundBlasterXG6Controller::~CreativeSoundBlasterXG6Controller()
std::string CreativeSoundBlasterXG6Controller::GetDeviceLocation()
{
return("HID: " + location);
return("HID " + location);
}
std::string CreativeSoundBlasterXG6Controller::GetDeviceName()
@@ -35,7 +35,7 @@ std::string CrucialController::GetDeviceVersion()
std::string CrucialController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -145,7 +145,7 @@ DetectedControllers DetectCrucialControllers(std::vector<i2c_smbus_interface*> &
{
int address_list_idx = -1;
IF_DRAM_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
IF_DRAM_SMBUS(buses[bus]->pci_vendor, buses[bus]->pci_device)
{
for(unsigned int slot = 0; slot < 4; slot++)
{
@@ -182,7 +182,7 @@ DetectedControllers DetectCrucialControllers(std::vector<i2c_smbus_interface*> &
std::this_thread::sleep_for(1ms);
}
LOG_DEBUG("[%s] In bus: %02X:%02X looking for devices at [%s]", CRUCIAL_CONTROLLER_NAME, buses[bus]->info.pci_vendor, buses[bus]->info.pci_device, TESTING_ADDRESSES);
LOG_DEBUG("[%s] In bus: %02X:%02X looking for devices at [%s]", CRUCIAL_CONTROLLER_NAME, buses[bus]->pci_vendor, buses[bus]->pci_device, TESTING_ADDRESSES);
// Add Crucial controllers
for(unsigned int address_list_idx = 0; address_list_idx < CRUCIAL_ADDRESS_COUNT; address_list_idx++)
@@ -206,7 +206,7 @@ void RGBController_CryorigH7QuadLumi::SetupZones()
new_led.name = zone_names[zone_idx];
new_led.name.append(", LED ");
new_led.name.append(std::to_string(led_idx + 1));
led_values.push_back(zone_idx);
new_led.value = zone_idx;
leds.push_back(new_led);
}
@@ -233,7 +233,7 @@ void RGBController_CryorigH7QuadLumi::DeviceUpdateZoneLEDs(int zone)
void RGBController_CryorigH7QuadLumi::DeviceUpdateSingleLED(int led)
{
unsigned int zone_idx = led_values[led];
unsigned int zone_idx = leds[led].value;
DeviceUpdateZoneLEDs(zone_idx);
}
@@ -33,6 +33,5 @@ public:
private:
CryorigH7QuadLumiController* controller;
std::vector<unsigned int> leds_channel;
std::vector<unsigned int> led_values;
std::vector<unsigned int> zones_channel;
};
@@ -9,7 +9,7 @@
#include <string>
#include <vector>
#include <nlohmann/json.hpp>
#include "nlohmann/json.hpp"
#include "DetectionManager.h"
#include "LogManager.h"
#include "ResourceManager.h"
@@ -76,6 +76,7 @@ void RGBController_DDP::SetupZones()
{
led new_led;
new_led.name = zones[zone_idx].name + " LED " + std::to_string(led_idx + 1);
new_led.value = 0;
leds.push_back(new_led);
}
}
@@ -187,6 +187,7 @@ void RGBController_DarkProjectKeyboard::SetupZones()
{
led new_led;
new_led.name = led_names[led_index];
new_led.value = led_index;
leds.push_back(new_led);
}
}
@@ -13,7 +13,6 @@
#include <algorithm>
#include <cstring>
#include "KeyboardLayoutManager.h"
#include "JsonUtils.h"
#include "RGBController_Debug.h"
/**------------------------------------------------------------------*\
@@ -52,6 +51,100 @@ RGBController_Debug::RGBController_Debug(bool custom, json settings)
custom_controller = custom;
debug_settings = settings;
if(custom_controller)
{
/*-------------------------------------------------*\
| Set the name |
\*-------------------------------------------------*/
name = debug_settings["DeviceName"];
/*-------------------------------------------------*\
| Find the device type |
\*-------------------------------------------------*/
if (debug_settings["DeviceType"] == "motherboard") type = DEVICE_TYPE_MOTHERBOARD;
else if (debug_settings["DeviceType"] == "dram") type = DEVICE_TYPE_DRAM;
else if (debug_settings["DeviceType"] == "gpu") type = DEVICE_TYPE_GPU;
else if (debug_settings["DeviceType"] == "cooler") type = DEVICE_TYPE_COOLER;
else if (debug_settings["DeviceType"] == "led_strip") type = DEVICE_TYPE_LEDSTRIP;
else if (debug_settings["DeviceType"] == "keyboard") type = DEVICE_TYPE_KEYBOARD;
else if (debug_settings["DeviceType"] == "mouse") type = DEVICE_TYPE_MOUSE;
else if (debug_settings["DeviceType"] == "mousemat") type = DEVICE_TYPE_MOUSEMAT;
else if (debug_settings["DeviceType"] == "headset") type = DEVICE_TYPE_HEADSET;
else if (debug_settings["DeviceType"] == "headset_stand") type = DEVICE_TYPE_HEADSET_STAND;
else if (debug_settings["DeviceType"] == "gamepad") type = DEVICE_TYPE_GAMEPAD;
else if (debug_settings["DeviceType"] == "light") type = DEVICE_TYPE_LIGHT;
else if (debug_settings["DeviceType"] == "speaker") type = DEVICE_TYPE_SPEAKER;
else if (debug_settings["DeviceType"] == "unknown") type = DEVICE_TYPE_UNKNOWN;
/*-------------------------------------------------*\
| Set description, location, version, and serial |
\*-------------------------------------------------*/
description = debug_settings["DeviceDescription"];
location = debug_settings["DeviceLocation"];
version = debug_settings["DeviceVersion"];
serial = debug_settings["DeviceSerial"];
}
else
{
std::string name_setting = "";
std::string type_setting = "keyboard";
if(debug_settings.contains("name"))
{
name_setting = debug_settings["name"];
}
if(debug_settings.contains("type"))
{
type_setting = debug_settings["type"];
}
if(type_setting == "motherboard")
{
name = "Debug Motherboard";
type = DEVICE_TYPE_MOTHERBOARD;
}
else if(type_setting == "dram")
{
name = "Debug DRAM";
type = DEVICE_TYPE_DRAM;
}
else if(type_setting == "gpu")
{
name = "Debug GPU";
type = DEVICE_TYPE_GPU;
}
else if(type_setting == "keyboard")
{
name = "Debug Keyboard";
type = DEVICE_TYPE_KEYBOARD;
}
else if(type_setting == "mouse")
{
name = "Debug Mouse";
type = DEVICE_TYPE_MOUSE;
}
else if(type_setting == "argb")
{
name = "Debug ARGB Controller";
type = DEVICE_TYPE_LEDSTRIP;
}
/*---------------------------------------------------------*\
| Fill in debug controller information |
\*---------------------------------------------------------*/
description = name + " Device";
vendor = name + " Vendor String";
location = name + " Location String";
version = name + " Version String";
serial = name + " Serial String";
if(name_setting != "")
{
name = name_setting;
}
}
/*-----------------------------------------------------*\
| Create the mode |
\*-----------------------------------------------------*/
@@ -64,7 +157,6 @@ RGBController_Debug::RGBController_Debug(bool custom, json settings)
modes.push_back(Direct);
SetupDevice();
SetupZones();
}
@@ -73,137 +165,6 @@ RGBController_Debug::~RGBController_Debug()
Shutdown();
}
void RGBController_Debug::SetupDevice()
{
if(custom_controller)
{
/*-------------------------------------------------*\
| Set the name, description, location, version, and |
| serial |
\*-------------------------------------------------*/
name = JsonUtils::JsonGetString(debug_settings, "DeviceName", "Custom Device");
description = JsonUtils::JsonGetString(debug_settings, "DeviceDescription");
location = JsonUtils::JsonGetString(debug_settings, "DeviceLocation");
version = JsonUtils::JsonGetString(debug_settings, "DeviceVersion");
serial = JsonUtils::JsonGetString(debug_settings, "DeviceSerial");
/*-------------------------------------------------*\
| Find the device type |
\*-------------------------------------------------*/
std::string device_type = JsonUtils::JsonGetString(debug_settings, "DeviceType", "keyboard");
if( device_type == "motherboard") type = DEVICE_TYPE_MOTHERBOARD;
else if(device_type == "dram") type = DEVICE_TYPE_DRAM;
else if(device_type == "gpu") type = DEVICE_TYPE_GPU;
else if(device_type == "cooler") type = DEVICE_TYPE_COOLER;
else if(device_type == "led_strip") type = DEVICE_TYPE_LEDSTRIP;
else if(device_type == "keyboard") type = DEVICE_TYPE_KEYBOARD;
else if(device_type == "mouse") type = DEVICE_TYPE_MOUSE;
else if(device_type == "mousemat") type = DEVICE_TYPE_MOUSEMAT;
else if(device_type == "headset") type = DEVICE_TYPE_HEADSET;
else if(device_type == "headset_stand") type = DEVICE_TYPE_HEADSET_STAND;
else if(device_type == "gamepad") type = DEVICE_TYPE_GAMEPAD;
else if(device_type == "light") type = DEVICE_TYPE_LIGHT;
else if(device_type == "speaker") type = DEVICE_TYPE_SPEAKER;
else if(device_type == "unknown") type = DEVICE_TYPE_UNKNOWN;
}
else
{
std::string name_value;
std::string name_setting = JsonUtils::JsonGetString(debug_settings, "name");
std::string type_setting = JsonUtils::JsonGetString(debug_settings, "type", "keyboard");
if(type_setting == "motherboard")
{
name_value = "Debug Motherboard";
type = DEVICE_TYPE_MOTHERBOARD;
}
else if(type_setting == "dram")
{
name_value = "Debug DRAM";
type = DEVICE_TYPE_DRAM;
}
else if(type_setting == "gpu")
{
name_value = "Debug GPU";
type = DEVICE_TYPE_GPU;
}
else if(type_setting == "keyboard")
{
name_value = "Debug Keyboard";
type = DEVICE_TYPE_KEYBOARD;
}
else if(type_setting == "mouse")
{
name_value = "Debug Mouse";
type = DEVICE_TYPE_MOUSE;
}
else if(type_setting == "argb")
{
name_value = "Debug ARGB Controller";
type = DEVICE_TYPE_LEDSTRIP;
}
/*---------------------------------------------------------*\
| Fill in debug controller information |
\*---------------------------------------------------------*/
description = name_value + " Device";
vendor = name_value + " Vendor String";
location = name_value + " Location String";
version = name_value + " Version String";
serial = name_value + " Serial String";
flags |= CONTROLLER_FLAG_MANUALLY_CONFIGURABLE_NAME | CONTROLLER_FLAG_MANUALLY_CONFIGURABLE_DEVICE_SPECIFIC;
if(name_setting != "")
{
name_value = name_setting;
}
if((flags & CONTROLLER_FLAG_MANUALLY_CONFIGURED_NAME) == 0)
{
name = name_value;
}
/*---------------------------------------------------------*\
| Create test configuration |
\*---------------------------------------------------------*/
nlohmann::json configuration_json;
JsonUtils::JsonParse(configuration, configuration_json);
configuration_json["schema"]["test_string"]["title"] = "String Setting";
configuration_json["schema"]["test_string"]["type"] = "string";
configuration_json["schema"]["test_bool"]["title"] = "Boolean Setting";
configuration_json["schema"]["test_bool"]["type"] = "bool";
configuration_json["schema"]["test_enum"]["title"] = "String Enum Setting";
configuration_json["schema"]["test_enum"]["type"] = "string";
configuration_json["schema"]["test_enum"]["enum"][0] = "Option 1";
configuration_json["schema"]["test_enum"]["enum"][1] = "Option 2";
configuration_json["schema"]["test_enum"]["enum"][2] = "Option 3";
configuration_json["schema"]["test_enum_int"]["title"] = "Integer Enum Setting";
configuration_json["schema"]["test_enum_int"]["type"] = "integer";
configuration_json["schema"]["test_enum_int"]["enum"][0] = 2;
configuration_json["schema"]["test_enum_int"]["enum"][1] = 4;
configuration_json["schema"]["test_enum_int"]["enum"][2] = 8;
configuration_json["schema"]["test_int"]["title"] = "Integer Setting";
configuration_json["schema"]["test_int"]["type"] = "integer";
if((flags & CONTROLLER_FLAG_MANUALLY_CONFIGURED_DEVICE_SPECIFIC) == 0)
{
configuration_json["configuration"]["test_string"] = "This is a test";
configuration_json["configuration"]["test_bool"] = true;
configuration_json["configuration"]["test_enum"] = "Option 2";
configuration_json["configuration"]["test_enum_int"] = 4;
configuration_json["configuration"]["test_int"] = 12345;
}
configuration = configuration_json.dump();
}
}
void RGBController_Debug::SetupZones()
{
/*-------------------------------------------------*\
@@ -220,7 +181,6 @@ void RGBController_Debug::SetupZones()
/*-------------------------------------------------*\
| Clear any existing color/LED configuration |
\*-------------------------------------------------*/
led_display_names.clear();
leds.clear();
colors.clear();
@@ -256,9 +216,9 @@ void RGBController_Debug::SetupZones()
continue;
}
custom_zone.leds_min = JsonUtils::JsonGetInt(ZoneJson, "leds_min");
custom_zone.leds_max = JsonUtils::JsonGetInt(ZoneJson, "leds_max");
custom_zone.leds_count = JsonUtils::JsonGetInt(ZoneJson, "leds_count");
custom_zone.leds_min = ZoneJson["leds_min"];
custom_zone.leds_max = ZoneJson["leds_max"];
custom_zone.leds_count = ZoneJson["leds_count"];
/*---------------------------------------------*\
| Fill in the matrix map |
@@ -281,8 +241,8 @@ void RGBController_Debug::SetupZones()
continue;
}
unsigned int H = JsonUtils::JsonGetInt(ZoneJson, "matrix_width");
unsigned int W = JsonUtils::JsonGetInt(ZoneJson, "matrix_height");
unsigned int H = ZoneJson["matrix_width"];
unsigned int W = ZoneJson["matrix_height"];
BadVal = ((unsigned int)ZoneJson["matrix_map"].size() != H);
@@ -373,11 +333,36 @@ void RGBController_Debug::SetupZones()
}
else
{
bool zone_single = JsonUtils::JsonGetBool(debug_settings, "single", true);
bool zone_linear = JsonUtils::JsonGetBool(debug_settings, "linear", true);
bool zone_resizable = JsonUtils::JsonGetBool(debug_settings, "resizable", false);
bool zone_keyboard = JsonUtils::JsonGetBool(debug_settings, "keyboard", false);
bool zone_underglow = JsonUtils::JsonGetBool(debug_settings, "underglow", false);
bool zone_single = true;
bool zone_linear = true;
bool zone_resizable = false;
bool zone_keyboard = false;
bool zone_underglow = false;
if(debug_settings.contains("single"))
{
zone_single = debug_settings["single"];
}
if(debug_settings.contains("linear"))
{
zone_linear = debug_settings["linear"];
}
if(debug_settings.contains("resizable"))
{
zone_resizable = debug_settings["resizable"];
}
if(debug_settings.contains("keyboard"))
{
zone_keyboard = debug_settings["keyboard"];
}
if(debug_settings.contains("underglow"))
{
zone_underglow = debug_settings["underglow"];
}
/*-------------------------------------------------*\
| Create a single zone/LED |
@@ -386,51 +371,28 @@ void RGBController_Debug::SetupZones()
{
zone single_zone;
single_zone.name = "Single Zone";
single_zone.type = ZONE_TYPE_SINGLE;
single_zone.leds_min = 1;
single_zone.leds_max = 1;
single_zone.leds_count = 1;
if(first_run)
{
zones.push_back(single_zone);
}
zones[zone_idx].name = "Single Zone";
zones[zone_idx].type = ZONE_TYPE_SINGLE;
if(first_run)
else
{
zones[zone_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_DEVICE_SPECIFIC;
zones[zone_idx] = single_zone;
}
zones[zone_idx].leds_min = 1;
zones[zone_idx].leds_max = 1;
zones[zone_idx].leds_count = 1;
led single_led;
single_led.name = "Single LED";
leds.push_back(single_led);
led_display_names.push_back("");
nlohmann::json configuration_json;
JsonUtils::JsonParse(configuration, configuration_json);
if(first_run)
{
/*-----------------------------------------*\
| Create test configuration |
\*-----------------------------------------*/
configuration_json["zones"][zone_idx]["schema"]["color_order"]["title"] = "Color Order";
configuration_json["zones"][zone_idx]["schema"]["color_order"]["type"] = "string";
configuration_json["zones"][zone_idx]["schema"]["color_order"]["enum"][0] = "RGB";
configuration_json["zones"][zone_idx]["schema"]["color_order"]["enum"][1] = "GRB";
}
if((zones[zone_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_DEVICE_SPECIFIC) == 0)
{
configuration_json["zones"][zone_idx]["configuration"]["color_order"] = "RGB";
}
configuration = configuration_json.dump();
led_alt_names.push_back("");
zone_idx++;
}
@@ -442,18 +404,22 @@ void RGBController_Debug::SetupZones()
{
zone linear_zone;
linear_zone.name = "Linear Zone";
linear_zone.type = ZONE_TYPE_LINEAR;
linear_zone.leds_min = 10;
linear_zone.leds_max = 10;
linear_zone.leds_count = 10;
if(first_run)
{
zones.push_back(linear_zone);
}
else
{
zones[zone_idx] = linear_zone;
}
zones[zone_idx].name = "Linear Zone";
zones[zone_idx].type = ZONE_TYPE_LINEAR;
zones[zone_idx].leds_min = 10;
zones[zone_idx].leds_max = 10;
zones[zone_idx].leds_count = 10;
for(std::size_t led_idx = 0; led_idx < zones[zone_idx].leds_count; led_idx++)
for(std::size_t led_idx = 0; led_idx < 10; led_idx++)
{
led linear_led;
@@ -461,7 +427,7 @@ void RGBController_Debug::SetupZones()
leds.push_back(linear_led);
led_display_names.push_back("");
led_alt_names.push_back("");
}
zone_idx++;
@@ -475,24 +441,6 @@ void RGBController_Debug::SetupZones()
KEYBOARD_LAYOUT layout = KEYBOARD_LAYOUT::KEYBOARD_LAYOUT_ANSI_QWERTY;
KEYBOARD_SIZE size = KEYBOARD_SIZE::KEYBOARD_SIZE_FULL;
nlohmann::json configuration_json;
JsonUtils::JsonParse(configuration, configuration_json);
zone keyboard_zone;
if(first_run)
{
zones.push_back(keyboard_zone);
}
zones[zone_idx].name = "Keyboard Zone";
zones[zone_idx].type = ZONE_TYPE_MATRIX;
if(first_run)
{
zones[zone_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_DEVICE_SPECIFIC | ZONE_FLAG_ZONE_GEOMETRY_MAY_CHANGE;
}
if(debug_settings.contains("layout"))
{
KEYBOARD_LAYOUT temp_layout = debug_settings["layout"];
@@ -503,29 +451,6 @@ void RGBController_Debug::SetupZones()
}
}
if(zones[zone_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_DEVICE_SPECIFIC)
{
if(configuration_json.contains("zones") && (zone_idx < (int)configuration_json["zones"].size()))
{
if(configuration_json["zones"][zone_idx].contains("configuration"))
{
if(configuration_json["zones"][zone_idx]["configuration"].contains("layout"))
{
std::string layout_string = configuration_json["zones"][zone_idx]["configuration"]["layout"];
for(std::size_t layout_idx = 0; layout_idx < NUM_LAYOUTS; layout_idx++)
{
if(layout_names[layout_idx] == layout_string)
{
layout = (KEYBOARD_LAYOUT)layout_idx;
break;
}
}
}
}
}
}
if(debug_settings.contains("size"))
{
size = debug_settings["size"];
@@ -533,6 +458,8 @@ void RGBController_Debug::SetupZones()
KeyboardLayoutManager new_kb(layout, size);
description += ", Layout: " + layout_names[layout] + ", Size: " + new_kb.GetName();
/*---------------------------------------------*\
| Check for custom key inserts and swaps |
\*---------------------------------------------*/
@@ -591,12 +518,25 @@ void RGBController_Debug::SetupZones()
new_kb.ChangeKeys(change);
}
zones[zone_idx].leds_min = new_kb.GetKeyCount();
zones[zone_idx].leds_max = new_kb.GetKeyCount();
zones[zone_idx].leds_count = new_kb.GetKeyCount();
zones[zone_idx].matrix_map = new_kb.GetKeyMap(KEYBOARD_MAP_FILL_TYPE_COUNT);
zone keyboard_zone;
for(unsigned int led_idx = 0; led_idx < zones[zone_idx].leds_count; led_idx++)
keyboard_zone.name = "Keyboard Zone";
keyboard_zone.type = ZONE_TYPE_MATRIX;
keyboard_zone.leds_min = new_kb.GetKeyCount();
keyboard_zone.leds_max = new_kb.GetKeyCount();
keyboard_zone.leds_count = new_kb.GetKeyCount();
keyboard_zone.matrix_map = new_kb.GetKeyMap(KEYBOARD_MAP_FILL_TYPE_COUNT);
if(first_run)
{
zones.push_back(keyboard_zone);
}
else
{
zones[zone_idx] = keyboard_zone;
}
for(unsigned int led_idx = 0; led_idx < keyboard_zone.leds_count; led_idx++)
{
led keyboard_led;
@@ -604,31 +544,9 @@ void RGBController_Debug::SetupZones()
leds.push_back(keyboard_led);
led_display_names.push_back(new_kb.GetKeyAltNameAt(led_idx));
led_alt_names.push_back(new_kb.GetKeyAltNameAt(led_idx));
}
if(first_run)
{
/*-----------------------------------------*\
| Create test configuration |
\*-----------------------------------------*/
configuration_json["zones"][zone_idx]["schema"]["layout"]["title"] = "Layout";
configuration_json["zones"][zone_idx]["schema"]["layout"]["type"] = "string";
configuration_json["zones"][zone_idx]["schema"]["layout"]["enum"][0] = "Default",
configuration_json["zones"][zone_idx]["schema"]["layout"]["enum"][1] = "ANSI QWERTY";
configuration_json["zones"][zone_idx]["schema"]["layout"]["enum"][2] = "ISO QWERTY";
configuration_json["zones"][zone_idx]["schema"]["layout"]["enum"][3] = "ISO QWERTZ";
configuration_json["zones"][zone_idx]["schema"]["layout"]["enum"][4] = "ISO AZERTY";
configuration_json["zones"][zone_idx]["schema"]["layout"]["enum"][5] = "JIS";
}
if((zones[zone_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_DEVICE_SPECIFIC) == 0)
{
configuration_json["zones"][zone_idx]["configuration"]["layout"] = "Default";
}
configuration = configuration_json.dump();
zone_idx++;
}
@@ -663,7 +581,7 @@ void RGBController_Debug::SetupZones()
leds.push_back(underglow_led);
led_display_names.push_back("");
led_alt_names.push_back("");
}
zone_idx++;
@@ -719,7 +637,7 @@ void RGBController_Debug::SetupZones()
leds.push_back(resizable_led);
led_display_names.push_back("");
led_alt_names.push_back("");
}
zone_idx++;
@@ -729,11 +647,6 @@ void RGBController_Debug::SetupZones()
SetupColors();
}
void RGBController_Debug::DeviceConfigureDevice()
{
SetupDevice();
}
void RGBController_Debug::DeviceConfigureZone(int zone_idx)
{
if((size_t)zone_idx < zones.size())
@@ -761,13 +674,3 @@ void RGBController_Debug::DeviceUpdateMode()
{
}
void RGBController_Debug::DeviceUpdateDeviceSpecificConfiguration()
{
}
void RGBController_Debug::DeviceUpdateDeviceSpecificZoneConfiguration(int zone)
{
SetupZones();
}
@@ -23,10 +23,8 @@ public:
RGBController_Debug(bool custom, json settings);
~RGBController_Debug();
void SetupDevice();
void SetupZones();
void DeviceConfigureDevice();
void DeviceConfigureZone(int zone_idx);
void DeviceUpdateLEDs();
@@ -35,9 +33,6 @@ public:
void DeviceUpdateMode();
void DeviceUpdateDeviceSpecificConfiguration();
void DeviceUpdateDeviceSpecificZoneConfiguration(int zone);
private:
json debug_settings;
bool custom_controller;
@@ -235,7 +235,8 @@ void RGBController_E131::SetupZones()
led_zone.leds_count = devices[zone_idx].num_leds;
led_zone.flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS
| ZONE_FLAG_MANUALLY_CONFIGURABLE_COLOR_ORDER;
zones.push_back(led_zone);
}
@@ -53,7 +53,7 @@ ENESMBusController::ENESMBusController(ENESMBusInterface* interface, ene_dev_id
| If this is running with TRACE or higher loglevel |
| then dump the entire Feature list to log |
\*-------------------------------------------------*/
if(LogManager::get()->GetLogLevel() >= LL_TRACE)
if(LogManager::get()->getLoglevel() >= LL_TRACE)
{
LOG_TRACE("[ENE SMBus] ENE config table for 0x%02X:", dev);
LOG_TRACE(" %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X", config_table[0], config_table[1], config_table[2], config_table[3],
@@ -154,7 +154,7 @@ DetectedControllers DetectENESMBusDRAMControllers(std::vector<i2c_smbus_interfac
{
int address_list_idx = -1;
IF_DRAM_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
IF_DRAM_SMBUS(buses[bus]->pci_vendor, buses[bus]->pci_device)
{
LOG_DEBUG("[ENE SMBus DRAM] Remapping ENE SMBus RAM modules on 0x77");
@@ -220,9 +220,9 @@ DetectedControllers DetectENESMBusMotherboardControllers(std::vector<i2c_smbus_i
for(unsigned int bus = 0; bus < buses.size(); bus++)
{
// Add ENE (ASUS Aura) motherboard controllers
IF_MOBO_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
IF_MOBO_SMBUS(buses[bus]->pci_vendor, buses[bus]->pci_device)
{
if(buses[bus]->info.pci_subsystem_vendor == ASUS_SUB_VEN || buses[bus]->info.pci_subsystem_vendor == 0 || buses[bus]->info.pci_subsystem_vendor == 0xFFFF)
if(buses[bus]->pci_subsystem_vendor == ASUS_SUB_VEN || buses[bus]->pci_subsystem_vendor == 0 || buses[bus]->pci_subsystem_vendor == 0xFFFF)
{
for(unsigned int address_list_idx = 0; address_list_idx < AURA_MOBO_ADDRESS_COUNT; address_list_idx++)
{
@@ -302,7 +302,6 @@ REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 3060 Ti Gaming OC",
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 3060 Ti OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3060TI_O8G_OC, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 3060 Ti OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_3060TI_O8G_OC_V2, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 3060 Ti V2 OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3060TI_O8G_V2_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 3060 Ti V2 OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3060TI_O8G_V2_2_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 3070 OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3070_OC, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 3070 Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3070_O8G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 3070 White OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3070_O8G_WHITE, 0x67);
@@ -410,10 +409,8 @@ REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 4090 Gaming White",
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 4090 Gaming White OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_4090_O24G_GAMING_WHITE, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 4090 Gaming White OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_4090_O24G_GAMING_WHITE_2, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG MATRIX PLATINUM GeForce RTX 4090", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, ASUS_SUB_VEN, ASUS_ROG_MATRIX_PLATINUM_RTX_4090_24G, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5060 Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5060_O8G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5070 Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5070_O12G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5070 Gaming", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5070_O12G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5070 Ti Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5070TI_O16G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5070 Ti Gaming White OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5070TI_O16G_GAMING_WHITE, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 5070 Ti Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_5070TI_O16G_GAMING_OC, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5080 Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5080_O16G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5090 Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5090_O32G_GAMING, 0x67);
@@ -421,7 +418,6 @@ REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5090 Gaming",
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5080 OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5080_O16G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5080 OC WHITE", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5080_O16G_GAMING_WHITE, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5080", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5080_16G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5080 WHITE", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5080_16G_GAMING_WHITE, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5090 OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5090_O32G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5090 OC BTF", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5090_O32G_GAMING_BTF, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5090 OC WHITE", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5090_O32G_GAMING_WHITE, 0x67);
@@ -452,7 +448,6 @@ REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 7700 XT Gaming OC",
REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 7800 XT Gaming OC", DetectENESMBusGPUControllers, AMD_GPU_VEN, AMD_NAVI32_DEV, ASUS_SUB_VEN, ASUS_TUF_RX_7800XT_O16G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 7800 XT Gaming OC", DetectENESMBusGPUControllers, AMD_GPU_VEN, AMD_NAVI32_DEV, ASUS_SUB_VEN, ASUS_TUF_RX_7800XT_O16G_GAMING_0606, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 7800 XT Gaming White OC", DetectENESMBusGPUControllers, AMD_GPU_VEN, AMD_NAVI32_DEV, ASUS_SUB_VEN, ASUS_TUF_RX_7800XT_O16G_WHITE_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 7900 GRE Gaming OC", DetectENESMBusGPUControllers, AMD_GPU_VEN, AMD_NAVI31_DEV, ASUS_SUB_VEN, ASUS_TUF_RX_7900GRE_O16G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 7900 XT Gaming OC", DetectENESMBusGPUControllers, AMD_GPU_VEN, AMD_NAVI31_DEV, ASUS_SUB_VEN, ASUS_TUF_RX_7900XT_020G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 7900 XTX Gaming OC", DetectENESMBusGPUControllers, AMD_GPU_VEN, AMD_NAVI31_DEV, ASUS_SUB_VEN, ASUS_TUF_RX_7900XTX_O24G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 9070 Gaming OC", DetectENESMBusGPUControllers, AMD_GPU_VEN, AMD_NAVI48_DEV, ASUS_SUB_VEN, ASUS_TUF_RX_9070_016G_GAMING, 0x67);
@@ -28,7 +28,7 @@ ene_interface_type ENESMBusInterface_i2c_smbus::GetInterfaceType()
std::string ENESMBusInterface_i2c_smbus::GetLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
return("I2C: " + return_string);
}
@@ -265,7 +265,7 @@ int RGBController_ENESMBus::GetDeviceMode()
\*---------------------------------------------------------*/
for(std::size_t led_idx = 0; led_idx < leds.size(); led_idx++)
{
unsigned int led = led_values[led_idx];
unsigned int led = leds[led_idx].value;
unsigned char red;
unsigned char grn;
unsigned char blu;
@@ -306,7 +306,7 @@ void RGBController_ENESMBus::DeviceUpdateZoneLEDs(int zone)
{
for(std::size_t led_idx = 0; led_idx < zones[zone].leds_count; led_idx++)
{
int led = led_values[zones[zone].start_idx + led_idx];
int led = zones[zone].leds[led_idx].value;
RGBColor color = colors[led];
unsigned char red = RGBGetRValue(color);
unsigned char grn = RGBGetGValue(color);
@@ -435,7 +435,7 @@ void RGBController_ENESMBus::SetupZones()
new_led->name = zones[zone_idx].name + " LED ";
new_led->name.append(std::to_string(zone_led_idx + 1));
led_values.push_back(led_idx);
new_led->value = led_idx;
led_idx++;
leds.push_back(*new_led);
@@ -30,8 +30,7 @@ public:
void DeviceSaveMode();
private:
ENESMBusController* controller;
std::vector<unsigned int> led_values;
ENESMBusController* controller;
int GetDeviceMode();
};
@@ -20,7 +20,7 @@ DetectedControllers DetectEVGAAmpereGPUControllers(i2c_smbus_interface* bus, uin
{
DetectedControllers detected_controllers;
if(bus->info.port_id == 1)
if(bus->port_id == 1)
{
EVGAGPUv3Controller* controller;
RGBController_EVGAGPUv3* rgb_controller;
@@ -26,7 +26,7 @@ EVGAGPUv3Controller::~EVGAGPUv3Controller()
std::string EVGAGPUv3Controller::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
@@ -25,7 +25,7 @@ EVGAGP102Controller::~EVGAGP102Controller()
std::string EVGAGP102Controller::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", zi.dev_addr);
return_string.append(", address ");
@@ -21,7 +21,7 @@ DetectedControllers DetectEVGAGP102GPUControllers(i2c_smbus_interface* bus, uint
{
DetectedControllers detected_controllers;
if(bus->info.port_id == 1)
if(bus->port_id == 1)
{
std::vector<EVGAGP102Controller*> controllers;
@@ -25,7 +25,7 @@ EVGAGPUv1Controller::~EVGAGPUv1Controller()
std::string EVGAGPUv1Controller::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -20,7 +20,7 @@ DetectedControllers DetectEVGAPascalGPUControllers(i2c_smbus_interface* bus, uin
{
DetectedControllers detected_controllers;
if(bus->info.port_id == 1)
if(bus->port_id == 1)
{
EVGAGPUv1Controller* controller = new EVGAGPUv1Controller(bus, address, name);
RGBController_EVGAGPUv1* rgb_controller = new RGBController_EVGAGPUv1(controller);
@@ -32,7 +32,7 @@ EVGAACX30SMBusController::~EVGAACX30SMBusController()
std::string EVGAACX30SMBusController::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -46,9 +46,9 @@ DetectedControllers DetectAcx30SMBusControllers(std::vector<i2c_smbus_interface
for(unsigned int bus = 0; bus < buses.size(); bus++)
{
IF_MOBO_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
IF_MOBO_SMBUS(buses[bus]->pci_vendor, buses[bus]->pci_device)
{
if(buses[bus]->info.pci_subsystem_vendor == EVGA_SUB_VEN)
if(buses[bus]->pci_subsystem_vendor == EVGA_SUB_VEN)
{
LOG_DEBUG(SMBUS_CHECK_DEVICE_MESSAGE_EN, EVGA_DETECTOR_NAME, bus, VENDOR_NAME, SMBUS_ADDRESS);
// Check for ACX 30 controller at 0x28
@@ -25,7 +25,7 @@ EVGAGPUv2Controller::~EVGAGPUv2Controller()
std::string EVGAGPUv2Controller::GetDeviceLocation()
{
std::string return_string(bus->info.device_name);
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
@@ -19,7 +19,7 @@ DetectedControllers DetectEVGATuringGPUControllers(i2c_smbus_interface* bus, uin
{
DetectedControllers detected_controllers;
if(bus->info.port_id == 1)
if(bus->port_id == 1)
{
EVGAGPUv2Controller* controller = new EVGAGPUv2Controller(bus, address, name);
RGBController_EVGAGPUv2* rgb_controller = new RGBController_EVGAGPUv2(controller);

Some files were not shown because too many files have changed in this diff Show More