mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-02-07 05:41:13 -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:
@@ -63,7 +63,6 @@ void RGBController_SonyDS4::SetupZones()
|
||||
new_zone->leds_min = 1;
|
||||
new_zone->leds_max = 1;
|
||||
new_zone->leds_count = 1;
|
||||
new_zone->matrix_map = NULL;
|
||||
|
||||
new_led->name = "Controller LED";
|
||||
|
||||
@@ -75,13 +74,6 @@ void RGBController_SonyDS4::SetupZones()
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_SonyDS4::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_SonyDS4::DeviceUpdateLEDs()
|
||||
{
|
||||
unsigned char red = char(RGBGetRValue(colors[0]));
|
||||
@@ -90,12 +82,12 @@ void RGBController_SonyDS4::DeviceUpdateLEDs()
|
||||
controller->SetColors(red, green, blue);
|
||||
}
|
||||
|
||||
void RGBController_SonyDS4::UpdateZoneLEDs(int /*zone*/)
|
||||
void RGBController_SonyDS4::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_SonyDS4::UpdateSingleLED(int /*led*/)
|
||||
void RGBController_SonyDS4::DeviceUpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
@@ -21,11 +21,10 @@ public:
|
||||
~RGBController_SonyDS4();
|
||||
|
||||
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();
|
||||
|
||||
|
||||
@@ -90,7 +90,6 @@ void RGBController_SonyDualSense::SetupZones()
|
||||
lightbar.leds_min = SONY_DUALSENSE_LIGHTBAR_LED_COUNT;
|
||||
lightbar.leds_max = SONY_DUALSENSE_LIGHTBAR_LED_COUNT;
|
||||
lightbar.leds_count = SONY_DUALSENSE_LIGHTBAR_LED_COUNT;
|
||||
lightbar.matrix_map = NULL;
|
||||
zones.push_back(lightbar);
|
||||
|
||||
zone playerleds;
|
||||
@@ -99,7 +98,6 @@ void RGBController_SonyDualSense::SetupZones()
|
||||
playerleds.leds_min = SONY_DUALSENSE_PLAYER_LED_COUNT;
|
||||
playerleds.leds_max = SONY_DUALSENSE_PLAYER_LED_COUNT;
|
||||
playerleds.leds_count = SONY_DUALSENSE_PLAYER_LED_COUNT;
|
||||
playerleds.matrix_map = NULL;
|
||||
zones.push_back(playerleds);
|
||||
|
||||
leds.resize(SONY_DUALSENSE_LIGHTBAR_LED_COUNT + SONY_DUALSENSE_PLAYER_LED_COUNT);
|
||||
@@ -114,24 +112,17 @@ void RGBController_SonyDualSense::SetupZones()
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_SonyDualSense::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_SonyDualSense::DeviceUpdateLEDs()
|
||||
{
|
||||
controller->SetColors(colors, modes[active_mode].brightness, modes[active_mode].value);
|
||||
}
|
||||
|
||||
void RGBController_SonyDualSense::UpdateZoneLEDs(int /*zone*/)
|
||||
void RGBController_SonyDualSense::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_SonyDualSense::UpdateSingleLED(int /*led*/)
|
||||
void RGBController_SonyDualSense::DeviceUpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
@@ -21,11 +21,10 @@ public:
|
||||
~RGBController_SonyDualSense();
|
||||
|
||||
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