Files
OpenRGB/Controllers/LexipMouseController/RGBController_LexipMouse.cpp
Adam Honse f75cc9087b 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
2025-12-24 02:20:01 -06:00

91 lines
2.6 KiB
C++

/*---------------------------------------------------------*\
| RGBController_LexipMouse.cpp |
| |
| RGBController for Lexip mouse |
| |
| Morgan Guimard (morg) 21 Feb 2022 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <chrono>
#include <thread>
#include "RGBController_LexipMouse.h"
/**------------------------------------------------------------------*\
@name Lexip Mouse
@category Mouse
@type USB
@save :x:
@direct :white_check_mark:
@effects :x:
@detectors DetectLexipMouseControllers
@comment
\*-------------------------------------------------------------------*/
RGBController_LexipMouse::RGBController_LexipMouse(LexipMouseController* controller_ptr)
{
controller = controller_ptr;
name = controller->GetNameString();
vendor = "Lexip";
type = DEVICE_TYPE_MOUSE;
description = name;
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_LexipMouse::~RGBController_LexipMouse()
{
delete controller;
}
void RGBController_LexipMouse::SetupZones()
{
zone new_zone;
new_zone.name = "Mouse";
new_zone.type = ZONE_TYPE_LINEAR;
new_zone.leds_min = 1;
new_zone.leds_max = 1;
new_zone.leds_count = 1;
new_zone.matrix_map = nullptr;
zones.emplace_back(new_zone);
leds.resize(1);
leds[0].name = "LED 1";
SetupColors();
}
void RGBController_LexipMouse::DeviceUpdateLEDs()
{
DeviceUpdateZoneLEDs(0);
}
void RGBController_LexipMouse::DeviceUpdateZoneLEDs(int /*zone*/)
{
controller->SetDirect(colors[0]);
}
void RGBController_LexipMouse::DeviceUpdateSingleLED(int led)
{
DeviceUpdateZoneLEDs(led);
}
void RGBController_LexipMouse::DeviceUpdateMode()
{
DeviceUpdateZoneLEDs(0);
}