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
99 lines
3.2 KiB
C++
99 lines
3.2 KiB
C++
/*---------------------------------------------------------*\
|
|
| RGBController_SteelSeriesQCKMat.cpp |
|
|
| |
|
|
| RGBController for SteelSeries Mouse |
|
|
| |
|
|
| Edbgon 22 May 2021 |
|
|
| |
|
|
| This file is part of the OpenRGB project |
|
|
| SPDX-License-Identifier: GPL-2.0-or-later |
|
|
\*---------------------------------------------------------*/
|
|
|
|
#include "RGBController_SteelSeriesQCKMat.h"
|
|
|
|
/**------------------------------------------------------------------*\
|
|
@name Steel Series QCK Mat
|
|
@category Mousemat
|
|
@type USB
|
|
@save :x:
|
|
@direct :white_check_mark:
|
|
@effects :x:
|
|
@detectors DetectSteelSeriesMousemat
|
|
@comment
|
|
\*-------------------------------------------------------------------*/
|
|
|
|
RGBController_SteelSeriesQCKMat::RGBController_SteelSeriesQCKMat(SteelSeriesQCKMatController* controller_ptr)
|
|
{
|
|
controller = controller_ptr;
|
|
|
|
name = controller->GetDeviceName();
|
|
vendor = "SteelSeries";
|
|
type = DEVICE_TYPE_MOUSEMAT;
|
|
description = "SteelSeries QCK Mat Device";
|
|
location = controller->GetDeviceLocation();
|
|
serial = controller->GetSerialString();
|
|
|
|
mode Direct;
|
|
Direct.name = "Direct";
|
|
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
|
Direct.color_mode = MODE_COLORS_PER_LED;
|
|
modes.push_back(Direct);
|
|
|
|
SetupZones();
|
|
}
|
|
|
|
RGBController_SteelSeriesQCKMat::~RGBController_SteelSeriesQCKMat()
|
|
{
|
|
delete controller;
|
|
}
|
|
|
|
void RGBController_SteelSeriesQCKMat::SetupZones()
|
|
{
|
|
/*---------------------------------------------------------*\
|
|
| QCK has two zones |
|
|
\*---------------------------------------------------------*/
|
|
zone mousemat_zone;
|
|
mousemat_zone.name = "Mousemat";
|
|
mousemat_zone.type = ZONE_TYPE_SINGLE;
|
|
mousemat_zone.leds_min = 2;
|
|
mousemat_zone.leds_max = 2;
|
|
mousemat_zone.leds_count = 2;
|
|
zones.push_back(mousemat_zone);
|
|
|
|
led bot_led;
|
|
bot_led.name = "Mat Bottom LED";
|
|
leds.push_back(bot_led);
|
|
|
|
led top_led;
|
|
top_led.name = "Mat Top LED";
|
|
leds.push_back(top_led);
|
|
|
|
SetupColors();
|
|
}
|
|
|
|
void RGBController_SteelSeriesQCKMat::DeviceUpdateLEDs()
|
|
{
|
|
controller->SetColors(colors);
|
|
}
|
|
|
|
void RGBController_SteelSeriesQCKMat::DeviceUpdateZoneLEDs(int /*zone*/)
|
|
{
|
|
/*---------------------------------------------------------*\
|
|
| Packet expects both LEDs |
|
|
\*---------------------------------------------------------*/
|
|
DeviceUpdateLEDs();
|
|
}
|
|
|
|
void RGBController_SteelSeriesQCKMat::DeviceUpdateSingleLED(int /*led*/)
|
|
{
|
|
/*---------------------------------------------------------*\
|
|
| Packet expects both LEDs |
|
|
\*---------------------------------------------------------*/
|
|
DeviceUpdateLEDs();
|
|
}
|
|
|
|
void RGBController_SteelSeriesQCKMat::DeviceUpdateMode()
|
|
{
|
|
DeviceUpdateLEDs();
|
|
}
|