Files
OpenRGB/Controllers/SteelSeriesController/SteelSeriesArctis5Controller/RGBController_SteelSeriesArctis5.cpp
Adam Honse a3b023d86c 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
2026-01-11 13:10:40 -06:00

99 lines
2.8 KiB
C++

/*---------------------------------------------------------*\
| RGBController_SteelSeriesArctis5.cpp |
| |
| RGBController for SteelSeries Arctis 5 |
| |
| Morgan Guimard 04 Mar 2022 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include "RGBController_SteelSeriesArctis5.h"
/**------------------------------------------------------------------*\
@name Steelseries Arctis 5
@category Headset
@type USB
@save :x:
@direct :white_check_mark:
@effects :x:
@detectors DetectSteelSeriesArctis5
@comment
\*-------------------------------------------------------------------*/
RGBController_SteelSeriesArctis5::RGBController_SteelSeriesArctis5(SteelSeriesArctis5Controller* controller_ptr)
{
controller = controller_ptr;
name = controller->GetNameString();
vendor = "SteelSeries";
type = DEVICE_TYPE_HEADSET;
description = "SteelSeries Arctis 5 Headset Device";
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
mode Direct;
Direct.name = "Direct";
Direct.value = 0x00;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
SetupZones();
}
RGBController_SteelSeriesArctis5::~RGBController_SteelSeriesArctis5()
{
delete controller;
}
void RGBController_SteelSeriesArctis5::SetupZones()
{
const std::string zone_names[2] =
{
"Left" , "Right"
};
for(const std::string& zone_name : zone_names)
{
zone zone;
zone.name = zone_name;
zone.type = ZONE_TYPE_SINGLE;
zone.leds_min = 1;
zone.leds_max = 1;
zone.leds_count = 1;
zones.push_back(zone);
led mouse_led;
mouse_led.name = zone_name;
leds.push_back(mouse_led);
}
SetupColors();
}
void RGBController_SteelSeriesArctis5::DeviceUpdateLEDs()
{
for(unsigned int i = 0; i < zones.size(); i++)
{
DeviceUpdateZoneLEDs(i);
}
}
void RGBController_SteelSeriesArctis5::DeviceUpdateZoneLEDs(int zone)
{
controller->SetColor(zone, colors[zone]);
}
void RGBController_SteelSeriesArctis5::DeviceUpdateSingleLED(int led)
{
DeviceUpdateZoneLEDs(led);
}
void RGBController_SteelSeriesArctis5::DeviceUpdateMode()
{
}