Code cleanup
This commit is contained in:
parent
d8e7cd694d
commit
ddeb5de65e
3 changed files with 14 additions and 12 deletions
|
|
@ -19,11 +19,13 @@
|
|||
void DetectMSI3ZoneControllers(hid_device_info* info, const std::string&)
|
||||
{
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
if( dev )
|
||||
|
||||
if(dev)
|
||||
{
|
||||
MSI3ZoneController* controller = new MSI3ZoneController(dev, info->path);
|
||||
MSI3ZoneController* controller = new MSI3ZoneController(dev, info->path);
|
||||
RGBController_MSI3Zone* rgb_controller = new RGBController_MSI3Zone(controller);
|
||||
// Constructor sets the name
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
} /* DetectMSI3ZoneControllers() */
|
||||
|
|
|
|||
|
|
@ -9,16 +9,16 @@
|
|||
|
||||
#include "RGBController_MSI3Zone.h"
|
||||
|
||||
RGBController_MSI3Zone::RGBController_MSI3Zone(MSI3ZoneController* msi_ptr)
|
||||
RGBController_MSI3Zone::RGBController_MSI3Zone(MSI3ZoneController* controller_ptr)
|
||||
{
|
||||
msi = msi_ptr;
|
||||
controller = controller_ptr;
|
||||
|
||||
name = "MSI 3-Zone Keyboard";
|
||||
vendor = "MSI";
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "MSI 3-Zone Keyboard Device";
|
||||
location = msi->GetDeviceLocation();
|
||||
serial = msi->GetSerialString();
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
|
|
@ -32,7 +32,7 @@ RGBController_MSI3Zone::RGBController_MSI3Zone(MSI3ZoneController* msi_ptr)
|
|||
|
||||
RGBController_MSI3Zone::~RGBController_MSI3Zone()
|
||||
{
|
||||
delete msi;
|
||||
delete controller;
|
||||
}
|
||||
|
||||
void RGBController_MSI3Zone::SetupZones()
|
||||
|
|
@ -89,17 +89,17 @@ void RGBController_MSI3Zone::ResizeZone(int /*zone*/, int /*new_size*/)
|
|||
|
||||
void RGBController_MSI3Zone::DeviceUpdateLEDs()
|
||||
{
|
||||
msi->SetLEDs(colors);
|
||||
controller->SetLEDs(colors);
|
||||
}
|
||||
|
||||
void RGBController_MSI3Zone::UpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
msi->SetLEDs(colors);
|
||||
controller->SetLEDs(colors);
|
||||
}
|
||||
|
||||
void RGBController_MSI3Zone::UpdateSingleLED(int /*led*/)
|
||||
{
|
||||
msi->SetLEDs(colors);
|
||||
controller->SetLEDs(colors);
|
||||
}
|
||||
|
||||
void RGBController_MSI3Zone::SetCustomMode()
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
class RGBController_MSI3Zone : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_MSI3Zone(MSI3ZoneController* msi_ptr);
|
||||
RGBController_MSI3Zone(MSI3ZoneController* controller_ptr);
|
||||
~RGBController_MSI3Zone();
|
||||
|
||||
void SetupZones();
|
||||
|
|
@ -29,5 +29,5 @@ public:
|
|||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
MSI3ZoneController* msi;
|
||||
MSI3ZoneController* controller;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue