Files
OpenRGB/Controllers/RoccatController/RoccatHordeAimoController/RGBController_RoccatHordeAimo.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

90 lines
2.7 KiB
C++

/*---------------------------------------------------------*\
| RGBController_RoccatHordeAimo.cpp |
| |
| RGBController for Roccat Horde Aimo |
| |
| Morgan Guimard (morg) 24 Feb 2022 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include "RGBController_RoccatHordeAimo.h"
/**------------------------------------------------------------------*\
@name Roccat Horde Aimo
@category Keyboard
@type USB
@save :x:
@direct :white_check_mark:
@effects :x:
@detectors DetectRoccatHordeAimoKeyboardControllers
@comment
\*-------------------------------------------------------------------*/
RGBController_RoccatHordeAimo::RGBController_RoccatHordeAimo(RoccatHordeAimoController* controller_ptr)
{
controller = controller_ptr;
name = controller->GetNameString();
vendor = "Roccat";
type = DEVICE_TYPE_KEYBOARD;
description = "Roccat Horde Aimo Keyboard Device";
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
mode Direct;
Direct.name = "Direct";
Direct.value = 0;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
SetupZones();
}
RGBController_RoccatHordeAimo::~RGBController_RoccatHordeAimo()
{
delete controller;
}
void RGBController_RoccatHordeAimo::SetupZones()
{
zone new_zone;
new_zone.name = "Keyboard";
new_zone.type = ZONE_TYPE_LINEAR;
new_zone.leds_min = NUMBER_OF_LEDS;
new_zone.leds_max = NUMBER_OF_LEDS;
new_zone.leds_count = NUMBER_OF_LEDS;
zones.push_back(new_zone);
for(unsigned int i = 0; i < NUMBER_OF_LEDS; i++)
{
led new_led;
new_led.name = "LED " + std::to_string(i + 1);
leds.push_back(new_led);
}
SetupColors();
}
void RGBController_RoccatHordeAimo::DeviceUpdateLEDs()
{
DeviceUpdateZoneLEDs(0);
}
void RGBController_RoccatHordeAimo::DeviceUpdateZoneLEDs(int /*zone_idx*/)
{
controller->SetColors(colors);
}
void RGBController_RoccatHordeAimo::DeviceUpdateSingleLED(int /*led_idx*/)
{
DeviceUpdateZoneLEDs(0);
}
void RGBController_RoccatHordeAimo::DeviceUpdateMode()
{
}