Move RGBController files for device controllers into the Controllers directory
This commit is contained in:
parent
278d6b0d00
commit
f3ccaf1a2b
130 changed files with 543 additions and 537 deletions
86
Controllers/LinuxLEDController/RGBController_LinuxLED.cpp
Normal file
86
Controllers/LinuxLEDController/RGBController_LinuxLED.cpp
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
/*-----------------------------------------*\
|
||||
| RGBController_LinuxLED.cpp |
|
||||
| |
|
||||
| Generic RGB Interface for Linux LED |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 9/25/2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "RGBController_LinuxLED.h"
|
||||
|
||||
RGBController_LinuxLED::RGBController_LinuxLED(LinuxLEDController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = "Linux LED";
|
||||
type = DEVICE_TYPE_LEDSTRIP;
|
||||
description = "Linux Sysfs LED Device";
|
||||
|
||||
location = "R: " + controller->GetRedPath() + "\r\n" +
|
||||
"G: " + controller->GetGreenPath() + "\r\n" +
|
||||
"B: " + controller->GetBluePath();
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
void RGBController_LinuxLED::SetupZones()
|
||||
{
|
||||
zone led_zone;
|
||||
led_zone.name = "RGB Light";
|
||||
led_zone.type = ZONE_TYPE_SINGLE;
|
||||
led_zone.leds_min = 1;
|
||||
led_zone.leds_max = 1;
|
||||
led_zone.leds_count = 1;
|
||||
led_zone.matrix_map = NULL;
|
||||
zones.push_back(led_zone);
|
||||
|
||||
led new_led;
|
||||
new_led.name = "RGB Light";
|
||||
|
||||
leds.push_back(new_led);
|
||||
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_LinuxLED::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_LinuxLED::DeviceUpdateLEDs()
|
||||
{
|
||||
unsigned char red = RGBGetRValue(colors[0]);
|
||||
unsigned char grn = RGBGetGValue(colors[0]);
|
||||
unsigned char blu = RGBGetBValue(colors[0]);
|
||||
|
||||
controller->SetRGB(red, grn, blu);
|
||||
}
|
||||
|
||||
void RGBController_LinuxLED::UpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_LinuxLED::UpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_LinuxLED::SetCustomMode()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void RGBController_LinuxLED::DeviceUpdateMode()
|
||||
{
|
||||
|
||||
}
|
||||
31
Controllers/LinuxLEDController/RGBController_LinuxLED.h
Normal file
31
Controllers/LinuxLEDController/RGBController_LinuxLED.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/*-----------------------------------------*\
|
||||
| RGBController_LinuxLED.h |
|
||||
| |
|
||||
| Generic RGB Interface for Linux LED |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 9/25/2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
#include "RGBController.h"
|
||||
#include "LinuxLEDController.h"
|
||||
|
||||
class RGBController_LinuxLED : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_LinuxLED(LinuxLEDController* controller_ptr);
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
|
||||
void SetCustomMode();
|
||||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
LinuxLEDController* controller;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue