MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / SetupZones

Method SetupZones

Controllers/IonicoController/RGBController_Ionico.cpp:124–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124void RGBController_Ionico::SetupZones()
125{
126 /*-------------------------------------------------*\
127 | Clear any existing color/LED configuration |
128 \*-------------------------------------------------*/
129 leds.clear();
130 colors.clear();
131
132 /*---------------------------------------------------------*\
133 | Set up zones |
134 \*---------------------------------------------------------*/
135 if(controller->GetUSBPID() == IONICO_KB_PID)
136 {
137 leds.resize(IONICO_KEYBOARD_LED_COUNT);
138 zone zone_keyboard;
139 zone_keyboard.name = "Keyboard";
140 zone_keyboard.type = ZONE_TYPE_LINEAR;
141 zone_keyboard.leds_min = leds.size();
142 zone_keyboard.leds_max = leds.size();
143 zone_keyboard.leds_count = leds.size();
144 zone_keyboard.matrix_map = nullptr;
145 zones.emplace_back(zone_keyboard);
146 for(size_t i = 0; i < leds.size(); ++i)
147 {
148 leds[i].name = "Keyboard Zone " + std::to_string(i+1);
149 }
150 }
151 else if(controller->GetUSBPID() == IONICO_FB_PID)
152 {
153 leds.resize(IONICO_BAR_LED_COUNT);
154 zone zone_bar;
155 zone_bar.name = "Front Bar";
156 zone_bar.type = ZONE_TYPE_LINEAR;
157 zone_bar.leds_min = leds.size();
158 zone_bar.leds_max = leds.size();
159 zone_bar.leds_count = leds.size();
160 zone_bar.matrix_map = nullptr;
161 zones.emplace_back(zone_bar);
162 for(size_t i = 0; i < leds.size(); ++i)
163 {
164 leds[i].name = "Bar Led " + std::to_string(i+1);
165 }
166 }
167 SetupColors();
168}
169
170void RGBController_Ionico::ResizeZone(int /*zone*/, int /*new_size*/)
171{

Callers

nothing calls this directly

Calls 3

to_stringFunction · 0.85
GetUSBPIDMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected