mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-01-02 12:17: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
89 lines
2.6 KiB
C++
89 lines
2.6 KiB
C++
/*---------------------------------------------------------*\
|
|
| RGBController_RoccatElo.cpp |
|
|
| |
|
|
| RGBController for Roccat Elo |
|
|
| |
|
|
| Flora Aubry 02 Jan 2023 |
|
|
| |
|
|
| This file is part of the OpenRGB project |
|
|
| SPDX-License-Identifier: GPL-2.0-or-later |
|
|
\*---------------------------------------------------------*/
|
|
|
|
#include <chrono>
|
|
#include <thread>
|
|
#include "RGBController_RoccatElo.h"
|
|
|
|
/**------------------------------------------------------------------*\
|
|
@name Roccat Elo 7.1
|
|
@category Headset
|
|
@type USB
|
|
@save :x:
|
|
@direct :white_check_mark:
|
|
@effects :x:
|
|
@detectors DetectRoccatEloControllers
|
|
@comment
|
|
\*-------------------------------------------------------------------*/
|
|
|
|
RGBController_RoccatElo::RGBController_RoccatElo(RoccatEloController* controller_ptr)
|
|
{
|
|
controller = controller_ptr;
|
|
|
|
name = controller->GetNameString();
|
|
vendor = "Roccat";
|
|
type = DEVICE_TYPE_HEADSET;
|
|
description = "Roccat Elo 7.1 Headset 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_RoccatElo::~RGBController_RoccatElo()
|
|
{
|
|
delete controller;
|
|
}
|
|
|
|
void RGBController_RoccatElo::SetupZones()
|
|
{
|
|
zone new_zone;
|
|
|
|
new_zone.name = "Headset";
|
|
new_zone.type = ZONE_TYPE_LINEAR;
|
|
new_zone.leds_min = ROCCAT_ELO_LEDS_COUNT;
|
|
new_zone.leds_max = ROCCAT_ELO_LEDS_COUNT;
|
|
new_zone.leds_count = ROCCAT_ELO_LEDS_COUNT;
|
|
new_zone.matrix_map = nullptr;
|
|
|
|
zones.emplace_back(new_zone);
|
|
|
|
leds.resize(new_zone.leds_count);
|
|
|
|
SetupColors();
|
|
}
|
|
|
|
void RGBController_RoccatElo::DeviceUpdateLEDs()
|
|
{
|
|
controller->SendDirect(colors[0]);
|
|
}
|
|
|
|
void RGBController_RoccatElo::DeviceUpdateZoneLEDs(int /*zone*/)
|
|
{
|
|
DeviceUpdateLEDs();
|
|
}
|
|
|
|
void RGBController_RoccatElo::DeviceUpdateSingleLED(int /*led*/)
|
|
{
|
|
DeviceUpdateLEDs();
|
|
}
|
|
|
|
void RGBController_RoccatElo::DeviceUpdateMode()
|
|
{
|
|
|
|
}
|