mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-02-06 21:31:22 -05: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:
@@ -187,11 +187,7 @@ void RGBController_BloodyB820R::SetupZones()
|
||||
KB_zone.leds_min = BLOODY_B820R_KEYCOUNT;
|
||||
KB_zone.leds_max = BLOODY_B820R_KEYCOUNT;
|
||||
KB_zone.leds_count = BLOODY_B820R_KEYCOUNT;
|
||||
|
||||
KB_zone.matrix_map = new matrix_map_type;
|
||||
KB_zone.matrix_map->height = 6;
|
||||
KB_zone.matrix_map->width = 21;
|
||||
KB_zone.matrix_map->map = (unsigned int *)&matrix_map;
|
||||
KB_zone.matrix_map.Set(6, 21, (unsigned int *)&matrix_map);
|
||||
zones.push_back(KB_zone);
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
@@ -214,20 +210,12 @@ void RGBController_BloodyB820R::SetupZones()
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_BloodyB820R::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
|
||||
void RGBController_BloodyB820R::DeviceUpdateLEDs()
|
||||
{
|
||||
controller->SetLEDDirect(colors);
|
||||
}
|
||||
|
||||
void RGBController_BloodyB820R::UpdateZoneLEDs(int zone)
|
||||
void RGBController_BloodyB820R::DeviceUpdateZoneLEDs(int zone)
|
||||
{
|
||||
std::vector<RGBColor> colour;
|
||||
|
||||
@@ -239,7 +227,7 @@ void RGBController_BloodyB820R::UpdateZoneLEDs(int zone)
|
||||
controller->SetLEDDirect(colour);
|
||||
}
|
||||
|
||||
void RGBController_BloodyB820R::UpdateSingleLED(int led)
|
||||
void RGBController_BloodyB820R::DeviceUpdateSingleLED(int led)
|
||||
{
|
||||
std::vector<RGBColor> colour;
|
||||
colour.push_back(colors[led]);
|
||||
|
||||
@@ -22,11 +22,10 @@ public:
|
||||
~RGBController_BloodyB820R();
|
||||
|
||||
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();
|
||||
|
||||
|
||||
@@ -134,7 +134,6 @@ void RGBController_BloodyMouse::SetupZones()
|
||||
new_zone.leds_max = new_zone.leds_min;
|
||||
new_zone.leds_count = new_zone.leds_min;
|
||||
new_zone.type = bool_single ? ZONE_TYPE_SINGLE : ZONE_TYPE_LINEAR;
|
||||
new_zone.matrix_map = NULL;
|
||||
zones.push_back(new_zone);
|
||||
|
||||
for(unsigned int lp_idx = 0; lp_idx < zones[zone_idx].leds_count; lp_idx++)
|
||||
@@ -160,13 +159,6 @@ void RGBController_BloodyMouse::SetupZones()
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_BloodyMouse::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_BloodyMouse::DeviceUpdateLEDs()
|
||||
{
|
||||
std::vector<RGBColor> colour;
|
||||
@@ -179,12 +171,12 @@ void RGBController_BloodyMouse::DeviceUpdateLEDs()
|
||||
controller->SetLedsDirect(colour);
|
||||
}
|
||||
|
||||
void RGBController_BloodyMouse::UpdateZoneLEDs(int /*zone*/)
|
||||
void RGBController_BloodyMouse::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_BloodyMouse::UpdateSingleLED(int /*led*/)
|
||||
void RGBController_BloodyMouse::DeviceUpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
@@ -30,11 +30,10 @@ public:
|
||||
~RGBController_BloodyMouse();
|
||||
|
||||
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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user