mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2025-12-26 08:47:50 -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
91 lines
2.4 KiB
C++
91 lines
2.4 KiB
C++
/*---------------------------------------------------------*\
|
|
| RGBController_FanBus.cpp |
|
|
| |
|
|
| RGBController for FanBus devices |
|
|
| |
|
|
| Adam Honse (calcprogrammer1@gmail.com) 12 Jan 2021 |
|
|
| |
|
|
| This file is part of the OpenRGB project |
|
|
| SPDX-License-Identifier: GPL-2.0-or-later |
|
|
\*---------------------------------------------------------*/
|
|
|
|
#include "RGBController_FanBus.h"
|
|
|
|
/**------------------------------------------------------------------*\
|
|
@name FanBus
|
|
@category Cooler
|
|
@type Serial
|
|
@save :x:
|
|
@direct :white_check_mark:
|
|
@effects :x:
|
|
@detectors DetectFanBusControllers
|
|
@comment
|
|
\*-------------------------------------------------------------------*/
|
|
|
|
RGBController_FanBus::RGBController_FanBus(FanBusController* controller_ptr)
|
|
{
|
|
controller = controller_ptr;
|
|
|
|
name = "FanBus Device";
|
|
type = DEVICE_TYPE_COOLER;
|
|
description = "FanBus Device";
|
|
location = controller->GetLocation();
|
|
|
|
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_FanBus::~RGBController_FanBus()
|
|
{
|
|
delete controller;
|
|
}
|
|
|
|
void RGBController_FanBus::SetupZones()
|
|
{
|
|
zone led_zone;
|
|
led_zone.name = "Fan LEDs";
|
|
led_zone.type = ZONE_TYPE_SINGLE;
|
|
led_zone.leds_min = 4;
|
|
led_zone.leds_max = 4;
|
|
led_zone.leds_count = 4;
|
|
led_zone.matrix_map = NULL;
|
|
zones.push_back(led_zone);
|
|
|
|
for(unsigned int led_idx = 0; led_idx < led_zone.leds_count; led_idx++)
|
|
{
|
|
led new_led;
|
|
new_led.name = "LED ";
|
|
new_led.name.append(std::to_string(led_idx));
|
|
|
|
leds.push_back(new_led);
|
|
}
|
|
|
|
SetupColors();
|
|
}
|
|
|
|
void RGBController_FanBus::DeviceUpdateLEDs()
|
|
{
|
|
controller->SetLEDs(colors);
|
|
}
|
|
|
|
void RGBController_FanBus::DeviceUpdateZoneLEDs(int /*zone*/)
|
|
{
|
|
controller->SetLEDs(colors);
|
|
}
|
|
|
|
void RGBController_FanBus::DeviceUpdateSingleLED(int /*led*/)
|
|
{
|
|
controller->SetLEDs(colors);
|
|
}
|
|
|
|
void RGBController_FanBus::DeviceUpdateMode()
|
|
{
|
|
|
|
}
|