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

Method RegisterRGBController

ResourceManager.cpp:162–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162void ResourceManager::RegisterRGBController(RGBController *rgb_controller)
163{
164 LOG_INFO("[%s] Registering RGB controller", rgb_controller->name.c_str());
165 rgb_controllers_hw.push_back(rgb_controller);
166
167 /*-------------------------------------------------*\
168 | If the device list size has changed, call the |
169 | device list changed callbacks |
170 | |
171 | TODO: If all detection is reworked to use |
172 | RegisterRGBController, tracking of previous list |
173 | size can be removed and profile can be loaded per |
174 | controller before adding to list |
175 \*-------------------------------------------------*/
176 if(rgb_controllers_hw.size() != detection_prev_size)
177 {
178 /*-------------------------------------------------*\
179 | First, load sizes for the new controllers |
180 \*-------------------------------------------------*/
181 for(unsigned int controller_size_idx = detection_prev_size; controller_size_idx < rgb_controllers_hw.size(); controller_size_idx++)
182 {
183 profile_manager->LoadDeviceFromListWithOptions(rgb_controllers_sizes, detection_size_entry_used, rgb_controllers_hw[controller_size_idx], true, false);
184 }
185
186 UpdateDeviceList();
187 }
188 detection_prev_size = rgb_controllers_hw.size();
189
190 UpdateDeviceList();
191}
192
193void ResourceManager::UnregisterRGBController(RGBController* rgb_controller)
194{

Calls 3

push_backMethod · 0.45
sizeMethod · 0.45

Tested by 2