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:
Adam Honse
2025-09-23 20:38:37 -05:00
parent 6deaf2f4fd
commit fdaf2eee6c
657 changed files with 9060 additions and 8801 deletions

View File

@@ -289,7 +289,7 @@ int RGBController_ENESMBus::GetDeviceMode()
void RGBController_ENESMBus::DeviceUpdateLEDs()
{
if(GetMode() == 0)
if(GetActiveMode() == 0)
{
controller->SetAllColorsDirect(&colors[0]);
}
@@ -300,7 +300,7 @@ void RGBController_ENESMBus::DeviceUpdateLEDs()
}
void RGBController_ENESMBus::UpdateZoneLEDs(int zone)
void RGBController_ENESMBus::DeviceUpdateZoneLEDs(int zone)
{
for(std::size_t led_idx = 0; led_idx < zones[zone].leds_count; led_idx++)
{
@@ -310,7 +310,7 @@ void RGBController_ENESMBus::UpdateZoneLEDs(int zone)
unsigned char grn = RGBGetGValue(color);
unsigned char blu = RGBGetBValue(color);
if(GetMode() == 0)
if(GetActiveMode() == 0)
{
controller->SetLEDColorDirect(led, red, grn, blu);
}
@@ -321,14 +321,14 @@ void RGBController_ENESMBus::UpdateZoneLEDs(int zone)
}
}
void RGBController_ENESMBus::UpdateSingleLED(int led)
void RGBController_ENESMBus::DeviceUpdateSingleLED(int led)
{
RGBColor color = colors[led];
unsigned char red = RGBGetRValue(color);
unsigned char grn = RGBGetGValue(color);
unsigned char blu = RGBGetBValue(color);
if(GetMode() == 0)
if(GetActiveMode() == 0)
{
controller->SetLEDColorDirect(led, red, grn, blu);
}
@@ -418,8 +418,6 @@ void RGBController_ENESMBus::SetupZones()
{
zones[zone_idx].type = ZONE_TYPE_SINGLE;
}
zones[zone_idx].matrix_map = NULL;
}
/*---------------------------------------------------------*\
@@ -445,13 +443,6 @@ void RGBController_ENESMBus::SetupZones()
SetupColors();
}
void RGBController_ENESMBus::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_ENESMBus::DeviceUpdateMode()
{
if (modes[active_mode].value == 0xFFFF)

View File

@@ -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();