Use HID path for Location on Thermaltake Riing controller

This commit is contained in:
Adam Honse 2020-10-05 00:13:11 -05:00
parent fe8ed09e77
commit 05c7d49a62
4 changed files with 14 additions and 4 deletions

View file

@ -17,6 +17,7 @@ RGBController_ThermaltakeRiing::RGBController_ThermaltakeRiing(ThermaltakeRiingC
name = "Thermaltake Riing";
type = DEVICE_TYPE_COOLER;
description = "Thermaltake Riing Device";
location = riing->GetDeviceLocation();
mode Direct;
Direct.name = "Direct";

View file

@ -11,9 +11,10 @@
#include <cstring>
ThermaltakeRiingController::ThermaltakeRiingController(hid_device* dev_handle)
ThermaltakeRiingController::ThermaltakeRiingController(hid_device* dev_handle, const char* path)
{
dev = dev_handle;
dev = dev_handle;
location = path;
SendInit();
}
@ -23,6 +24,11 @@ ThermaltakeRiingController::~ThermaltakeRiingController()
}
std::string ThermaltakeRiingController::GetDeviceLocation()
{
return(location);
}
void ThermaltakeRiingController::SetChannelLEDs(unsigned char channel, RGBColor * colors, unsigned int num_colors)
{
unsigned char* color_data = new unsigned char[3 * num_colors];

View file

@ -47,9 +47,11 @@ enum
class ThermaltakeRiingController
{
public:
ThermaltakeRiingController(hid_device* dev_handle);
ThermaltakeRiingController(hid_device* dev_handle, const char* path);
~ThermaltakeRiingController();
std::string GetDeviceLocation();
void SetChannelLEDs(unsigned char channel, RGBColor * colors, unsigned int num_colors);
void SetMode(unsigned char mode, unsigned char speed);
@ -58,6 +60,7 @@ private:
unsigned char current_mode;
unsigned char current_speed;
std::string location;
void SendInit();

View file

@ -47,7 +47,7 @@ void DetectThermaltakeRiingControllers(std::vector<RGBController*>& rgb_controll
if(dev)
{
ThermaltakeRiingController* controller = new ThermaltakeRiingController(dev);
ThermaltakeRiingController* controller = new ThermaltakeRiingController(dev, info->path);
RGBController_ThermaltakeRiing* rgb_controller = new RGBController_ThermaltakeRiing(controller);