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 fa20f4319a
commit dfd8656d9f
655 changed files with 9459 additions and 9022 deletions

View File

@@ -54,7 +54,6 @@ void RGBController_CreativeSoundBlasterAE5::SetupZones()
internal_zone.leds_min = 5;
internal_zone.leds_max = 5;
internal_zone.leds_count = 5;
internal_zone.matrix_map = NULL;
zones.push_back(internal_zone);
for(unsigned int led_idx = 0; led_idx < 5; led_idx++)
@@ -70,7 +69,6 @@ void RGBController_CreativeSoundBlasterAE5::SetupZones()
external_zone.leds_min = 0;
external_zone.leds_max = 100;
external_zone.leds_count = controller->GetExternalLEDCount();
external_zone.matrix_map = NULL;
zones.push_back(external_zone);
for(unsigned int led_idx = 0; led_idx < controller->GetExternalLEDCount(); led_idx++)
@@ -83,7 +81,7 @@ void RGBController_CreativeSoundBlasterAE5::SetupZones()
SetupColors();
}
void RGBController_CreativeSoundBlasterAE5::ResizeZone(int zone, int new_size)
void RGBController_CreativeSoundBlasterAE5::DeviceResizeZone(int zone, int new_size)
{
if(zone == 1) // External zone
{
@@ -134,7 +132,7 @@ void RGBController_CreativeSoundBlasterAE5::DeviceUpdateLEDs()
UpdateLEDRange(0, controller->GetLEDCount());
}
void RGBController_CreativeSoundBlasterAE5::UpdateZoneLEDs(int zone)
void RGBController_CreativeSoundBlasterAE5::DeviceUpdateZoneLEDs(int zone)
{
if(zone >= 0 && zone < (int)zones.size())
{
@@ -149,7 +147,7 @@ void RGBController_CreativeSoundBlasterAE5::UpdateZoneLEDs(int zone)
}
}
void RGBController_CreativeSoundBlasterAE5::UpdateSingleLED(int led)
void RGBController_CreativeSoundBlasterAE5::DeviceUpdateSingleLED(int led)
{
/*-------------------------------------------------------------*\
| Find which zone this LED belongs to and update only that zone |

View File

@@ -20,15 +20,15 @@ public:
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceResizeZone(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();
private:
CreativeSoundBlasterAE5ControllerBase* controller;
void UpdateLEDRange(unsigned int start_led, unsigned int led_count);
};
};

View File

@@ -57,7 +57,6 @@ void RGBController_CreativeSoundBlasterXG6::SetupZones()
logo_zone.leds_min = 1;
logo_zone.leds_max = 1;
logo_zone.leds_count = 1;
logo_zone.matrix_map = NULL;
zones.push_back(logo_zone);
led logo_led;
@@ -67,13 +66,6 @@ void RGBController_CreativeSoundBlasterXG6::SetupZones()
SetupColors();
}
void RGBController_CreativeSoundBlasterXG6::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_CreativeSoundBlasterXG6::DeviceUpdateLEDs()
{
unsigned char red = RGBGetRValue(colors[0]);
@@ -83,12 +75,12 @@ void RGBController_CreativeSoundBlasterXG6::DeviceUpdateLEDs()
controller->SetLedColor(red, grn, blu, modes[active_mode].brightness);
}
void RGBController_CreativeSoundBlasterXG6::UpdateZoneLEDs(int /*zone*/)
void RGBController_CreativeSoundBlasterXG6::DeviceUpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_CreativeSoundBlasterXG6::UpdateSingleLED(int /*led*/)
void RGBController_CreativeSoundBlasterXG6::DeviceUpdateSingleLED(int /*led*/)
{
DeviceUpdateLEDs();
}

View File

@@ -23,11 +23,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();