Store name in MSIRGBController to avoid setting it in detector
This commit is contained in:
parent
b13ca818bb
commit
719d7b8801
4 changed files with 28 additions and 14 deletions
|
|
@ -15,9 +15,10 @@
|
|||
#include "dmiinfo.h"
|
||||
#include "super_io.h"
|
||||
|
||||
MSIRGBController::MSIRGBController(int sioaddr, bool invert)
|
||||
MSIRGBController::MSIRGBController(int sioaddr, bool invert, std::string dev_name)
|
||||
{
|
||||
msi_sioaddr = sioaddr;
|
||||
name = dev_name;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| This setup step isn't well documented |
|
||||
|
|
@ -74,6 +75,18 @@ MSIRGBController::~MSIRGBController()
|
|||
|
||||
}
|
||||
|
||||
std::string MSIRGBController::GetDeviceLocation()
|
||||
{
|
||||
char hex[12];
|
||||
snprintf(hex, sizeof(hex), "0x%X", msi_sioaddr);
|
||||
return("SIO: " + std::string(hex));
|
||||
}
|
||||
|
||||
std::string MSIRGBController::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
void MSIRGBController::SetColor(unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ enum
|
|||
class MSIRGBController
|
||||
{
|
||||
public:
|
||||
MSIRGBController(int sioaddr, bool invert);
|
||||
MSIRGBController(int sioaddr, bool invert, std::string dev_name);
|
||||
~MSIRGBController();
|
||||
|
||||
std::string GetDeviceName();
|
||||
|
|
@ -54,4 +54,5 @@ public:
|
|||
void SetColor(unsigned char red, unsigned char green, unsigned char blue);
|
||||
private:
|
||||
int msi_sioaddr;
|
||||
std::string name;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -114,9 +114,8 @@ void DetectMSIRGBControllers()
|
|||
{
|
||||
if (board_dmi.find(std::string(compatible_devices[i].name)) != std::string::npos)
|
||||
{
|
||||
MSIRGBController* controller = new MSIRGBController(sioaddr, compatible_devices[i].invert);
|
||||
MSIRGBController* controller = new MSIRGBController(sioaddr, compatible_devices[i].invert, "MSI " + board_dmi);
|
||||
RGBController_MSIRGB* rgb_controller = new RGBController_MSIRGB(controller);
|
||||
rgb_controller->name = "MSI " + board_dmi;
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -26,10 +26,11 @@ RGBController_MSIRGB::RGBController_MSIRGB(MSIRGBController* controller_ptr)
|
|||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = "MSI Motherboard";
|
||||
name = controller->GetDeviceName();
|
||||
vendor = "MSI";
|
||||
type = DEVICE_TYPE_MOTHERBOARD;
|
||||
description = "MSI-RGB Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue