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

@@ -28,7 +28,7 @@ int RGBController_MSIGPU::GetDeviceMode()
return(active_mode);
}
int RGBController_MSIGPU::GetModeSpeed()
int RGBController_MSIGPU::GetSpeed()
{
unsigned char mode_speed = controller->MSIGPURegisterRead(MSI_GPU_REG_SPEED);
@@ -318,7 +318,7 @@ RGBController_MSIGPU::RGBController_MSIGPU(MSIGPUController * controller_ptr)
SetupZones();
active_mode = GetDeviceMode();
modes[active_mode].speed = GetModeSpeed();
modes[active_mode].speed = GetSpeed();
modes[active_mode].brightness = controller->MSIGPURegisterRead(MSI_GPU_REG_BRIGHTNESS) / MSI_GPU_BRIGHTNESS_MULTI;
}
@@ -338,7 +338,6 @@ void RGBController_MSIGPU::SetupZones()
msi_gpu_zone.leds_min = 1;
msi_gpu_zone.leds_max = 1;
msi_gpu_zone.leds_count = 3;
msi_gpu_zone.matrix_map = NULL;
zones.push_back(msi_gpu_zone);
/*---------------------------------------------------------*\
@@ -374,13 +373,6 @@ void RGBController_MSIGPU::SetupZones()
colors[2] = ToRGBColor(r3, g3, b3);
}
void RGBController_MSIGPU::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
bool RGBController_MSIGPU::TimeToSend()
{
/*-----------------------------------------------------*\
@@ -413,12 +405,12 @@ void RGBController_MSIGPU::DeviceUpdateLEDs()
}
}
void RGBController_MSIGPU::UpdateZoneLEDs(int /*zone*/)
void RGBController_MSIGPU::DeviceUpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_MSIGPU::UpdateSingleLED(int /*led*/)
void RGBController_MSIGPU::DeviceUpdateSingleLED(int /*led*/)
{
DeviceUpdateLEDs();
}

View File

@@ -19,11 +19,10 @@ public:
~RGBController_MSIGPU();
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();
@@ -34,5 +33,5 @@ private:
bool TimeToSend();
int GetDeviceMode();
int GetModeSpeed();
int GetSpeed();
};

View File

@@ -307,7 +307,6 @@ void RGBController_MSIGPUv2::SetupZones()
msi_gpu_zone.leds_min = 1;
msi_gpu_zone.leds_max = 1;
msi_gpu_zone.leds_count = 1;
msi_gpu_zone.matrix_map = NULL;
zones.push_back(msi_gpu_zone);
/*---------------------------------------------------------*\
@@ -343,13 +342,6 @@ void RGBController_MSIGPUv2::SetupZones()
}
void RGBController_MSIGPUv2::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_MSIGPUv2::DeviceUpdateAll(const mode& current_mode)
{
switch(current_mode.value)
@@ -464,13 +456,13 @@ void RGBController_MSIGPUv2::DeviceUpdateLEDs()
DeviceUpdateAll(modes[active_mode]);
}
void RGBController_MSIGPUv2::UpdateZoneLEDs(int /*zone*/)
void RGBController_MSIGPUv2::DeviceUpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateAll(modes[active_mode]);
}
void RGBController_MSIGPUv2::UpdateSingleLED(int /*led*/)
void RGBController_MSIGPUv2::DeviceUpdateSingleLED(int /*led*/)
{
/*---------------------------------------------------------*\
| This device does not support updating single LEDs |

View File

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