mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-02-14 17:21:26 -05:00
Store name in SRGBmodsControllers to avoid setting it in detectors
This commit is contained in:
@@ -25,20 +25,20 @@
|
||||
|
||||
RGBController_SRGBmodsPico::RGBController_SRGBmodsPico(SRGBmodsPicoController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
controller = controller_ptr;
|
||||
|
||||
name = "SRGBmods Device";
|
||||
vendor = "SRGBmods.net";
|
||||
description = "SRGBmods Pico LED Controller Device";
|
||||
type = DEVICE_TYPE_LEDSTRIP;
|
||||
location = controller->GetLocationString();
|
||||
serial = controller->GetSerialString();
|
||||
name = controller->GetNameString();
|
||||
vendor = "SRGBmods.net";
|
||||
description = "SRGBmods Pico LED Controller Device";
|
||||
type = DEVICE_TYPE_LEDSTRIP;
|
||||
location = controller->GetLocationString();
|
||||
serial = controller->GetSerialString();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 0xFFFF;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 0xFFFF;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
SetupZones();
|
||||
|
||||
@@ -15,10 +15,11 @@
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
SRGBmodsPicoController::SRGBmodsPicoController(hid_device* dev_handle, const char* path)
|
||||
SRGBmodsPicoController::SRGBmodsPicoController(hid_device* dev_handle, const char* path, std::string dev_name)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| The SRGBmods Pico controller requires a packet within |
|
||||
@@ -56,6 +57,11 @@ std::string SRGBmodsPicoController::GetLocationString()
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string SRGBmodsPicoController::GetNameString()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string SRGBmodsPicoController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
|
||||
@@ -19,10 +19,11 @@
|
||||
class SRGBmodsPicoController
|
||||
{
|
||||
public:
|
||||
SRGBmodsPicoController(hid_device* dev_handle, const char* path);
|
||||
SRGBmodsPicoController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
~SRGBmodsPicoController();
|
||||
|
||||
std::string GetLocationString();
|
||||
std::string GetNameString();
|
||||
std::string GetSerialString();
|
||||
|
||||
void SetChannelLEDs(unsigned char channel, RGBColor * colors, unsigned int num_colors);
|
||||
@@ -31,6 +32,7 @@ public:
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string name;
|
||||
std::thread* keepalive_thread;
|
||||
std::atomic<bool> keepalive_thread_run;
|
||||
std::chrono::time_point<std::chrono::steady_clock> last_commit_time;
|
||||
|
||||
Reference in New Issue
Block a user