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
104
Controllers/SapphireGPUController/RGBController_SapphireGPU.cpp
Normal file
104
Controllers/SapphireGPUController/RGBController_SapphireGPU.cpp
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
/*-----------------------------------------*\
|
||||
| RGBController_RGBFusionGPU.cpp |
|
||||
| |
|
||||
| Generic RGB Interface for OpenRGB |
|
||||
| Gigabyte RGB Fusion GPU Driver |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 2/23/2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "RGBController_SapphireGPU.h"
|
||||
|
||||
RGBController_SapphireGPU::RGBController_SapphireGPU(SapphireGPUController* sapphire_ptr)
|
||||
{
|
||||
sapphire = sapphire_ptr;
|
||||
|
||||
name = "Sapphire GPU";
|
||||
description = "Sapphire GPU";
|
||||
location = sapphire->GetDeviceLocation();
|
||||
|
||||
type = DEVICE_TYPE_GPU;
|
||||
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = 0x04;
|
||||
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Static.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Static);
|
||||
|
||||
mode Rainbow;
|
||||
Rainbow.name = "Rainbow";
|
||||
Rainbow.value = 0x01;
|
||||
Rainbow.flags = 0;
|
||||
Rainbow.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Rainbow);
|
||||
|
||||
SetupZones();
|
||||
|
||||
// Initialize active mode
|
||||
active_mode = 0;
|
||||
}
|
||||
|
||||
void RGBController_SapphireGPU::SetupZones()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device only has one LED, so create a single zone and |
|
||||
| LED for it |
|
||||
\*---------------------------------------------------------*/
|
||||
zone* new_zone = new zone();
|
||||
led* new_led = new led();
|
||||
|
||||
new_zone->name = "GPU Zone";
|
||||
new_zone->type = ZONE_TYPE_SINGLE;
|
||||
new_zone->leds_min = 1;
|
||||
new_zone->leds_max = 1;
|
||||
new_zone->leds_count = 1;
|
||||
new_zone->matrix_map = NULL;
|
||||
|
||||
new_led->name = "GPU LED";
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Push the zone and LED on to device vectors |
|
||||
\*---------------------------------------------------------*/
|
||||
leds.push_back(*new_led);
|
||||
zones.push_back(*new_zone);
|
||||
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_SapphireGPU::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_SapphireGPU::DeviceUpdateLEDs()
|
||||
{
|
||||
RGBColor color = colors[0];
|
||||
unsigned char red = RGBGetRValue(color);
|
||||
unsigned char grn = RGBGetGValue(color);
|
||||
unsigned char blu = RGBGetBValue(color);
|
||||
|
||||
sapphire->SetColor(red, grn, blu);
|
||||
}
|
||||
|
||||
void RGBController_SapphireGPU::UpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_SapphireGPU::UpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_SapphireGPU::SetCustomMode()
|
||||
{
|
||||
active_mode = 0;
|
||||
}
|
||||
|
||||
void RGBController_SapphireGPU::DeviceUpdateMode()
|
||||
{
|
||||
sapphire->SetMode((unsigned char)modes[(unsigned int)active_mode].value, (unsigned char)modes[(unsigned int)active_mode].speed);
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
/*-----------------------------------------*\
|
||||
| RGBController_SapphireGPU.h |
|
||||
| |
|
||||
| Generic RGB Interface for OpenRGB |
|
||||
| Sapphire GPU RGB Driver |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 7/15/2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "SapphireGPUController.h"
|
||||
|
||||
class RGBController_SapphireGPU : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_SapphireGPU(SapphireGPUController* sapphire_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:
|
||||
SapphireGPUController* sapphire;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue