mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-01-19 04:27:51 -05:00
* 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
96 lines
3.1 KiB
C++
96 lines
3.1 KiB
C++
/*---------------------------------------------------------*\
|
|
| RGBController_SteelSeriesSiberia.cpp |
|
|
| |
|
|
| RGBController for SteelSeries Siberia |
|
|
| |
|
|
| E Karlsson (pilophae) 18 Jun 2020 |
|
|
| |
|
|
| This file is part of the OpenRGB project |
|
|
| SPDX-License-Identifier: GPL-2.0-or-later |
|
|
\*---------------------------------------------------------*/
|
|
|
|
#include "RGBController_SteelSeriesSiberia.h"
|
|
|
|
/**------------------------------------------------------------------*\
|
|
@name Steel Series Siberia
|
|
@category Headset
|
|
@type USB
|
|
@save :x:
|
|
@direct :x:
|
|
@effects :white_check_mark:
|
|
@detectors DetectSteelSeriesHeadset
|
|
@comment
|
|
\*-------------------------------------------------------------------*/
|
|
|
|
RGBController_SteelSeriesSiberia::RGBController_SteelSeriesSiberia(SteelSeriesSiberiaController* controller_ptr)
|
|
{
|
|
controller = controller_ptr;
|
|
|
|
name = controller->GetDeviceName();
|
|
vendor = "SteelSeries";
|
|
type = DEVICE_TYPE_HEADSET;
|
|
description = "SteelSeries Siberia Device";
|
|
location = controller->GetDeviceLocation();
|
|
serial = controller->GetSerialString();
|
|
|
|
mode Static;
|
|
Static.name = "Static";
|
|
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
|
Static.color_mode = MODE_COLORS_PER_LED;
|
|
modes.push_back(Static);
|
|
|
|
SetupZones();
|
|
}
|
|
|
|
RGBController_SteelSeriesSiberia::~RGBController_SteelSeriesSiberia()
|
|
{
|
|
delete controller;
|
|
}
|
|
|
|
void RGBController_SteelSeriesSiberia::SetupZones()
|
|
{
|
|
/* Siberia 350 only has one Zone */
|
|
zone earpiece_zone;
|
|
earpiece_zone.name = "Headset";
|
|
earpiece_zone.type = ZONE_TYPE_SINGLE;
|
|
earpiece_zone.leds_min = 1;
|
|
earpiece_zone.leds_max = 1;
|
|
earpiece_zone.leds_count = 1;
|
|
zones.push_back(earpiece_zone);
|
|
|
|
led earpiece_led;
|
|
earpiece_led.name = "Headset LED";
|
|
leds.push_back(earpiece_led);
|
|
|
|
SetupColors();
|
|
}
|
|
|
|
void RGBController_SteelSeriesSiberia::DeviceUpdateLEDs()
|
|
{
|
|
unsigned char red = RGBGetRValue(colors[0]);
|
|
unsigned char grn = RGBGetGValue(colors[0]);
|
|
unsigned char blu = RGBGetBValue(colors[0]);
|
|
controller->SetColor(red, grn, blu);
|
|
}
|
|
|
|
void RGBController_SteelSeriesSiberia::DeviceUpdateZoneLEDs(int zone)
|
|
{
|
|
RGBColor color = colors[zone];
|
|
unsigned char red = RGBGetRValue(color);
|
|
unsigned char grn = RGBGetGValue(color);
|
|
unsigned char blu = RGBGetBValue(color);
|
|
controller->SetColor(red, grn, blu);
|
|
}
|
|
|
|
void RGBController_SteelSeriesSiberia::DeviceUpdateSingleLED(int led)
|
|
{
|
|
/* Each zone only has a single LED, so we can use the LED ID to reference
|
|
* the existing zone code. */
|
|
DeviceUpdateZoneLEDs(led);
|
|
}
|
|
|
|
void RGBController_SteelSeriesSiberia::DeviceUpdateMode()
|
|
{
|
|
DeviceUpdateLEDs();
|
|
}
|