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

@@ -138,7 +138,6 @@ void RGBController_MSIMysticLight112::SetupZones()
new_zone.type = ZONE_TYPE_LINEAR;
}
new_zone.matrix_map = NULL;
zones.push_back(new_zone);
}
@@ -164,14 +163,6 @@ void RGBController_MSIMysticLight112::SetupZones()
}
}
void RGBController_MSIMysticLight112::ResizeZone
(
int /*zone*/,
int /*new_size*/
)
{
}
void RGBController_MSIMysticLight112::DeviceUpdateLEDs()
{
for(std::size_t zone_idx = 0; zone_idx < zones.size(); ++zone_idx)
@@ -184,7 +175,7 @@ void RGBController_MSIMysticLight112::DeviceUpdateLEDs()
controller->Update((modes[active_mode].flags & MODE_FLAG_AUTOMATIC_SAVE) != 0);
}
void RGBController_MSIMysticLight112::UpdateZoneLEDs
void RGBController_MSIMysticLight112::DeviceUpdateZoneLEDs
(
int zone
)
@@ -196,7 +187,7 @@ void RGBController_MSIMysticLight112::UpdateZoneLEDs
controller->Update((modes[active_mode].flags & MODE_FLAG_AUTOMATIC_SAVE) != 0);
}
void RGBController_MSIMysticLight112::UpdateSingleLED
void RGBController_MSIMysticLight112::DeviceUpdateSingleLED
(
int led
)

View File

@@ -21,11 +21,10 @@ public:
~RGBController_MSIMysticLight112();
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();

View File

@@ -141,7 +141,6 @@ void RGBController_MSIMysticLight162::SetupZones()
new_zone.type = ZONE_TYPE_LINEAR;
}
new_zone.matrix_map = NULL;
zones.push_back(new_zone);
}
@@ -167,14 +166,6 @@ void RGBController_MSIMysticLight162::SetupZones()
}
}
void RGBController_MSIMysticLight162::ResizeZone
(
int /*zone*/,
int /*new_size*/
)
{
}
void RGBController_MSIMysticLight162::DeviceUpdateLEDs()
{
for(std::size_t zone_idx = 0; zone_idx < zones.size(); ++zone_idx)
@@ -187,7 +178,7 @@ void RGBController_MSIMysticLight162::DeviceUpdateLEDs()
controller->Update((modes[active_mode].flags & MODE_FLAG_AUTOMATIC_SAVE) != 0);
}
void RGBController_MSIMysticLight162::UpdateZoneLEDs
void RGBController_MSIMysticLight162::DeviceUpdateZoneLEDs
(
int zone
)
@@ -199,7 +190,7 @@ void RGBController_MSIMysticLight162::UpdateZoneLEDs
controller->Update((modes[active_mode].flags & MODE_FLAG_AUTOMATIC_SAVE) != 0);
}
void RGBController_MSIMysticLight162::UpdateSingleLED
void RGBController_MSIMysticLight162::DeviceUpdateSingleLED
(
int led
)

View File

@@ -23,11 +23,10 @@ public:
~RGBController_MSIMysticLight162();
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();

View File

@@ -199,8 +199,6 @@ void RGBController_MSIMysticLight185::SetupZones()
new_zone.type = ZONE_TYPE_LINEAR;
}
new_zone.matrix_map = NULL;
zones.push_back(new_zone);
}
}
@@ -244,7 +242,7 @@ void RGBController_MSIMysticLight185::SetupZones()
SetupColors();
}
void RGBController_MSIMysticLight185::ResizeZone
void RGBController_MSIMysticLight185::DeviceResizeZone
(
int zone,
int new_size
@@ -280,7 +278,7 @@ void RGBController_MSIMysticLight185::DeviceUpdateLEDs()
controller->Update((modes[active_mode].flags & MODE_FLAG_AUTOMATIC_SAVE) != 0);
}
void RGBController_MSIMysticLight185::UpdateZoneLEDs(int zone)
void RGBController_MSIMysticLight185::DeviceUpdateZoneLEDs(int zone)
{
for(int led_idx = zones[zone].leds_count - 1; led_idx >= 0; led_idx--)
{
@@ -289,7 +287,7 @@ void RGBController_MSIMysticLight185::UpdateZoneLEDs(int zone)
controller->Update((modes[active_mode].flags & MODE_FLAG_AUTOMATIC_SAVE) != 0);
}
void RGBController_MSIMysticLight185::UpdateSingleLED
void RGBController_MSIMysticLight185::DeviceUpdateSingleLED
(
int led
)

View File

@@ -23,11 +23,11 @@ public:
~RGBController_MSIMysticLight185();
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();
void DeviceSaveMode();

View File

@@ -44,14 +44,6 @@ RGBController_MSIMysticLight64::~RGBController_MSIMysticLight64()
delete controller;
}
void RGBController_MSIMysticLight64::ResizeZone
(
int /*zone*/,
int /*new_size*/
)
{
}
void RGBController_MSIMysticLight64::SetupZones()
{
zone msi_zone;
@@ -60,7 +52,6 @@ void RGBController_MSIMysticLight64::SetupZones()
msi_zone.leds_min = 1;
msi_zone.leds_max = 1;
msi_zone.leds_count = 1;
msi_zone.matrix_map = NULL;
zones.push_back(msi_zone);
led msi_led;
@@ -96,12 +87,12 @@ void RGBController_MSIMysticLight64::DeviceUpdateLEDs()
controller->SetMode(msi_mode, speed, brightness, num_colors, led_colors);
}
void RGBController_MSIMysticLight64::UpdateZoneLEDs(int /*zone*/)
void RGBController_MSIMysticLight64::DeviceUpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_MSIMysticLight64::UpdateSingleLED(int /*led*/)
void RGBController_MSIMysticLight64::DeviceUpdateSingleLED(int /*led*/)
{
DeviceUpdateLEDs();
}

View File

@@ -23,11 +23,10 @@ public:
~RGBController_MSIMysticLight64();
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();

View File

@@ -183,8 +183,6 @@ void RGBController_MSIMysticLight761::SetupZones()
new_zone.type = ZONE_TYPE_LINEAR;
}
new_zone.matrix_map = NULL;
zones.push_back(new_zone);
}
}
@@ -228,7 +226,7 @@ void RGBController_MSIMysticLight761::SetupZones()
}
void RGBController_MSIMysticLight761::ResizeZone
void RGBController_MSIMysticLight761::DeviceResizeZone
(
int zone,
int new_size
@@ -264,7 +262,7 @@ void RGBController_MSIMysticLight761::DeviceUpdateLEDs()
controller->Update((modes[active_mode].flags & MODE_FLAG_AUTOMATIC_SAVE) != 0);
}
void RGBController_MSIMysticLight761::UpdateZoneLEDs(int zone)
void RGBController_MSIMysticLight761::DeviceUpdateZoneLEDs(int zone)
{
for(int led_idx = zones[zone].leds_count - 1; led_idx >= 0; led_idx--)
{
@@ -273,7 +271,7 @@ void RGBController_MSIMysticLight761::UpdateZoneLEDs(int zone)
controller->Update((modes[active_mode].flags & MODE_FLAG_AUTOMATIC_SAVE) != 0);
}
void RGBController_MSIMysticLight761::UpdateSingleLED
void RGBController_MSIMysticLight761::DeviceUpdateSingleLED
(
int led
)

View File

@@ -22,11 +22,11 @@ public:
~RGBController_MSIMysticLight761();
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();
void DeviceSaveMode();