Skip to content

Commit 215183f

Browse files
Remove SetCustomMode from all controllers beginning with the letter P
1 parent bc1ba87 commit 215183f

12 files changed

+45
-86
lines changed

Controllers/PNYGPUController/RGBController_PNYGPU.cpp

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
@comment
2121
\*-------------------------------------------------------------------*/
2222

23-
RGBController_PNYGPU::RGBController_PNYGPU(PNYGPUController* pny_ptr)
23+
RGBController_PNYGPU::RGBController_PNYGPU(PNYGPUController* controller_ptr)
2424
{
25-
pny = pny_ptr;
25+
controller = controller_ptr;
2626

2727
name = "PNY/Palit GPU";
2828
vendor = "PNY/Palit";
2929
description = "PNY/Palit RGB GPU Device";
30-
location = pny->GetDeviceLocation();
30+
location = controller->GetDeviceLocation();
3131

32-
type = DEVICE_TYPE_GPU;
32+
type = DEVICE_TYPE_GPU;
3333

3434
mode Off;
3535
Off.name = "Off";
@@ -126,11 +126,6 @@ void RGBController_PNYGPU::UpdateSingleLED(int /*led*/)
126126
DeviceUpdateLEDs();
127127
}
128128

129-
void RGBController_PNYGPU::SetCustomMode()
130-
{
131-
active_mode = 1;
132-
}
133-
134129
void RGBController_PNYGPU::DeviceUpdateMode()
135130
{
136131
RGBColor color = colors[0];
@@ -141,23 +136,23 @@ void RGBController_PNYGPU::DeviceUpdateMode()
141136
switch(modes[active_mode].value)
142137
{
143138
case PNY_GPU_MODE_OFF:
144-
pny->SetOff();
139+
controller->SetOff();
145140
break;
146141

147142
case PNY_GPU_MODE_DIRECT:
148143
brightness = modes[active_mode].brightness;
149-
pny->SetDirect(r, g, b, brightness);
144+
controller->SetDirect(r, g, b, brightness);
150145
break;
151146

152147
case PNY_GPU_MODE_CYCLE:
153148
speed = modes[active_mode].speed;
154-
pny->SetCycle(speed);
149+
controller->SetCycle(speed);
155150
break;
156151

157152
case PNY_GPU_MODE_STROBE:
158153
speed = modes[active_mode].speed;
159154
brightness = modes[active_mode].brightness;
160-
pny->SetStrobe(r, g, b, speed, brightness);
155+
controller->SetStrobe(r, g, b, speed, brightness);
161156
break;
162157
default:
163158
break;

Controllers/PNYGPUController/RGBController_PNYGPU.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,17 @@
1515
class RGBController_PNYGPU : public RGBController
1616
{
1717
public:
18-
RGBController_PNYGPU(PNYGPUController* pny_ptr);
18+
RGBController_PNYGPU(PNYGPUController* controller_ptr);
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-
PNYGPUController* pny;
30+
PNYGPUController* controller;
3331
};

Controllers/PatriotViperController/RGBController_PatriotViper.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,6 @@ void RGBController_PatriotViper::UpdateSingleLED(int led)
212212
}
213213
}
214214

215-
void RGBController_PatriotViper::SetCustomMode()
216-
{
217-
active_mode = 0;
218-
}
219-
220215
void RGBController_PatriotViper::DeviceUpdateMode()
221216
{
222217
if(modes[active_mode].value == 0xFFFF)

Controllers/PatriotViperController/RGBController_PatriotViper.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@ class RGBController_PatriotViper : public RGBController
1919
~RGBController_PatriotViper();
2020

2121
void SetupZones();
22-
2322
void ResizeZone(int zone, int new_size);
2423

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

29-
void SetCustomMode();
3028
void DeviceUpdateMode();
3129

3230
private:

Controllers/PatriotViperSteelController/RGBController_PatriotViperSteel.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ void RGBController_PatriotViperSteel::UpdateSingleLED(int led)
110110
controller->SetLEDColor(led, red, grn, blu);
111111
}
112112

113-
void RGBController_PatriotViperSteel::SetCustomMode()
114-
{
115-
}
116-
117113
void RGBController_PatriotViperSteel::DeviceUpdateMode()
118114
{
119115
}

Controllers/PatriotViperSteelController/RGBController_PatriotViperSteel.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@ class RGBController_PatriotViperSteel : public RGBController
1717
~RGBController_PatriotViperSteel();
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:

Controllers/PhilipsHueController/RGBController_PhilipsHue.cpp

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@
1919
@comment
2020
\*-------------------------------------------------------------------*/
2121

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

26-
name = light->GetManufacturer() + " " + light->GetName();
26+
name = controller->GetManufacturer() + " " + controller->GetName();
2727
type = DEVICE_TYPE_LIGHT;
28-
version = light->GetVersion();
28+
version = controller->GetVersion();
2929
description = "Philips Hue Device";
30-
serial = light->GetUniqueID();
31-
location = light->GetLocation();
30+
serial = controller->GetUniqueID();
31+
location = controller->GetLocation();
3232

3333
mode Direct;
3434
Direct.name = "Direct";
@@ -72,7 +72,7 @@ void RGBController_PhilipsHue::DeviceUpdateLEDs()
7272
unsigned char grn = RGBGetGValue(colors[0]);
7373
unsigned char blu = RGBGetBValue(colors[0]);
7474

75-
light->SetColor(red, grn, blu);
75+
controller->SetColor(red, grn, blu);
7676
}
7777

7878
void RGBController_PhilipsHue::UpdateZoneLEDs(int /*zone*/)
@@ -85,11 +85,6 @@ void RGBController_PhilipsHue::UpdateSingleLED(int /*led*/)
8585
DeviceUpdateLEDs();
8686
}
8787

88-
void RGBController_PhilipsHue::SetCustomMode()
89-
{
90-
91-
}
92-
9388
void RGBController_PhilipsHue::DeviceUpdateMode()
9489
{
9590

Controllers/PhilipsHueController/RGBController_PhilipsHue.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,17 @@
1313
class RGBController_PhilipsHue : public RGBController
1414
{
1515
public:
16-
RGBController_PhilipsHue(PhilipsHueController* light_ptr);
16+
RGBController_PhilipsHue(PhilipsHueController* controller_ptr);
1717

1818
void SetupZones();
19-
2019
void ResizeZone(int zone, int new_size);
2120

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

26-
void SetCustomMode();
2725
void DeviceUpdateMode();
2826

2927
private:
30-
PhilipsHueController* light;
28+
PhilipsHueController* controller;
3129
};

Controllers/PhilipsHueController/RGBController_PhilipsHueEntertainment.cpp

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ using namespace std::chrono_literals;
2323
@comment
2424
\*-------------------------------------------------------------------*/
2525

26-
RGBController_PhilipsHueEntertainment::RGBController_PhilipsHueEntertainment(PhilipsHueEntertainmentController* light_ptr)
26+
RGBController_PhilipsHueEntertainment::RGBController_PhilipsHueEntertainment(PhilipsHueEntertainmentController* controller_ptr)
2727
{
28-
light = light_ptr;
28+
controller = controller_ptr;
2929

30-
name = light->GetManufacturer() + " " + light->GetName();
30+
name = controller->GetManufacturer() + " " + controller->GetName();
3131
type = DEVICE_TYPE_LIGHT;
32-
version = light->GetVersion();
32+
version = controller->GetVersion();
3333
description = "Philips Hue Entertainment Mode Device";
34-
serial = light->GetUniqueID();
35-
location = light->GetLocation();
34+
serial = controller->GetUniqueID();
35+
location = controller->GetLocation();
3636

3737
mode Direct;
3838
Direct.name = "Direct";
@@ -72,13 +72,13 @@ void RGBController_PhilipsHueEntertainment::SetupZones()
7272
zone led_zone;
7373
led_zone.name = "RGB Light";
7474
led_zone.type = ZONE_TYPE_SINGLE;
75-
led_zone.leds_min = light->GetNumLEDs();
76-
led_zone.leds_max = light->GetNumLEDs();
77-
led_zone.leds_count = light->GetNumLEDs();
75+
led_zone.leds_min = controller->GetNumLEDs();
76+
led_zone.leds_max = controller->GetNumLEDs();
77+
led_zone.leds_count = controller->GetNumLEDs();
7878
led_zone.matrix_map = NULL;
7979
zones.push_back(led_zone);
8080

81-
for(unsigned int led_idx = 0; led_idx < light->GetNumLEDs(); led_idx++)
81+
for(unsigned int led_idx = 0; led_idx < controller->GetNumLEDs(); led_idx++)
8282
{
8383
led new_led;
8484
new_led.name = "RGB Light";
@@ -102,7 +102,7 @@ void RGBController_PhilipsHueEntertainment::DeviceUpdateLEDs()
102102

103103
if(active_mode == 0)
104104
{
105-
light->SetColor(&colors[0]);
105+
controller->SetColor(&colors[0]);
106106
}
107107
}
108108

@@ -116,11 +116,6 @@ void RGBController_PhilipsHueEntertainment::UpdateSingleLED(int /*led*/)
116116
DeviceUpdateLEDs();
117117
}
118118

119-
void RGBController_PhilipsHueEntertainment::SetCustomMode()
120-
{
121-
active_mode = 0;
122-
}
123-
124119
void RGBController_PhilipsHueEntertainment::DeviceUpdateMode()
125120
{
126121
if(active_mode == 0)
@@ -135,11 +130,11 @@ void RGBController_PhilipsHueEntertainment::DeviceUpdateMode()
135130
}
136131
}
137132

138-
light->Connect();
133+
controller->Connect();
139134
}
140135
else
141136
{
142-
light->Disconnect();
137+
controller->Disconnect();
143138
}
144139
}
145140

Controllers/PhilipsHueController/RGBController_PhilipsHueEntertainment.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,21 @@
1717
class RGBController_PhilipsHueEntertainment : public RGBController
1818
{
1919
public:
20-
RGBController_PhilipsHueEntertainment(PhilipsHueEntertainmentController* light_ptr);
20+
RGBController_PhilipsHueEntertainment(PhilipsHueEntertainmentController* controller_ptr);
2121

2222
void SetupZones();
23-
2423
void ResizeZone(int zone, int new_size);
2524

2625
void DeviceUpdateLEDs();
2726
void UpdateZoneLEDs(int zone);
2827
void UpdateSingleLED(int led);
2928

30-
void SetCustomMode();
3129
void DeviceUpdateMode();
3230

3331
void KeepaliveThreadFunction();
3432

3533
private:
36-
PhilipsHueEntertainmentController* light;
34+
PhilipsHueEntertainmentController* controller;
3735

3836
std::atomic<bool> KeepaliveThreadRunning;
3937
std::thread* KeepaliveThread;

0 commit comments

Comments
 (0)