Remove SetCustomMode from all controllers beginning with the letters V, W, Y, and Z

This commit is contained in:
Adam Honse 2022-08-21 21:36:47 -05:00
parent 9d7fef5bbc
commit 1396cc8f92
11 changed files with 28 additions and 64 deletions

View file

@ -156,13 +156,4 @@ void RGBController_XG270QG::DeviceUpdateMode()
b = RGBGetBValue(modes[active_mode].colors[0]);
}
controller->SetMode(modes[active_mode].value, r, g, b);
}
void RGBController_XG270QG::SetCustomMode()
{
/*-------------------------------------------------*\
| Set mode to Static Color |
\*-------------------------------------------------*/
active_mode = 1;
}
}

View file

@ -17,7 +17,6 @@ public:
RGBController_XG270QG(VS_XG270QG_Controller* controller_ptr);
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
@ -26,8 +25,6 @@ public:
void DeviceUpdateMode();
void SetCustomMode();
private:
VS_XG270QG_Controller* controller;
};

View file

@ -182,17 +182,17 @@ static const char *led_names[] =
@comment
\*-------------------------------------------------------------------*/
RGBController_WootingKeyboard::RGBController_WootingKeyboard(WootingKeyboardController *wooting_ptr)
RGBController_WootingKeyboard::RGBController_WootingKeyboard(WootingKeyboardController* controller_ptr)
{
wooting = wooting_ptr;
controller = controller_ptr;
LOG_DEBUG("%sAdding meta data", WOOTING_CONTROLLER_NAME);
name = wooting_ptr->GetName();
vendor = wooting_ptr->GetVendor();
name = controller->GetName();
vendor = controller->GetVendor();
type = DEVICE_TYPE_KEYBOARD;
description = wooting_ptr->GetDescription();
location = wooting_ptr->GetLocation();
serial = wooting_ptr->GetSerial();
description = controller->GetDescription();
location = controller->GetLocation();
serial = controller->GetSerial();
LOG_DEBUG("%sAdding modes", WOOTING_CONTROLLER_NAME);
mode Direct;
@ -217,6 +217,8 @@ RGBController_WootingKeyboard::~RGBController_WootingKeyboard()
delete zones[zone_index].matrix_map;
}
}
delete controller;
}
void RGBController_WootingKeyboard::SetupZones()
@ -224,7 +226,7 @@ void RGBController_WootingKeyboard::SetupZones()
/*---------------------------------------------------------*\
| Set up zones |
\*---------------------------------------------------------*/
uint8_t wooting_type = wooting->GetWootingType();
uint8_t wooting_type = controller->GetWootingType();
unsigned int total_led_count = zone_sizes[wooting_type];
LOG_DEBUG("%sCreating New Zone", WOOTING_CONTROLLER_NAME);
@ -276,7 +278,7 @@ void RGBController_WootingKeyboard::ResizeZone(int /*zone*/, int /*new_size*/)
void RGBController_WootingKeyboard::DeviceUpdateLEDs()
{
wooting->SendDirect(&colors[0], colors.size());
controller->SendDirect(&colors[0], colors.size());
}
void RGBController_WootingKeyboard::UpdateZoneLEDs(int /*zone*/)
@ -289,11 +291,6 @@ void RGBController_WootingKeyboard::UpdateSingleLED(int /*led*/)
DeviceUpdateLEDs();
}
void RGBController_WootingKeyboard::SetCustomMode()
{
active_mode = 0;
}
void RGBController_WootingKeyboard::DeviceUpdateMode()
{
}

View file

@ -14,20 +14,18 @@
class RGBController_WootingKeyboard : public RGBController
{
public:
RGBController_WootingKeyboard(WootingKeyboardController* wooting_ptr);
RGBController_WootingKeyboard(WootingKeyboardController* controller_ptr);
~RGBController_WootingKeyboard();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
private:
WootingKeyboardController* wooting;
WootingKeyboardController* controller;
};

View file

@ -19,17 +19,17 @@
@comment
\*-------------------------------------------------------------------*/
RGBController_Yeelight::RGBController_Yeelight(YeelightController* light_ptr)
RGBController_Yeelight::RGBController_Yeelight(YeelightController* controller_ptr)
{
light = light_ptr;
controller = controller_ptr;
name = light->GetName();
vendor = light->GetManufacturer();
name = controller->GetName();
vendor = controller->GetManufacturer();
type = DEVICE_TYPE_LIGHT;
version = light->GetVersion();
version = controller->GetVersion();
description = "Yeelight Device";
serial = light->GetUniqueID();
location = light->GetLocation();
serial = controller->GetUniqueID();
location = controller->GetLocation();
/*---------------------------------------------------------*\
| If using music mode, use mode name "Direct" as the music |
@ -38,7 +38,7 @@ RGBController_Yeelight::RGBController_Yeelight(YeelightController* light_ptr)
| "Static" to prevent effect engine use, as the standard |
| interface is limited to a very low update rate |
\*---------------------------------------------------------*/
if(light->GetMusicMode())
if(controller->GetMusicMode())
{
mode Direct;
Direct.name = "Direct";
@ -62,7 +62,7 @@ RGBController_Yeelight::RGBController_Yeelight(YeelightController* light_ptr)
RGBController_Yeelight::~RGBController_Yeelight()
{
delete light;
delete controller;
}
void RGBController_Yeelight::SetupZones()
@ -97,7 +97,7 @@ void RGBController_Yeelight::DeviceUpdateLEDs()
unsigned char grn = RGBGetGValue(colors[0]);
unsigned char blu = RGBGetBValue(colors[0]);
light->SetColor(red, grn, blu);
controller->SetColor(red, grn, blu);
}
void RGBController_Yeelight::UpdateZoneLEDs(int /*zone*/)
@ -110,11 +110,6 @@ void RGBController_Yeelight::UpdateSingleLED(int /*led*/)
DeviceUpdateLEDs();
}
void RGBController_Yeelight::SetCustomMode()
{
}
void RGBController_Yeelight::DeviceUpdateMode()
{

View file

@ -13,20 +13,18 @@
class RGBController_Yeelight : public RGBController
{
public:
RGBController_Yeelight(YeelightController* light_ptr);
RGBController_Yeelight(YeelightController* controller_ptr);
~RGBController_Yeelight();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
private:
YeelightController* light;
YeelightController* controller;
};

View file

@ -129,11 +129,6 @@ void RGBController_ZETEdgeAirPro::UpdateSingleLED(int /*led*/)
DeviceUpdateMode();
}
void RGBController_ZETEdgeAirPro::SetCustomMode()
{
active_mode = 0;
}
void RGBController_ZETEdgeAirPro::DeviceUpdateMode()
{
RGBColor color;

View file

@ -20,11 +20,12 @@ public:
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
void SetCustomMode();
private:
ZETEdgeAirProController* controller;

View file

@ -513,11 +513,6 @@ void RGBController_ZETBladeOptical::UpdateSingleLED(int /*led*/)
DeviceUpdateLEDs();
}
void RGBController_ZETBladeOptical::SetCustomMode()
{
active_mode = 0;
}
void RGBController_ZETBladeOptical::DeviceUpdateMode()
{
bool random = (modes[active_mode].color_mode == MODE_COLORS_RANDOM || modes[active_mode].color_mode == MODE_COLORS_NONE);

View file

@ -28,14 +28,12 @@ public:
~RGBController_ZETBladeOptical();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
private:

View file

@ -18,7 +18,6 @@ public:
~RGBController_ZalmanZSync();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();