mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-04-04 22:24:12 -04:00
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
This commit is contained in:
@@ -118,7 +118,6 @@ void RGBController_LogitechG203L::SetupZones()
|
||||
g203L_zone.leds_min = 3;
|
||||
g203L_zone.leds_max = 3;
|
||||
g203L_zone.leds_count = 3;
|
||||
g203L_zone.matrix_map = NULL;
|
||||
zones.push_back(g203L_zone);
|
||||
|
||||
led g203L_led_l;
|
||||
@@ -139,25 +138,18 @@ void RGBController_LogitechG203L::SetupZones()
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_LogitechG203L::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_LogitechG203L::DeviceUpdateLEDs()
|
||||
{
|
||||
controller->SetDevice(colors);
|
||||
controller->SetDevice(colors); //dirty workaround for color lag
|
||||
}
|
||||
|
||||
void RGBController_LogitechG203L::UpdateZoneLEDs(int /*zone*/)
|
||||
void RGBController_LogitechG203L::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_LogitechG203L::UpdateSingleLED(int led)
|
||||
void RGBController_LogitechG203L::DeviceUpdateSingleLED(int led)
|
||||
{
|
||||
unsigned char red = RGBGetRValue(colors[led]);
|
||||
unsigned char grn = RGBGetGValue(colors[led]);
|
||||
|
||||
@@ -20,11 +20,9 @@ public:
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
|
||||
@@ -120,9 +120,6 @@ void RGBController_LogitechG213::SetupZones()
|
||||
new_zone.leds_min = 5;
|
||||
new_zone.leds_max = 5;
|
||||
new_zone.leds_count = 5;
|
||||
|
||||
new_zone.matrix_map = NULL;
|
||||
|
||||
zones.push_back(new_zone);
|
||||
|
||||
for(unsigned int led_idx = 0; led_idx < LOGITECH_G213_ZONES; led_idx++)
|
||||
@@ -136,13 +133,6 @@ void RGBController_LogitechG213::SetupZones()
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_LogitechG213::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_LogitechG213::DeviceUpdateLEDs()
|
||||
{
|
||||
for(std::size_t led_idx = 0; led_idx < leds.size(); led_idx++)
|
||||
@@ -151,12 +141,12 @@ void RGBController_LogitechG213::DeviceUpdateLEDs()
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_LogitechG213::UpdateZoneLEDs(int zone)
|
||||
void RGBController_LogitechG213::DeviceUpdateZoneLEDs(int zone)
|
||||
{
|
||||
controller->SetDirect((unsigned char) zone, RGBGetRValue(zones[zone].colors[0]), RGBGetGValue(zones[zone].colors[0]), RGBGetBValue(zones[zone].colors[0]));
|
||||
}
|
||||
|
||||
void RGBController_LogitechG213::UpdateSingleLED(int led)
|
||||
void RGBController_LogitechG213::DeviceUpdateSingleLED(int led)
|
||||
{
|
||||
controller->SetDirect(leds[led].value, RGBGetRValue(colors[led]), RGBGetGValue(colors[led]), RGBGetBValue(colors[led]));
|
||||
}
|
||||
@@ -169,7 +159,7 @@ void RGBController_LogitechG213::DeviceUpdateMode()
|
||||
\*---------------------------------------------------------*/
|
||||
if(active_mode == 0xFFFF)
|
||||
{
|
||||
UpdateLEDs();
|
||||
UpdateLEDsInternal();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,11 +22,9 @@ public:
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
|
||||
@@ -57,7 +57,6 @@ void RGBController_LogitechG560::SetupZones()
|
||||
G560_left_front.leds_min = 1;
|
||||
G560_left_front.leds_max = 1;
|
||||
G560_left_front.leds_count = 1;
|
||||
G560_left_front.matrix_map = NULL;
|
||||
zones.push_back(G560_left_front);
|
||||
|
||||
led G560_left_front_led;
|
||||
@@ -72,7 +71,6 @@ void RGBController_LogitechG560::SetupZones()
|
||||
G560_right_front.leds_min = 1;
|
||||
G560_right_front.leds_max = 1;
|
||||
G560_right_front.leds_count = 1;
|
||||
G560_right_front.matrix_map = NULL;
|
||||
zones.push_back(G560_right_front);
|
||||
|
||||
led G560_right_front_led;
|
||||
@@ -87,7 +85,6 @@ void RGBController_LogitechG560::SetupZones()
|
||||
G560_left_rear.leds_min = 1;
|
||||
G560_left_rear.leds_max = 1;
|
||||
G560_left_rear.leds_count = 1;
|
||||
G560_left_rear.matrix_map = NULL;
|
||||
zones.push_back(G560_left_rear);
|
||||
|
||||
led G560_left_read_led;
|
||||
@@ -102,7 +99,6 @@ void RGBController_LogitechG560::SetupZones()
|
||||
G560_right_rear.leds_min = 1;
|
||||
G560_right_rear.leds_max = 1;
|
||||
G560_right_rear.leds_count = 1;
|
||||
G560_right_rear.matrix_map = NULL;
|
||||
zones.push_back(G560_right_rear);
|
||||
|
||||
led G560_right_rear_led;
|
||||
@@ -113,13 +109,6 @@ void RGBController_LogitechG560::SetupZones()
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_LogitechG560::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_LogitechG560::DeviceUpdateLEDs()
|
||||
{
|
||||
for(std::size_t led_idx = 0; led_idx < leds.size(); led_idx++)
|
||||
@@ -132,12 +121,12 @@ void RGBController_LogitechG560::DeviceUpdateLEDs()
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_LogitechG560::UpdateZoneLEDs(int /*zone*/)
|
||||
void RGBController_LogitechG560::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_LogitechG560::UpdateSingleLED(int /*led*/)
|
||||
void RGBController_LogitechG560::DeviceUpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
@@ -22,11 +22,9 @@ public:
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ RGBController_LogitechG600::RGBController_LogitechG600(LogitechG600Controller* c
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = LOGITECH_G600_MODE_BREATHING;
|
||||
@@ -75,7 +75,6 @@ void RGBController_LogitechG600::SetupZones()
|
||||
side_lights_zone.leds_min = 1;
|
||||
side_lights_zone.leds_max = 1;
|
||||
side_lights_zone.leds_count = 1;
|
||||
side_lights_zone.matrix_map = NULL;
|
||||
zones.push_back(side_lights_zone);
|
||||
|
||||
// Set up LED
|
||||
@@ -86,29 +85,22 @@ void RGBController_LogitechG600::SetupZones()
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_LogitechG600::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Currently does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_LogitechG600::DeviceUpdateLEDs()
|
||||
{
|
||||
controller->SetMode(modes[active_mode].value, modes[active_mode].speed, GetLED(0));
|
||||
controller->SetMode(modes[active_mode].value, modes[active_mode].speed, colors[0]);
|
||||
}
|
||||
|
||||
void RGBController_LogitechG600::UpdateZoneLEDs(int /*zone*/)
|
||||
void RGBController_LogitechG600::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_LogitechG600::UpdateSingleLED(int /*led*/)
|
||||
void RGBController_LogitechG600::DeviceUpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_LogitechG600::DeviceUpdateMode()
|
||||
{
|
||||
controller->SetMode(modes[active_mode].value, modes[active_mode].speed, GetLED(0));
|
||||
controller->SetMode(modes[active_mode].value, modes[active_mode].speed, colors[0]);
|
||||
}
|
||||
|
||||
@@ -22,11 +22,9 @@ public:
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
|
||||
@@ -241,17 +241,6 @@ RGBController_LogitechG810::RGBController_LogitechG810(LogitechG810Controller* c
|
||||
|
||||
RGBController_LogitechG810::~RGBController_LogitechG810()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Delete the matrix map |
|
||||
\*---------------------------------------------------------*/
|
||||
for(unsigned int zone_index = 0; zone_index < zones.size(); zone_index++)
|
||||
{
|
||||
if(zones[zone_index].matrix_map != NULL)
|
||||
{
|
||||
delete zones[zone_index].matrix_map;
|
||||
}
|
||||
}
|
||||
|
||||
delete controller;
|
||||
}
|
||||
|
||||
@@ -272,14 +261,7 @@ void RGBController_LogitechG810::SetupZones()
|
||||
|
||||
if(zone_types[zone_idx] == ZONE_TYPE_MATRIX)
|
||||
{
|
||||
new_zone.matrix_map = new matrix_map_type;
|
||||
new_zone.matrix_map->height = 7;
|
||||
new_zone.matrix_map->width = 23;
|
||||
new_zone.matrix_map->map = (unsigned int *)&matrix_map;
|
||||
}
|
||||
else
|
||||
{
|
||||
new_zone.matrix_map = NULL;
|
||||
new_zone.matrix_map.Set(7, 23, (unsigned int *)&matrix_map);
|
||||
}
|
||||
|
||||
zones.push_back(new_zone);
|
||||
@@ -298,13 +280,6 @@ void RGBController_LogitechG810::SetupZones()
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_LogitechG810::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_LogitechG810::DeviceUpdateLEDs()
|
||||
{
|
||||
#define MAX_FRAMES_PER_PACKET 0x0E
|
||||
@@ -352,12 +327,12 @@ void RGBController_LogitechG810::DeviceUpdateLEDs()
|
||||
controller->Commit();
|
||||
}
|
||||
|
||||
void RGBController_LogitechG810::UpdateZoneLEDs(int /*zone*/)
|
||||
void RGBController_LogitechG810::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_LogitechG810::UpdateSingleLED(int led)
|
||||
void RGBController_LogitechG810::DeviceUpdateSingleLED(int led)
|
||||
{
|
||||
unsigned char frame[4];
|
||||
unsigned char zone;
|
||||
@@ -383,7 +358,7 @@ void RGBController_LogitechG810::DeviceUpdateMode()
|
||||
\*---------------------------------------------------------*/
|
||||
if(active_mode == 0xFFFF)
|
||||
{
|
||||
UpdateLEDs();
|
||||
UpdateLEDsInternal();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,11 +22,9 @@ public:
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
|
||||
@@ -246,17 +246,6 @@ RGBController_LogitechG815::RGBController_LogitechG815(LogitechG815Controller* c
|
||||
|
||||
RGBController_LogitechG815::~RGBController_LogitechG815()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Delete the matrix map |
|
||||
\*---------------------------------------------------------*/
|
||||
for(unsigned int zone_index = 0; zone_index < zones.size(); zone_index++)
|
||||
{
|
||||
if(zones[zone_index].matrix_map != NULL)
|
||||
{
|
||||
delete zones[zone_index].matrix_map;
|
||||
}
|
||||
}
|
||||
|
||||
delete controller;
|
||||
}
|
||||
|
||||
@@ -277,14 +266,7 @@ void RGBController_LogitechG815::SetupZones()
|
||||
|
||||
if(zone_types[zone_idx] == ZONE_TYPE_MATRIX)
|
||||
{
|
||||
new_zone.matrix_map = new matrix_map_type;
|
||||
new_zone.matrix_map->height = 7;
|
||||
new_zone.matrix_map->width = 27;
|
||||
new_zone.matrix_map->map = (unsigned int *)&matrix_map;
|
||||
}
|
||||
else
|
||||
{
|
||||
new_zone.matrix_map = NULL;
|
||||
new_zone.matrix_map.Set(7, 27, (unsigned int *)&matrix_map);
|
||||
}
|
||||
|
||||
zones.push_back(new_zone);
|
||||
@@ -302,13 +284,6 @@ void RGBController_LogitechG815::SetupZones()
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_LogitechG815::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_LogitechG815::DeviceUpdateLEDs()
|
||||
{
|
||||
std::map<RGBColor, std::vector<char>> ledsByColors;
|
||||
@@ -490,12 +465,12 @@ void RGBController_LogitechG815::DeviceUpdateLEDs()
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_LogitechG815::UpdateZoneLEDs(int /*zone*/)
|
||||
void RGBController_LogitechG815::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_LogitechG815::UpdateSingleLED(int /*led*/)
|
||||
void RGBController_LogitechG815::DeviceUpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
@@ -22,11 +22,9 @@ public:
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
|
||||
@@ -242,17 +242,6 @@ RGBController_LogitechG910::RGBController_LogitechG910(LogitechG910Controller* c
|
||||
|
||||
RGBController_LogitechG910::~RGBController_LogitechG910()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Delete the matrix map |
|
||||
\*---------------------------------------------------------*/
|
||||
for(unsigned int zone_index = 0; zone_index < zones.size(); zone_index++)
|
||||
{
|
||||
if(zones[zone_index].matrix_map != NULL)
|
||||
{
|
||||
delete zones[zone_index].matrix_map;
|
||||
}
|
||||
}
|
||||
|
||||
delete controller;
|
||||
}
|
||||
|
||||
@@ -273,14 +262,7 @@ void RGBController_LogitechG910::SetupZones()
|
||||
|
||||
if(zone_types[zone_idx] == ZONE_TYPE_MATRIX)
|
||||
{
|
||||
new_zone.matrix_map = new matrix_map_type;
|
||||
new_zone.matrix_map->height = 8;
|
||||
new_zone.matrix_map->width = 24;
|
||||
new_zone.matrix_map->map = (unsigned int *)&matrix_map;
|
||||
}
|
||||
else
|
||||
{
|
||||
new_zone.matrix_map = NULL;
|
||||
new_zone.matrix_map.Set(8, 24, (unsigned int *)&matrix_map);
|
||||
}
|
||||
|
||||
zones.push_back(new_zone);
|
||||
@@ -299,13 +281,6 @@ void RGBController_LogitechG910::SetupZones()
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_LogitechG910::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_LogitechG910::DeviceUpdateLEDs()
|
||||
{
|
||||
#define MAX_FRAMES_PER_PACKET 0x0E
|
||||
@@ -353,12 +328,12 @@ void RGBController_LogitechG910::DeviceUpdateLEDs()
|
||||
controller->Commit();
|
||||
}
|
||||
|
||||
void RGBController_LogitechG910::UpdateZoneLEDs(int /*zone*/)
|
||||
void RGBController_LogitechG910::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_LogitechG910::UpdateSingleLED(int led)
|
||||
void RGBController_LogitechG910::DeviceUpdateSingleLED(int led)
|
||||
{
|
||||
unsigned char frame[4];
|
||||
unsigned char zone;
|
||||
@@ -384,7 +359,7 @@ void RGBController_LogitechG910::DeviceUpdateMode()
|
||||
\*---------------------------------------------------------*/
|
||||
if(active_mode == 0xFFFF)
|
||||
{
|
||||
UpdateLEDs();
|
||||
UpdateLEDsInternal();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,11 +22,9 @@ public:
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
|
||||
@@ -381,17 +381,6 @@ RGBController_LogitechG915::RGBController_LogitechG915(LogitechG915Controller* c
|
||||
|
||||
RGBController_LogitechG915::~RGBController_LogitechG915()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Delete the matrix map |
|
||||
\*---------------------------------------------------------*/
|
||||
for(unsigned int zone_index = 0; zone_index < zones.size(); zone_index++)
|
||||
{
|
||||
if(zones[zone_index].matrix_map != NULL)
|
||||
{
|
||||
delete zones[zone_index].matrix_map;
|
||||
}
|
||||
}
|
||||
|
||||
delete controller;
|
||||
}
|
||||
|
||||
@@ -413,24 +402,15 @@ void RGBController_LogitechG915::SetupZones()
|
||||
|
||||
if(zone_types[zone_idx] == ZONE_TYPE_MATRIX)
|
||||
{
|
||||
new_zone.matrix_map = new matrix_map_type;
|
||||
if(is_tkl)
|
||||
{
|
||||
new_zone.matrix_map->map = (unsigned int *)&matrix_map_tkl;
|
||||
new_zone.matrix_map->height = 7;
|
||||
new_zone.matrix_map->width = 20;
|
||||
new_zone.matrix_map.Set(7, 20, (unsigned int *)&matrix_map_tkl);
|
||||
}
|
||||
else
|
||||
{
|
||||
new_zone.matrix_map->map = (unsigned int *)&matrix_map;
|
||||
new_zone.matrix_map->height = 7;
|
||||
new_zone.matrix_map->width = 27;
|
||||
new_zone.matrix_map.Set(7, 27, (unsigned int *)&matrix_map);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
new_zone.matrix_map = NULL;
|
||||
}
|
||||
|
||||
zones.push_back(new_zone);
|
||||
|
||||
@@ -447,13 +427,6 @@ void RGBController_LogitechG915::SetupZones()
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_LogitechG915::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_LogitechG915::DeviceUpdateLEDs()
|
||||
{
|
||||
std::map<RGBColor, std::vector<char>> ledsByColors;
|
||||
@@ -608,12 +581,12 @@ void RGBController_LogitechG915::DeviceUpdateLEDs()
|
||||
controller->Commit();
|
||||
}
|
||||
|
||||
void RGBController_LogitechG915::UpdateZoneLEDs(int /*zone*/)
|
||||
void RGBController_LogitechG915::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_LogitechG915::UpdateSingleLED(int /*led*/)
|
||||
void RGBController_LogitechG915::DeviceUpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
@@ -22,11 +22,9 @@ public:
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ void RGBController_LogitechG933::SetupZones()
|
||||
G933_logo.leds_min = 1;
|
||||
G933_logo.leds_max = 1;
|
||||
G933_logo.leds_count = 1;
|
||||
G933_logo.matrix_map = NULL;
|
||||
zones.push_back(G933_logo);
|
||||
|
||||
led G933_logo_led;
|
||||
@@ -72,7 +71,6 @@ void RGBController_LogitechG933::SetupZones()
|
||||
G933_strip.leds_min = 1;
|
||||
G933_strip.leds_max = 1;
|
||||
G933_strip.leds_count = 1;
|
||||
G933_strip.matrix_map = NULL;
|
||||
zones.push_back(G933_strip);
|
||||
|
||||
led G933_strip_led;
|
||||
@@ -83,13 +81,6 @@ void RGBController_LogitechG933::SetupZones()
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_LogitechG933::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_LogitechG933::DeviceUpdateLEDs()
|
||||
{
|
||||
for(std::size_t led_idx = 0; led_idx < leds.size(); led_idx++)
|
||||
@@ -102,12 +93,12 @@ void RGBController_LogitechG933::DeviceUpdateLEDs()
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_LogitechG933::UpdateZoneLEDs(int /*zone*/)
|
||||
void RGBController_LogitechG933::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_LogitechG933::UpdateSingleLED(int /*led*/)
|
||||
void RGBController_LogitechG933::DeviceUpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
@@ -22,11 +22,9 @@ public:
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
|
||||
@@ -96,7 +96,6 @@ void RGBController_LogitechGLightsync::SetupZones()
|
||||
GLightsync_primary_zone.leds_min = 1;
|
||||
GLightsync_primary_zone.leds_max = 1;
|
||||
GLightsync_primary_zone.leds_count = 1;
|
||||
GLightsync_primary_zone.matrix_map = NULL;
|
||||
zones.push_back(GLightsync_primary_zone);
|
||||
|
||||
led GLightsync_primary_led;
|
||||
@@ -109,7 +108,6 @@ void RGBController_LogitechGLightsync::SetupZones()
|
||||
GLightsync_logo_zone.leds_min = 1;
|
||||
GLightsync_logo_zone.leds_max = 1;
|
||||
GLightsync_logo_zone.leds_count = 1;
|
||||
GLightsync_logo_zone.matrix_map = NULL;
|
||||
zones.push_back(GLightsync_logo_zone);
|
||||
|
||||
led GLightsync_logo_led;
|
||||
@@ -119,20 +117,13 @@ void RGBController_LogitechGLightsync::SetupZones()
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_LogitechGLightsync::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_LogitechGLightsync::DeviceUpdateLEDs()
|
||||
{
|
||||
UpdateZoneLEDs(0);
|
||||
UpdateZoneLEDs(1);
|
||||
DeviceUpdateZoneLEDs(0);
|
||||
DeviceUpdateZoneLEDs(1);
|
||||
}
|
||||
|
||||
void RGBController_LogitechGLightsync::UpdateZoneLEDs(int zone)
|
||||
void RGBController_LogitechGLightsync::DeviceUpdateZoneLEDs(int zone)
|
||||
{
|
||||
unsigned char red = RGBGetRValue(colors[zone]);
|
||||
unsigned char grn = RGBGetGValue(colors[zone]);
|
||||
@@ -146,9 +137,9 @@ void RGBController_LogitechGLightsync::UpdateZoneLEDs(int zone)
|
||||
controller->UpdateMouseLED(temp_mode, modes[active_mode].speed, zone, red, grn, blu, modes[active_mode].brightness);
|
||||
}
|
||||
|
||||
void RGBController_LogitechGLightsync::UpdateSingleLED(int led)
|
||||
void RGBController_LogitechGLightsync::DeviceUpdateSingleLED(int led)
|
||||
{
|
||||
UpdateZoneLEDs(led);
|
||||
DeviceUpdateZoneLEDs(led);
|
||||
}
|
||||
|
||||
void RGBController_LogitechGLightsync::DeviceUpdateMode()
|
||||
|
||||
@@ -22,11 +22,9 @@ public:
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
|
||||
@@ -96,7 +96,6 @@ void RGBController_LogitechGLightsync1zone::SetupZones()
|
||||
GLightsync_logo_zone.leds_min = 1;
|
||||
GLightsync_logo_zone.leds_max = 1;
|
||||
GLightsync_logo_zone.leds_count = 1;
|
||||
GLightsync_logo_zone.matrix_map = NULL;
|
||||
zones.push_back(GLightsync_logo_zone);
|
||||
|
||||
led GLightsync_logo_led;
|
||||
@@ -106,19 +105,12 @@ void RGBController_LogitechGLightsync1zone::SetupZones()
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_LogitechGLightsync1zone::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_LogitechGLightsync1zone::DeviceUpdateLEDs()
|
||||
{
|
||||
UpdateZoneLEDs(0);
|
||||
DeviceUpdateZoneLEDs(0);
|
||||
}
|
||||
|
||||
void RGBController_LogitechGLightsync1zone::UpdateZoneLEDs(int zone)
|
||||
void RGBController_LogitechGLightsync1zone::DeviceUpdateZoneLEDs(int zone)
|
||||
{
|
||||
unsigned char red = RGBGetRValue(colors[zone]);
|
||||
unsigned char grn = RGBGetGValue(colors[zone]);
|
||||
@@ -132,9 +124,9 @@ void RGBController_LogitechGLightsync1zone::UpdateZoneLEDs(int zone)
|
||||
controller->UpdateMouseLED(temp_mode, modes[active_mode].speed, zone, red, grn, blu, modes[active_mode].brightness);
|
||||
}
|
||||
|
||||
void RGBController_LogitechGLightsync1zone::UpdateSingleLED(int led)
|
||||
void RGBController_LogitechGLightsync1zone::DeviceUpdateSingleLED(int led)
|
||||
{
|
||||
UpdateZoneLEDs(led);
|
||||
DeviceUpdateZoneLEDs(led);
|
||||
}
|
||||
|
||||
void RGBController_LogitechGLightsync1zone::DeviceUpdateMode()
|
||||
|
||||
@@ -22,11 +22,9 @@ public:
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
|
||||
@@ -90,7 +90,6 @@ void RGBController_LogitechGPowerPlay::SetupZones()
|
||||
GPowerPlay_logo_zone.leds_min = 1;
|
||||
GPowerPlay_logo_zone.leds_max = 1;
|
||||
GPowerPlay_logo_zone.leds_count = 1;
|
||||
GPowerPlay_logo_zone.matrix_map = NULL;
|
||||
zones.push_back(GPowerPlay_logo_zone);
|
||||
|
||||
led GPowerPlay_logo_led;
|
||||
@@ -100,19 +99,12 @@ void RGBController_LogitechGPowerPlay::SetupZones()
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_LogitechGPowerPlay::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_LogitechGPowerPlay::DeviceUpdateLEDs()
|
||||
{
|
||||
UpdateZoneLEDs(0);
|
||||
DeviceUpdateZoneLEDs(0);
|
||||
}
|
||||
|
||||
void RGBController_LogitechGPowerPlay::UpdateZoneLEDs(int zone)
|
||||
void RGBController_LogitechGPowerPlay::DeviceUpdateZoneLEDs(int zone)
|
||||
{
|
||||
unsigned char red = RGBGetRValue(colors[zone]);
|
||||
unsigned char grn = RGBGetGValue(colors[zone]);
|
||||
@@ -126,9 +118,9 @@ void RGBController_LogitechGPowerPlay::UpdateZoneLEDs(int zone)
|
||||
controller->UpdateMouseLED(temp_mode, modes[active_mode].speed, zone, red, grn, blu, /* Brightness */ 0x64);
|
||||
}
|
||||
|
||||
void RGBController_LogitechGPowerPlay::UpdateSingleLED(int led)
|
||||
void RGBController_LogitechGPowerPlay::DeviceUpdateSingleLED(int led)
|
||||
{
|
||||
UpdateZoneLEDs(led);
|
||||
DeviceUpdateZoneLEDs(led);
|
||||
}
|
||||
|
||||
void RGBController_LogitechGPowerPlay::DeviceUpdateMode()
|
||||
|
||||
@@ -22,11 +22,9 @@ public:
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
|
||||
@@ -218,17 +218,6 @@ RGBController_LogitechGProKeyboard::RGBController_LogitechGProKeyboard(LogitechG
|
||||
|
||||
RGBController_LogitechGProKeyboard::~RGBController_LogitechGProKeyboard()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Delete the matrix map |
|
||||
\*---------------------------------------------------------*/
|
||||
for(unsigned int zone_index = 0; zone_index < zones.size(); zone_index++)
|
||||
{
|
||||
if(zones[zone_index].matrix_map != NULL)
|
||||
{
|
||||
delete zones[zone_index].matrix_map;
|
||||
}
|
||||
}
|
||||
|
||||
delete controller;
|
||||
}
|
||||
|
||||
@@ -249,14 +238,7 @@ void RGBController_LogitechGProKeyboard::SetupZones()
|
||||
|
||||
if(zone_types[zone_idx] == ZONE_TYPE_MATRIX)
|
||||
{
|
||||
new_zone.matrix_map = new matrix_map_type;
|
||||
new_zone.matrix_map->height = 7;
|
||||
new_zone.matrix_map->width = 19;
|
||||
new_zone.matrix_map->map = (unsigned int *)&matrix_map;
|
||||
}
|
||||
else
|
||||
{
|
||||
new_zone.matrix_map = NULL;
|
||||
new_zone.matrix_map.Set(7, 19, (unsigned int *)&matrix_map);
|
||||
}
|
||||
|
||||
zones.push_back(new_zone);
|
||||
@@ -275,13 +257,6 @@ void RGBController_LogitechGProKeyboard::SetupZones()
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_LogitechGProKeyboard::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_LogitechGProKeyboard::DeviceUpdateLEDs()
|
||||
{
|
||||
#define MAX_FRAMES_PER_PACKET 0x0E
|
||||
@@ -329,12 +304,12 @@ void RGBController_LogitechGProKeyboard::DeviceUpdateLEDs()
|
||||
controller->Commit();
|
||||
}
|
||||
|
||||
void RGBController_LogitechGProKeyboard::UpdateZoneLEDs(int /*zone*/)
|
||||
void RGBController_LogitechGProKeyboard::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_LogitechGProKeyboard::UpdateSingleLED(int led)
|
||||
void RGBController_LogitechGProKeyboard::DeviceUpdateSingleLED(int led)
|
||||
{
|
||||
unsigned char frame[4];
|
||||
unsigned char zone;
|
||||
@@ -360,7 +335,7 @@ void RGBController_LogitechGProKeyboard::DeviceUpdateMode()
|
||||
\*---------------------------------------------------------*/
|
||||
if(active_mode == 0xFFFF)
|
||||
{
|
||||
UpdateLEDs();
|
||||
UpdateLEDsInternal();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,11 +22,9 @@ public:
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
|
||||
@@ -196,7 +196,6 @@ void RGBController_LogitechLightspeed::SetupZones()
|
||||
Lightspeed_logo_zone.leds_min = 1;
|
||||
Lightspeed_logo_zone.leds_max = 1;
|
||||
Lightspeed_logo_zone.leds_count = 1;
|
||||
Lightspeed_logo_zone.matrix_map = NULL;
|
||||
zones.push_back(Lightspeed_logo_zone);
|
||||
|
||||
Lightspeed_logo_led.value = (unsigned int)i;
|
||||
@@ -207,22 +206,15 @@ void RGBController_LogitechLightspeed::SetupZones()
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_LogitechLightspeed::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_LogitechLightspeed::DeviceUpdateLEDs()
|
||||
{
|
||||
for(std::vector<led>::iterator led_index = leds.begin(); led_index != leds.end(); led_index++)
|
||||
{
|
||||
UpdateZoneLEDs(led_index->value);
|
||||
DeviceUpdateZoneLEDs(led_index->value);
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_LogitechLightspeed::UpdateZoneLEDs(int zone)
|
||||
void RGBController_LogitechLightspeed::DeviceUpdateZoneLEDs(int zone)
|
||||
{
|
||||
unsigned char red = RGBGetRValue(colors[zone]);
|
||||
unsigned char grn = RGBGetGValue(colors[zone]);
|
||||
@@ -231,9 +223,9 @@ void RGBController_LogitechLightspeed::UpdateZoneLEDs(int zone)
|
||||
controller->SendMouseMode(modes[active_mode].value, modes[active_mode].speed, zone, red, grn, blu, modes[active_mode].brightness);
|
||||
}
|
||||
|
||||
void RGBController_LogitechLightspeed::UpdateSingleLED(int led)
|
||||
void RGBController_LogitechLightspeed::DeviceUpdateSingleLED(int led)
|
||||
{
|
||||
UpdateZoneLEDs(led);
|
||||
DeviceUpdateZoneLEDs(led);
|
||||
}
|
||||
|
||||
void RGBController_LogitechLightspeed::DeviceUpdateMode()
|
||||
|
||||
@@ -22,11 +22,9 @@ public:
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
|
||||
@@ -61,7 +61,6 @@ void RGBController_LogitechX56::SetupZones()
|
||||
x56_zone.leds_min = 1;
|
||||
x56_zone.leds_max = 1;
|
||||
x56_zone.leds_count = 1;
|
||||
x56_zone.matrix_map = NULL;
|
||||
zones.push_back(x56_zone);
|
||||
|
||||
led x56_led;
|
||||
@@ -71,19 +70,12 @@ void RGBController_LogitechX56::SetupZones()
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_LogitechX56::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_LogitechX56::DeviceUpdateLEDs()
|
||||
{
|
||||
controller->SetColor(colors[0], modes[active_mode].brightness);
|
||||
}
|
||||
|
||||
void RGBController_LogitechX56::UpdateZoneLEDs(int /*zone*/)
|
||||
void RGBController_LogitechX56::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Packet expects both LEDs |
|
||||
@@ -91,7 +83,7 @@ void RGBController_LogitechX56::UpdateZoneLEDs(int /*zone*/)
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_LogitechX56::UpdateSingleLED(int /*led*/)
|
||||
void RGBController_LogitechX56::DeviceUpdateSingleLED(int /*led*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Packet expects both LEDs |
|
||||
|
||||
@@ -22,11 +22,9 @@ public:
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
void DeviceSaveMode();
|
||||
|
||||
Reference in New Issue
Block a user