| 191 | } |
| 192 | |
| 193 | void ResourceManager::UnregisterRGBController(RGBController* rgb_controller) |
| 194 | { |
| 195 | LOG_INFO("[%s] Unregistering RGB controller", rgb_controller->name.c_str()); |
| 196 | |
| 197 | /*-------------------------------------------------------------------------*\ |
| 198 | | Clear callbacks from the controller before removal | |
| 199 | \*-------------------------------------------------------------------------*/ |
| 200 | rgb_controller->ClearCallbacks(); |
| 201 | |
| 202 | /*-------------------------------------------------------------------------*\ |
| 203 | | Find the controller to remove and remove it from the hardware list | |
| 204 | \*-------------------------------------------------------------------------*/ |
| 205 | std::vector<RGBController*>::iterator hw_it = std::find(rgb_controllers_hw.begin(), rgb_controllers_hw.end(), rgb_controller); |
| 206 | |
| 207 | if (hw_it != rgb_controllers_hw.end()) |
| 208 | { |
| 209 | rgb_controllers_hw.erase(hw_it); |
| 210 | } |
| 211 | |
| 212 | /*-------------------------------------------------------------------------*\ |
| 213 | | Find the controller to remove and remove it from the master list | |
| 214 | \*-------------------------------------------------------------------------*/ |
| 215 | std::vector<RGBController*>::iterator rgb_it = std::find(rgb_controllers.begin(), rgb_controllers.end(), rgb_controller); |
| 216 | |
| 217 | if (rgb_it != rgb_controllers.end()) |
| 218 | { |
| 219 | rgb_controllers.erase(rgb_it); |
| 220 | } |
| 221 | |
| 222 | UpdateDeviceList(); |
| 223 | } |
| 224 | |
| 225 | std::vector<RGBController*> & ResourceManager::GetRGBControllers() |
| 226 | { |
nothing calls this directly
no test coverage detected