mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-02-18 15:25:06 -05:00
Resolving the Windows HIDAPI interface problem by changing the IPU macro to PU
* Moved "Off" mode to last * Created GetDeviceMode() to accomodate change * Code formatting cleanup
This commit is contained in:
@@ -11,72 +11,72 @@
|
||||
|
||||
RGBController_CMMP750Controller::RGBController_CMMP750Controller(CMMP750Controller* cmmp_ptr)
|
||||
{
|
||||
cmmp750 = cmmp_ptr;
|
||||
unsigned char speed = cmmp750->GetLedSpeed();
|
||||
cmmp750 = cmmp_ptr;
|
||||
unsigned char speed = cmmp750->GetLedSpeed();
|
||||
|
||||
name = cmmp750->GetDeviceName();
|
||||
vendor = "Cooler Master";
|
||||
type = DEVICE_TYPE_MOUSEMAT;
|
||||
description = cmmp750->GetDeviceName();
|
||||
version = "1.0";
|
||||
serial = cmmp750->GetSerial();
|
||||
location = cmmp750->GetLocation();
|
||||
|
||||
mode Off;
|
||||
Off.name = "Turn Off";
|
||||
Off.value = CM_MP750_MODE_OFF;
|
||||
Off.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Off);
|
||||
name = cmmp750->GetDeviceName();
|
||||
vendor = "Cooler Master";
|
||||
type = DEVICE_TYPE_MOUSEMAT;
|
||||
description = cmmp750->GetDeviceName();
|
||||
version = "1.0";
|
||||
serial = cmmp750->GetSerial();
|
||||
location = cmmp750->GetLocation();
|
||||
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = CM_MP750_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Static.color_mode = MODE_COLORS_PER_LED;
|
||||
Static.name = "Static";
|
||||
Static.value = CM_MP750_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Static.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Static);
|
||||
|
||||
mode Blink;
|
||||
Blink.name = "Blink";
|
||||
Blink.value = CM_MP750_MODE_BLINK;
|
||||
Blink.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Blink.speed_min = MP750_SPEED_SLOWEST;
|
||||
Blink.speed_max = MP750_SPEED_FASTEST;
|
||||
Blink.color_mode = MODE_COLORS_PER_LED;
|
||||
Blink.speed = speed;
|
||||
Blink.name = "Blink";
|
||||
Blink.value = CM_MP750_MODE_BLINK;
|
||||
Blink.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Blink.speed_min = MP750_SPEED_SLOWEST;
|
||||
Blink.speed_max = MP750_SPEED_FASTEST;
|
||||
Blink.color_mode = MODE_COLORS_PER_LED;
|
||||
Blink.speed = speed;
|
||||
modes.push_back(Blink);
|
||||
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = CM_MP750_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Breathing.speed_min = MP750_SPEED_SLOWEST;
|
||||
Breathing.speed_max = MP750_SPEED_FASTEST;
|
||||
Breathing.color_mode = MODE_COLORS_PER_LED;
|
||||
Breathing.speed = speed;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = CM_MP750_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Breathing.speed_min = MP750_SPEED_SLOWEST;
|
||||
Breathing.speed_max = MP750_SPEED_FASTEST;
|
||||
Breathing.color_mode = MODE_COLORS_PER_LED;
|
||||
Breathing.speed = speed;
|
||||
modes.push_back(Breathing);
|
||||
|
||||
mode ColorCycle;
|
||||
ColorCycle.name = "Color Cycle";
|
||||
ColorCycle.value = CM_MP750_MODE_COLOR_CYCLE;
|
||||
ColorCycle.flags = MODE_FLAG_HAS_SPEED;
|
||||
ColorCycle.speed_min = MP750_SPEED_SLOWEST;
|
||||
ColorCycle.speed_max = MP750_SPEED_FASTEST;
|
||||
ColorCycle.color_mode = MODE_COLORS_NONE;
|
||||
ColorCycle.speed = speed;
|
||||
ColorCycle.name = "Color Cycle";
|
||||
ColorCycle.value = CM_MP750_MODE_COLOR_CYCLE;
|
||||
ColorCycle.flags = MODE_FLAG_HAS_SPEED;
|
||||
ColorCycle.speed_min = MP750_SPEED_SLOWEST;
|
||||
ColorCycle.speed_max = MP750_SPEED_FASTEST;
|
||||
ColorCycle.color_mode = MODE_COLORS_NONE;
|
||||
ColorCycle.speed = speed;
|
||||
modes.push_back(ColorCycle);
|
||||
|
||||
mode BreathCycle;
|
||||
BreathCycle.name = "Breath Cycle";
|
||||
BreathCycle.value = CM_MP750_MODE_BREATH_CYCLE;
|
||||
BreathCycle.flags = MODE_FLAG_HAS_SPEED;
|
||||
BreathCycle.speed_min = MP750_SPEED_SLOWEST;
|
||||
BreathCycle.speed_max = MP750_SPEED_FASTEST;
|
||||
BreathCycle.color_mode = MODE_COLORS_NONE;
|
||||
BreathCycle.speed = speed;
|
||||
BreathCycle.name = "Breath Cycle";
|
||||
BreathCycle.value = CM_MP750_MODE_BREATH_CYCLE;
|
||||
BreathCycle.flags = MODE_FLAG_HAS_SPEED;
|
||||
BreathCycle.speed_min = MP750_SPEED_SLOWEST;
|
||||
BreathCycle.speed_max = MP750_SPEED_FASTEST;
|
||||
BreathCycle.color_mode = MODE_COLORS_NONE;
|
||||
BreathCycle.speed = speed;
|
||||
modes.push_back(BreathCycle);
|
||||
|
||||
mode Off;
|
||||
Off.name = "Turn Off";
|
||||
Off.value = CM_MP750_MODE_OFF;
|
||||
Off.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Off);
|
||||
|
||||
SetupZones();
|
||||
active_mode = cmmp750->GetMode();
|
||||
active_mode = GetDeviceMode();
|
||||
}
|
||||
|
||||
RGBController_CMMP750Controller::~RGBController_CMMP750Controller()
|
||||
@@ -84,6 +84,62 @@ RGBController_CMMP750Controller::~RGBController_CMMP750Controller()
|
||||
delete cmmp750;
|
||||
}
|
||||
|
||||
int RGBController_CMMP750Controller::GetDeviceMode()
|
||||
{
|
||||
int temp_mode = cmmp750->GetMode();
|
||||
for( int i = 0; i < modes.size(); i++)
|
||||
{
|
||||
if (temp_mode == modes[i].value)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
//If not found return 0
|
||||
return 0;
|
||||
}
|
||||
|
||||
int RGBController_CMMP750Controller::GetDeviceMode()
|
||||
{
|
||||
int temp_mode = cmmp750->GetMode();
|
||||
for( int i = 0; i < modes.size(); i++)
|
||||
{
|
||||
if (temp_mode == modes[i].value)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
//If not found return 0
|
||||
return 0;
|
||||
}
|
||||
|
||||
int RGBController_CMMP750Controller::GetDeviceMode()
|
||||
{
|
||||
int temp_mode = cmmp750->GetMode();
|
||||
for( int i = 0; i < modes.size(); i++)
|
||||
{
|
||||
if (temp_mode == modes[i].value)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
//If not found return 0
|
||||
return 0;
|
||||
}
|
||||
|
||||
int RGBController_CMMP750Controller::GetDeviceMode()
|
||||
{
|
||||
int temp_mode = cmmp750->GetMode();
|
||||
for( int i = 0; i < modes.size(); i++)
|
||||
{
|
||||
if (temp_mode == modes[i].value)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
//If not found return 0
|
||||
return 0;
|
||||
}
|
||||
|
||||
void RGBController_CMMP750Controller::SetupZones()
|
||||
{
|
||||
zone MP_zone;
|
||||
|
||||
Reference in New Issue
Block a user