mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-02-02 03:11:07 -05:00
Determine device type from LampArray kind
This commit is contained in:
@@ -135,6 +135,11 @@ std::string HIDLampArrayController::GetSerialString()
|
||||
return("");
|
||||
}
|
||||
|
||||
unsigned int HIDLampArrayController::GetLampArrayKind()
|
||||
{
|
||||
return(LampArray.LampArrayKind);
|
||||
}
|
||||
|
||||
unsigned int HIDLampArrayController::GetLampCount()
|
||||
{
|
||||
return(LampArray.LampCount);
|
||||
|
||||
@@ -116,6 +116,7 @@ public:
|
||||
std::string GetDeviceName();
|
||||
std::string GetSerialString();
|
||||
|
||||
unsigned int GetLampArrayKind();
|
||||
unsigned int GetLampCount();
|
||||
std::vector<LampAttributes> GetLamps();
|
||||
|
||||
|
||||
@@ -26,11 +26,43 @@ RGBController_HIDLampArray::RGBController_HIDLampArray(HIDLampArrayController* c
|
||||
|
||||
name = controller->GetDeviceName();
|
||||
vendor = "Generic";
|
||||
type = DEVICE_TYPE_MOUSEMAT;
|
||||
description = "HID LampArray Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Determine device type from LampArray kind |
|
||||
\*-----------------------------------------------------*/
|
||||
switch(controller->GetLampArrayKind())
|
||||
{
|
||||
case HID_LAMPARRAY_KIND_UNDEFINED:
|
||||
default:
|
||||
type = DEVICE_TYPE_UNKNOWN;
|
||||
break;
|
||||
|
||||
case HID_LAMPARRAY_KIND_KEYBOARD:
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
break;
|
||||
|
||||
case HID_LAMPARRAY_KIND_MOUSE:
|
||||
type = DEVICE_TYPE_MOUSE;
|
||||
break;
|
||||
|
||||
case HID_LAMPARRAY_KIND_GAME_CONTROLLER:
|
||||
type = DEVICE_TYPE_GAMEPAD;
|
||||
break;
|
||||
|
||||
case HID_LAMPARRAY_KIND_PERIPHERAL:
|
||||
case HID_LAMPARRAY_KIND_SCENE:
|
||||
case HID_LAMPARRAY_KIND_NOTIFICATION:
|
||||
case HID_LAMPARRAY_KIND_CHASSIS:
|
||||
case HID_LAMPARRAY_KIND_WEARABLE:
|
||||
case HID_LAMPARRAY_KIND_FURNITURE:
|
||||
case HID_LAMPARRAY_KIND_ART:
|
||||
type = DEVICE_TYPE_ACCESSORY;
|
||||
break;
|
||||
}
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 0;
|
||||
|
||||
Reference in New Issue
Block a user