Split out detection system from ResourceManager into DetectionManager

* Split detection system out into its own class, DetectionManager
    * Clean up ResourceManger's many callbacks into just two, one for detection and one general purpose
This commit is contained in:
Adam Honse
2026-01-08 23:35:50 -06:00
parent 0a232bfe1e
commit da750672e8
221 changed files with 3149 additions and 2776 deletions

View File

@@ -7,7 +7,7 @@
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include "Detector.h"
#include "DetectionManager.h"
#include "MSIMysticLight64Controller.h"
#include "MSIMysticLight112Controller.h"
#include "MSIMysticLight162Controller.h"
@@ -62,21 +62,21 @@ void DetectMSIMysticLightControllers
MSIMysticLight185Controller* controller = new MSIMysticLight185Controller(dev, info->path, info->product_id, dmi_name);
RGBController_MSIMysticLight185* rgb_controller = new RGBController_MSIMysticLight185(controller);
ResourceManager::get()->RegisterRGBController(rgb_controller);
DetectionManager::get()->RegisterRGBController(rgb_controller);
}
else if((packet_length >= sizeof(FeaturePacket_162)) && (packet_length <= (sizeof(FeaturePacket_162) + 1)))
{
MSIMysticLight162Controller* controller = new MSIMysticLight162Controller(dev, info->path, info->product_id, dmi_name);
RGBController_MSIMysticLight162* rgb_controller = new RGBController_MSIMysticLight162(controller);
ResourceManager::get()->RegisterRGBController(rgb_controller);
DetectionManager::get()->RegisterRGBController(rgb_controller);
}
else if((packet_length >= sizeof(FeaturePacket_112)) && (packet_length <= (sizeof(FeaturePacket_112) + 1)))
{
MSIMysticLight112Controller* controller = new MSIMysticLight112Controller(dev, info->path, dmi_name);
RGBController_MSIMysticLight112* rgb_controller = new RGBController_MSIMysticLight112(controller);
ResourceManager::get()->RegisterRGBController(rgb_controller);
DetectionManager::get()->RegisterRGBController(rgb_controller);
}
else // no supported length returned
{
@@ -104,7 +104,7 @@ void DetectMSIMysticLightControllers
{
MSIMysticLight761Controller* controller = new MSIMysticLight761Controller(dev, (const char *) info->path, dmi_name);
RGBController_MSIMysticLight761* rgb_controller = new RGBController_MSIMysticLight761(controller);
ResourceManager::get()->RegisterRGBController(rgb_controller);
DetectionManager::get()->RegisterRGBController(rgb_controller);
}
catch(const std::runtime_error& e)
{
@@ -142,7 +142,7 @@ void DetectMSIMysticLight64Controllers
MSIMysticLight64Controller* controller = new MSIMysticLight64Controller(dev, info->path);
RGBController_MSIMysticLight64* rgb_controller = new RGBController_MSIMysticLight64(controller);
ResourceManager::get()->RegisterRGBController(rgb_controller);
DetectionManager::get()->RegisterRGBController(rgb_controller);
}
}