Skip to content

Commit 1396cc8

Browse files
Remove SetCustomMode from all controllers beginning with the letters V, W, Y, and Z
1 parent 9d7fef5 commit 1396cc8

File tree

11 files changed

+28
-64
lines changed

11 files changed

+28
-64
lines changed

Controllers/ViewSonicController/RGBController_XG270QG.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,4 @@ void RGBController_XG270QG::DeviceUpdateMode()
156156
b = RGBGetBValue(modes[active_mode].colors[0]);
157157
}
158158
controller->SetMode(modes[active_mode].value, r, g, b);
159-
}
160-
161-
void RGBController_XG270QG::SetCustomMode()
162-
{
163-
/*-------------------------------------------------*\
164-
| Set mode to Static Color |
165-
\*-------------------------------------------------*/
166-
active_mode = 1;
167-
}
168-
159+
}

Controllers/ViewSonicController/RGBController_XG270QG.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class RGBController_XG270QG : public RGBController
1717
RGBController_XG270QG(VS_XG270QG_Controller* controller_ptr);
1818

1919
void SetupZones();
20-
2120
void ResizeZone(int zone, int new_size);
2221

2322
void DeviceUpdateLEDs();
@@ -26,8 +25,6 @@ class RGBController_XG270QG : public RGBController
2625

2726
void DeviceUpdateMode();
2827

29-
void SetCustomMode();
30-
3128
private:
3229
VS_XG270QG_Controller* controller;
3330
};

Controllers/WootingKeyboardController/RGBController_WootingKeyboard.cpp

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -182,17 +182,17 @@ static const char *led_names[] =
182182
@comment
183183
\*-------------------------------------------------------------------*/
184184

185-
RGBController_WootingKeyboard::RGBController_WootingKeyboard(WootingKeyboardController *wooting_ptr)
185+
RGBController_WootingKeyboard::RGBController_WootingKeyboard(WootingKeyboardController* controller_ptr)
186186
{
187-
wooting = wooting_ptr;
187+
controller = controller_ptr;
188188

189189
LOG_DEBUG("%sAdding meta data", WOOTING_CONTROLLER_NAME);
190-
name = wooting_ptr->GetName();
191-
vendor = wooting_ptr->GetVendor();
190+
name = controller->GetName();
191+
vendor = controller->GetVendor();
192192
type = DEVICE_TYPE_KEYBOARD;
193-
description = wooting_ptr->GetDescription();
194-
location = wooting_ptr->GetLocation();
195-
serial = wooting_ptr->GetSerial();
193+
description = controller->GetDescription();
194+
location = controller->GetLocation();
195+
serial = controller->GetSerial();
196196

197197
LOG_DEBUG("%sAdding modes", WOOTING_CONTROLLER_NAME);
198198
mode Direct;
@@ -217,14 +217,16 @@ RGBController_WootingKeyboard::~RGBController_WootingKeyboard()
217217
delete zones[zone_index].matrix_map;
218218
}
219219
}
220+
221+
delete controller;
220222
}
221223

222224
void RGBController_WootingKeyboard::SetupZones()
223225
{
224226
/*---------------------------------------------------------*\
225227
| Set up zones |
226228
\*---------------------------------------------------------*/
227-
uint8_t wooting_type = wooting->GetWootingType();
229+
uint8_t wooting_type = controller->GetWootingType();
228230
unsigned int total_led_count = zone_sizes[wooting_type];
229231

230232
LOG_DEBUG("%sCreating New Zone", WOOTING_CONTROLLER_NAME);
@@ -276,7 +278,7 @@ void RGBController_WootingKeyboard::ResizeZone(int /*zone*/, int /*new_size*/)
276278

277279
void RGBController_WootingKeyboard::DeviceUpdateLEDs()
278280
{
279-
wooting->SendDirect(&colors[0], colors.size());
281+
controller->SendDirect(&colors[0], colors.size());
280282
}
281283

282284
void RGBController_WootingKeyboard::UpdateZoneLEDs(int /*zone*/)
@@ -289,11 +291,6 @@ void RGBController_WootingKeyboard::UpdateSingleLED(int /*led*/)
289291
DeviceUpdateLEDs();
290292
}
291293

292-
void RGBController_WootingKeyboard::SetCustomMode()
293-
{
294-
active_mode = 0;
295-
}
296-
297294
void RGBController_WootingKeyboard::DeviceUpdateMode()
298295
{
299296
}

Controllers/WootingKeyboardController/RGBController_WootingKeyboard.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,18 @@
1414
class RGBController_WootingKeyboard : public RGBController
1515
{
1616
public:
17-
RGBController_WootingKeyboard(WootingKeyboardController* wooting_ptr);
17+
RGBController_WootingKeyboard(WootingKeyboardController* controller_ptr);
1818
~RGBController_WootingKeyboard();
1919

2020
void SetupZones();
21-
2221
void ResizeZone(int zone, int new_size);
2322

2423
void DeviceUpdateLEDs();
2524
void UpdateZoneLEDs(int zone);
2625
void UpdateSingleLED(int led);
2726

28-
void SetCustomMode();
2927
void DeviceUpdateMode();
3028

3129
private:
32-
WootingKeyboardController* wooting;
30+
WootingKeyboardController* controller;
3331
};

Controllers/YeelightController/RGBController_Yeelight.cpp

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919
@comment
2020
\*-------------------------------------------------------------------*/
2121

22-
RGBController_Yeelight::RGBController_Yeelight(YeelightController* light_ptr)
22+
RGBController_Yeelight::RGBController_Yeelight(YeelightController* controller_ptr)
2323
{
24-
light = light_ptr;
24+
controller = controller_ptr;
2525

26-
name = light->GetName();
27-
vendor = light->GetManufacturer();
26+
name = controller->GetName();
27+
vendor = controller->GetManufacturer();
2828
type = DEVICE_TYPE_LIGHT;
29-
version = light->GetVersion();
29+
version = controller->GetVersion();
3030
description = "Yeelight Device";
31-
serial = light->GetUniqueID();
32-
location = light->GetLocation();
31+
serial = controller->GetUniqueID();
32+
location = controller->GetLocation();
3333

3434
/*---------------------------------------------------------*\
3535
| If using music mode, use mode name "Direct" as the music |
@@ -38,7 +38,7 @@ RGBController_Yeelight::RGBController_Yeelight(YeelightController* light_ptr)
3838
| "Static" to prevent effect engine use, as the standard |
3939
| interface is limited to a very low update rate |
4040
\*---------------------------------------------------------*/
41-
if(light->GetMusicMode())
41+
if(controller->GetMusicMode())
4242
{
4343
mode Direct;
4444
Direct.name = "Direct";
@@ -62,7 +62,7 @@ RGBController_Yeelight::RGBController_Yeelight(YeelightController* light_ptr)
6262

6363
RGBController_Yeelight::~RGBController_Yeelight()
6464
{
65-
delete light;
65+
delete controller;
6666
}
6767

6868
void RGBController_Yeelight::SetupZones()
@@ -97,7 +97,7 @@ void RGBController_Yeelight::DeviceUpdateLEDs()
9797
unsigned char grn = RGBGetGValue(colors[0]);
9898
unsigned char blu = RGBGetBValue(colors[0]);
9999

100-
light->SetColor(red, grn, blu);
100+
controller->SetColor(red, grn, blu);
101101
}
102102

103103
void RGBController_Yeelight::UpdateZoneLEDs(int /*zone*/)
@@ -110,11 +110,6 @@ void RGBController_Yeelight::UpdateSingleLED(int /*led*/)
110110
DeviceUpdateLEDs();
111111
}
112112

113-
void RGBController_Yeelight::SetCustomMode()
114-
{
115-
116-
}
117-
118113
void RGBController_Yeelight::DeviceUpdateMode()
119114
{
120115

Controllers/YeelightController/RGBController_Yeelight.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,18 @@
1313
class RGBController_Yeelight : public RGBController
1414
{
1515
public:
16-
RGBController_Yeelight(YeelightController* light_ptr);
16+
RGBController_Yeelight(YeelightController* controller_ptr);
1717
~RGBController_Yeelight();
1818

1919
void SetupZones();
20-
2120
void ResizeZone(int zone, int new_size);
2221

2322
void DeviceUpdateLEDs();
2423
void UpdateZoneLEDs(int zone);
2524
void UpdateSingleLED(int led);
2625

27-
void SetCustomMode();
2826
void DeviceUpdateMode();
2927

3028
private:
31-
YeelightController* light;
29+
YeelightController* controller;
3230
};

Controllers/ZETEdgeAirProController/RGBController_ZETEdgeAirPro.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,6 @@ void RGBController_ZETEdgeAirPro::UpdateSingleLED(int /*led*/)
129129
DeviceUpdateMode();
130130
}
131131

132-
void RGBController_ZETEdgeAirPro::SetCustomMode()
133-
{
134-
active_mode = 0;
135-
}
136-
137132
void RGBController_ZETEdgeAirPro::DeviceUpdateMode()
138133
{
139134
RGBColor color;

Controllers/ZETEdgeAirProController/RGBController_ZETEdgeAirPro.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ class RGBController_ZETEdgeAirPro : public RGBController
2020

2121
void SetupZones();
2222
void ResizeZone(int zone, int new_size);
23+
2324
void DeviceUpdateLEDs();
2425
void UpdateZoneLEDs(int zone);
2526
void UpdateSingleLED(int led);
27+
2628
void DeviceUpdateMode();
27-
void SetCustomMode();
2829

2930
private:
3031
ZETEdgeAirProController* controller;

Controllers/ZETKeyboardController/RGBController_ZETBladeOptical.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -513,11 +513,6 @@ void RGBController_ZETBladeOptical::UpdateSingleLED(int /*led*/)
513513
DeviceUpdateLEDs();
514514
}
515515

516-
void RGBController_ZETBladeOptical::SetCustomMode()
517-
{
518-
active_mode = 0;
519-
}
520-
521516
void RGBController_ZETBladeOptical::DeviceUpdateMode()
522517
{
523518
bool random = (modes[active_mode].color_mode == MODE_COLORS_RANDOM || modes[active_mode].color_mode == MODE_COLORS_NONE);

Controllers/ZETKeyboardController/RGBController_ZETBladeOptical.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@ class RGBController_ZETBladeOptical : public RGBController
2828
~RGBController_ZETBladeOptical();
2929

3030
void SetupZones();
31-
3231
void ResizeZone(int zone, int new_size);
3332

3433
void DeviceUpdateLEDs();
3534
void UpdateZoneLEDs(int zone);
3635
void UpdateSingleLED(int led);
3736

38-
void SetCustomMode();
3937
void DeviceUpdateMode();
4038

4139
private:

0 commit comments

Comments
 (0)