Clean up warnings, except in hidapi and cli files
This commit is contained in:
parent
745bbac93b
commit
aa182936ba
40 changed files with 117 additions and 131 deletions
|
|
@ -32,24 +32,10 @@ static void send_usb_msg(hid_device* dev, char * data_pkt)
|
||||||
bytes++;
|
bytes++;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void get_usb_msg(hid_device* dev, char* data_pkt)
|
|
||||||
{
|
|
||||||
char usb_pkt[65];
|
|
||||||
usb_pkt[0] = 0x00;
|
|
||||||
for(int i = 1; i < 65; i++)
|
|
||||||
{
|
|
||||||
usb_pkt[i] = data_pkt[i-1];
|
|
||||||
}
|
|
||||||
int bytes = hid_get_feature_report(dev, (unsigned char*)data_pkt, 64);
|
|
||||||
bytes++;
|
|
||||||
}
|
|
||||||
|
|
||||||
CorsairPeripheralController::CorsairPeripheralController(hid_device* dev_handle)
|
CorsairPeripheralController::CorsairPeripheralController(hid_device* dev_handle)
|
||||||
{
|
{
|
||||||
dev = dev_handle;
|
dev = dev_handle;
|
||||||
|
|
||||||
char data_pkt[64] = { 0 };
|
|
||||||
|
|
||||||
ReadFirmwareInfo();
|
ReadFirmwareInfo();
|
||||||
|
|
||||||
SpecialFunctionControl();
|
SpecialFunctionControl();
|
||||||
|
|
@ -105,7 +91,7 @@ void CorsairPeripheralController::SetLEDsKeyboardFull(std::vector<RGBColor> colo
|
||||||
/*-----------------------------------------------------*\
|
/*-----------------------------------------------------*\
|
||||||
| Copy red, green, and blue components into buffers |
|
| Copy red, green, and blue components into buffers |
|
||||||
\*-----------------------------------------------------*/
|
\*-----------------------------------------------------*/
|
||||||
for(int color_idx = 0; color_idx < colors.size(); color_idx++)
|
for(std::size_t color_idx = 0; color_idx < colors.size(); color_idx++)
|
||||||
{
|
{
|
||||||
RGBColor color = colors[color_idx];
|
RGBColor color = colors[color_idx];
|
||||||
red_val[keys[color_idx]] = RGBGetRValue(color);
|
red_val[keys[color_idx]] = RGBGetRValue(color);
|
||||||
|
|
@ -166,7 +152,7 @@ void CorsairPeripheralController::SetLEDsKeyboardLimited(std::vector<RGBColor> c
|
||||||
/*-----------------------------------------------------*\
|
/*-----------------------------------------------------*\
|
||||||
| Scale color values to 9-bit |
|
| Scale color values to 9-bit |
|
||||||
\*-----------------------------------------------------*/
|
\*-----------------------------------------------------*/
|
||||||
for(int color_idx = 0; color_idx < colors.size(); color_idx++)
|
for(std::size_t color_idx = 0; color_idx < colors.size(); color_idx++)
|
||||||
{
|
{
|
||||||
RGBColor color = colors[color_idx];
|
RGBColor color = colors[color_idx];
|
||||||
unsigned char red = RGBGetRValue(color);
|
unsigned char red = RGBGetRValue(color);
|
||||||
|
|
@ -302,7 +288,7 @@ void CorsairPeripheralController::ReadFirmwareInfo()
|
||||||
| Send packet |
|
| Send packet |
|
||||||
\*-----------------------------------------------------*/
|
\*-----------------------------------------------------*/
|
||||||
send_usb_msg(dev, usb_buf);
|
send_usb_msg(dev, usb_buf);
|
||||||
get_usb_msg(dev, usb_buf);
|
hid_get_feature_report(dev, (unsigned char*)usb_buf, 64);
|
||||||
|
|
||||||
/*-----------------------------------------------------*\
|
/*-----------------------------------------------------*\
|
||||||
| Get device type |
|
| Get device type |
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ void DetectCorsairPeripheralControllers(std::vector<RGBController*>& rgb_control
|
||||||
|
|
||||||
hid_init();
|
hid_init();
|
||||||
|
|
||||||
for(int device_idx = 0; device_idx < CORSAIR_NUM_DEVICES; device_idx++)
|
for(std::size_t device_idx = 0; device_idx < CORSAIR_NUM_DEVICES; device_idx++)
|
||||||
{
|
{
|
||||||
dev = NULL;
|
dev = NULL;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ void HuePlusController::SetChannelEffect
|
||||||
\*-----------------------------------------------------*/
|
\*-----------------------------------------------------*/
|
||||||
else if(num_colors <= 8)
|
else if(num_colors <= 8)
|
||||||
{
|
{
|
||||||
for(int color_idx = 0; color_idx < num_colors; color_idx++)
|
for(std::size_t color_idx = 0; color_idx < num_colors; color_idx++)
|
||||||
{
|
{
|
||||||
/*-----------------------------------------------------*\
|
/*-----------------------------------------------------*\
|
||||||
| Fill in color data (40 entries per color) |
|
| Fill in color data (40 entries per color) |
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ void PatriotViperController::SetLEDEffectColor(unsigned int led, unsigned char r
|
||||||
ViperRegisterWrite(VIPER_REG_MODE, 0xFA, 0x00, 0x00);
|
ViperRegisterWrite(VIPER_REG_MODE, 0xFA, 0x00, 0x00);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PatriotViperController::SetLEDColor(unsigned int slot, unsigned int led, unsigned char red, unsigned char green, unsigned char blue)
|
void PatriotViperController::SetLEDColor(unsigned int /*slot*/, unsigned int led, unsigned char red, unsigned char green, unsigned char blue)
|
||||||
{
|
{
|
||||||
ViperRegisterWrite(VIPER_REG_START, 0xFF, 0xFF, 0xFF);
|
ViperRegisterWrite(VIPER_REG_START, 0xFF, 0xFF, 0xFF);
|
||||||
ViperRegisterWrite(VIPER_REG_STATIC, 0x04, 0x00, 0x00);
|
ViperRegisterWrite(VIPER_REG_STATIC, 0x04, 0x00, 0x00);
|
||||||
|
|
@ -136,7 +136,7 @@ void PatriotViperController::SetLEDColor(unsigned int slot, unsigned int led, un
|
||||||
ViperRegisterWrite(VIPER_REG_APPLY, 0x01, 0x00, 0x00);
|
ViperRegisterWrite(VIPER_REG_APPLY, 0x01, 0x00, 0x00);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PatriotViperController::SetLEDEffectColor(unsigned int slot, unsigned int led, unsigned char red, unsigned char green, unsigned char blue)
|
void PatriotViperController::SetLEDEffectColor(unsigned int /*slot*/, unsigned int led, unsigned char red, unsigned char green, unsigned char blue)
|
||||||
{
|
{
|
||||||
ViperRegisterWrite(VIPER_REG_START, 0xFF, 0xFF, 0xFF);
|
ViperRegisterWrite(VIPER_REG_START, 0xFF, 0xFF, 0xFF);
|
||||||
ViperRegisterWrite(VIPER_REG_STATIC, 0x04, 0x00, 0x00);
|
ViperRegisterWrite(VIPER_REG_STATIC, 0x04, 0x00, 0x00);
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ void ThermaltakeRiingController::SetChannelLEDs(unsigned char channel, RGBColor
|
||||||
{
|
{
|
||||||
unsigned char* color_data = new unsigned char[3 * num_colors];
|
unsigned char* color_data = new unsigned char[3 * num_colors];
|
||||||
|
|
||||||
for(int color = 0; color < num_colors; color++)
|
for(std::size_t color = 0; color < num_colors; color++)
|
||||||
{
|
{
|
||||||
int color_idx = color * 3;
|
int color_idx = color * 3;
|
||||||
color_data[color_idx + 0] = RGBGetGValue(colors[color]);
|
color_data[color_idx + 0] = RGBGetGValue(colors[color]);
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ bool ProfileManager::SaveProfile(std::string profile_name)
|
||||||
/*---------------------------------------------------------*\
|
/*---------------------------------------------------------*\
|
||||||
| Write controller data for each controller |
|
| Write controller data for each controller |
|
||||||
\*---------------------------------------------------------*/
|
\*---------------------------------------------------------*/
|
||||||
for(int controller_index = 0; controller_index < controllers.size(); controller_index++)
|
for(std::size_t controller_index = 0; controller_index < controllers.size(); controller_index++)
|
||||||
{
|
{
|
||||||
unsigned char *controller_data = controllers[controller_index]->GetDeviceDescription();
|
unsigned char *controller_data = controllers[controller_index]->GetDeviceDescription();
|
||||||
unsigned int controller_size;
|
unsigned int controller_size;
|
||||||
|
|
@ -148,11 +148,11 @@ bool ProfileManager::LoadProfileWithOptions
|
||||||
| Loop through all controllers. For each controller, search|
|
| Loop through all controllers. For each controller, search|
|
||||||
| all saved controllers until a match is found |
|
| all saved controllers until a match is found |
|
||||||
\*---------------------------------------------------------*/
|
\*---------------------------------------------------------*/
|
||||||
for(int controller_index = 0; controller_index < controllers.size(); controller_index++)
|
for(std::size_t controller_index = 0; controller_index < controllers.size(); controller_index++)
|
||||||
{
|
{
|
||||||
RGBController *controller_ptr = controllers[controller_index];
|
RGBController *controller_ptr = controllers[controller_index];
|
||||||
|
|
||||||
for(int temp_index = 0; temp_index < temp_controllers.size(); temp_index++)
|
for(std::size_t temp_index = 0; temp_index < temp_controllers.size(); temp_index++)
|
||||||
{
|
{
|
||||||
RGBController *temp_controller = temp_controllers[controller_index];
|
RGBController *temp_controller = temp_controllers[controller_index];
|
||||||
|
|
||||||
|
|
@ -174,7 +174,7 @@ bool ProfileManager::LoadProfileWithOptions
|
||||||
{
|
{
|
||||||
if(temp_controller->zones.size() == controller_ptr->zones.size())
|
if(temp_controller->zones.size() == controller_ptr->zones.size())
|
||||||
{
|
{
|
||||||
for(int zone_idx = 0; zone_idx < temp_controller->zones.size(); zone_idx++)
|
for(std::size_t zone_idx = 0; zone_idx < temp_controller->zones.size(); zone_idx++)
|
||||||
{
|
{
|
||||||
if((temp_controller->zones[zone_idx].name == controller_ptr->zones[zone_idx].name )
|
if((temp_controller->zones[zone_idx].name == controller_ptr->zones[zone_idx].name )
|
||||||
&&(temp_controller->zones[zone_idx].type == controller_ptr->zones[zone_idx].type )
|
&&(temp_controller->zones[zone_idx].type == controller_ptr->zones[zone_idx].type )
|
||||||
|
|
@ -198,7 +198,7 @@ bool ProfileManager::LoadProfileWithOptions
|
||||||
\*---------------------------------------------------------*/
|
\*---------------------------------------------------------*/
|
||||||
if(temp_controller->modes.size() == controller_ptr->modes.size())
|
if(temp_controller->modes.size() == controller_ptr->modes.size())
|
||||||
{
|
{
|
||||||
for(int mode_index = 0; mode_index < temp_controller->modes.size(); mode_index++)
|
for(std::size_t mode_index = 0; mode_index < temp_controller->modes.size(); mode_index++)
|
||||||
{
|
{
|
||||||
if((temp_controller->modes[mode_index].name == controller_ptr->modes[mode_index].name )
|
if((temp_controller->modes[mode_index].name == controller_ptr->modes[mode_index].name )
|
||||||
&&(temp_controller->modes[mode_index].value == controller_ptr->modes[mode_index].value )
|
&&(temp_controller->modes[mode_index].value == controller_ptr->modes[mode_index].value )
|
||||||
|
|
@ -214,7 +214,7 @@ bool ProfileManager::LoadProfileWithOptions
|
||||||
|
|
||||||
controller_ptr->modes[mode_index].colors.resize(temp_controller->modes[mode_index].colors.size());
|
controller_ptr->modes[mode_index].colors.resize(temp_controller->modes[mode_index].colors.size());
|
||||||
|
|
||||||
for(int mode_color_index = 0; mode_color_index < temp_controller->modes[mode_index].colors.size(); mode_color_index++)
|
for(std::size_t mode_color_index = 0; mode_color_index < temp_controller->modes[mode_index].colors.size(); mode_color_index++)
|
||||||
{
|
{
|
||||||
controller_ptr->modes[mode_index].colors[mode_color_index] = temp_controller->modes[mode_index].colors[mode_color_index];
|
controller_ptr->modes[mode_index].colors[mode_color_index] = temp_controller->modes[mode_index].colors[mode_color_index];
|
||||||
}
|
}
|
||||||
|
|
@ -230,7 +230,7 @@ bool ProfileManager::LoadProfileWithOptions
|
||||||
\*---------------------------------------------------------*/
|
\*---------------------------------------------------------*/
|
||||||
if(temp_controller->colors.size() == controller_ptr->colors.size())
|
if(temp_controller->colors.size() == controller_ptr->colors.size())
|
||||||
{
|
{
|
||||||
for(int color_index = 0; color_index < temp_controller->colors.size(); color_index++)
|
for(std::size_t color_index = 0; color_index < temp_controller->colors.size(); color_index++)
|
||||||
{
|
{
|
||||||
controller_ptr->colors[color_index] = temp_controller->colors[color_index];
|
controller_ptr->colors[color_index] = temp_controller->colors[color_index];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,8 +68,6 @@ void DetectOpenRazerControllers(std::vector<RGBController*> &rgb_controllers)
|
||||||
|
|
||||||
if(dir == NULL)
|
if(dir == NULL)
|
||||||
{
|
{
|
||||||
closedir(dir);
|
|
||||||
|
|
||||||
driver_to_read++;
|
driver_to_read++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -632,7 +632,7 @@ void RGBController::SetupColors()
|
||||||
\*---------------------------------------------------------*/
|
\*---------------------------------------------------------*/
|
||||||
total_led_count = 0;
|
total_led_count = 0;
|
||||||
|
|
||||||
for(int zone_idx = 0; zone_idx < zones.size(); zone_idx++)
|
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
|
||||||
{
|
{
|
||||||
total_led_count += zones[zone_idx].leds_count;
|
total_led_count += zones[zone_idx].leds_count;
|
||||||
}
|
}
|
||||||
|
|
@ -647,7 +647,7 @@ void RGBController::SetupColors()
|
||||||
\*---------------------------------------------------------*/
|
\*---------------------------------------------------------*/
|
||||||
total_led_count = 0;
|
total_led_count = 0;
|
||||||
|
|
||||||
for(int zone_idx = 0; zone_idx < zones.size(); zone_idx++)
|
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
|
||||||
{
|
{
|
||||||
zones[zone_idx].start_idx=total_led_count;
|
zones[zone_idx].start_idx=total_led_count;
|
||||||
|
|
||||||
|
|
@ -674,7 +674,7 @@ void RGBController::SetupColors()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RGBColor RGBController::GetLED(int led)
|
RGBColor RGBController::GetLED(unsigned int led)
|
||||||
{
|
{
|
||||||
if(led < colors.size())
|
if(led < colors.size())
|
||||||
{
|
{
|
||||||
|
|
@ -686,7 +686,7 @@ RGBColor RGBController::GetLED(int led)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController::SetLED(int led, RGBColor color)
|
void RGBController::SetLED(unsigned int led, RGBColor color)
|
||||||
{
|
{
|
||||||
if(led < colors.size())
|
if(led < colors.size())
|
||||||
{
|
{
|
||||||
|
|
@ -698,7 +698,7 @@ void RGBController::SetLED(int led, RGBColor color)
|
||||||
|
|
||||||
void RGBController::SetAllLEDs(RGBColor color)
|
void RGBController::SetAllLEDs(RGBColor color)
|
||||||
{
|
{
|
||||||
for(int zone_idx = 0; zone_idx < zones.size(); zone_idx++)
|
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
|
||||||
{
|
{
|
||||||
SetAllZoneLEDs(zone_idx, color);
|
SetAllZoneLEDs(zone_idx, color);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -149,8 +149,8 @@ public:
|
||||||
\*---------------------------------------------------------*/
|
\*---------------------------------------------------------*/
|
||||||
void SetupColors();
|
void SetupColors();
|
||||||
|
|
||||||
RGBColor GetLED(int led);
|
RGBColor GetLED(unsigned int led);
|
||||||
void SetLED(int led, RGBColor color);
|
void SetLED(unsigned int led, RGBColor color);
|
||||||
void SetAllLEDs(RGBColor color);
|
void SetAllLEDs(RGBColor color);
|
||||||
void SetAllZoneLEDs(int zone, RGBColor color);
|
void SetAllZoneLEDs(int zone, RGBColor color);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ int RGBController_AuraGPU::GetDeviceMode()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int mode = 0; mode < modes.size(); mode++)
|
for(std::size_t mode = 0; mode < modes.size(); mode++)
|
||||||
{
|
{
|
||||||
if(modes[mode].value == dev_mode)
|
if(modes[mode].value == dev_mode)
|
||||||
{
|
{
|
||||||
|
|
@ -156,12 +156,12 @@ void RGBController_AuraGPU::UpdateLEDs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_AuraGPU::UpdateZoneLEDs(int zone)
|
void RGBController_AuraGPU::UpdateZoneLEDs(int /*zone*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_AuraGPU::UpdateSingleLED(int led)
|
void RGBController_AuraGPU::UpdateSingleLED(int /*led*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ int RGBController_AuraSMBus::GetDeviceMode()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int mode = 0; mode < modes.size(); mode++)
|
for(std::size_t mode = 0; mode < modes.size(); mode++)
|
||||||
{
|
{
|
||||||
if(modes[mode].value == dev_mode)
|
if(modes[mode].value == dev_mode)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -229,7 +229,7 @@ void RGBController_CorsairLightingNode::SetupZones()
|
||||||
|
|
||||||
void RGBController_CorsairLightingNode::ResizeZone(int zone, int new_size)
|
void RGBController_CorsairLightingNode::ResizeZone(int zone, int new_size)
|
||||||
{
|
{
|
||||||
if((new_size >= zones[zone].leds_min) && (new_size <= zones[zone].leds_max))
|
if(((unsigned int)new_size >= zones[zone].leds_min) && ((unsigned int)new_size <= zones[zone].leds_max))
|
||||||
{
|
{
|
||||||
zones[zone].leds_count = new_size;
|
zones[zone].leds_count = new_size;
|
||||||
|
|
||||||
|
|
@ -284,7 +284,7 @@ void RGBController_CorsairLightingNode::UpdateMode()
|
||||||
|
|
||||||
if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
|
if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
|
||||||
{
|
{
|
||||||
for(int i = 0; i < modes[active_mode].colors.size(); i++)
|
for(std::size_t i = 0; i < modes[active_mode].colors.size(); i++)
|
||||||
{
|
{
|
||||||
mode_colors[(3 * i) + 0] = RGBGetRValue(modes[active_mode].colors[i]);
|
mode_colors[(3 * i) + 0] = RGBGetRValue(modes[active_mode].colors[i]);
|
||||||
mode_colors[(3 * i) + 1] = RGBGetGValue(modes[active_mode].colors[i]);
|
mode_colors[(3 * i) + 1] = RGBGetGValue(modes[active_mode].colors[i]);
|
||||||
|
|
|
||||||
|
|
@ -246,12 +246,12 @@ void RGBController_CorsairPeripheral::UpdateLEDs()
|
||||||
corsair->SetLEDs(colors);
|
corsair->SetLEDs(colors);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_CorsairPeripheral::UpdateZoneLEDs(int zone)
|
void RGBController_CorsairPeripheral::UpdateZoneLEDs(int /*zone*/)
|
||||||
{
|
{
|
||||||
corsair->SetLEDs(colors);
|
corsair->SetLEDs(colors);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_CorsairPeripheral::UpdateSingleLED(int led)
|
void RGBController_CorsairPeripheral::UpdateSingleLED(int /*led*/)
|
||||||
{
|
{
|
||||||
corsair->SetLEDs(colors);
|
corsair->SetLEDs(colors);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ void RGBController_CorsairVengeance::SetupZones()
|
||||||
SetupColors();
|
SetupColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_CorsairVengeance::ResizeZone(int zone, int new_size)
|
void RGBController_CorsairVengeance::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||||
{
|
{
|
||||||
/*---------------------------------------------------------*\
|
/*---------------------------------------------------------*\
|
||||||
| This device does not support resizing zones |
|
| This device does not support resizing zones |
|
||||||
|
|
@ -85,12 +85,12 @@ void RGBController_CorsairVengeance::UpdateLEDs()
|
||||||
corsair->SetLEDColor(red, grn, blu);
|
corsair->SetLEDColor(red, grn, blu);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_CorsairVengeance::UpdateZoneLEDs(int zone)
|
void RGBController_CorsairVengeance::UpdateZoneLEDs(int /*zone*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_CorsairVengeance::UpdateSingleLED(int led)
|
void RGBController_CorsairVengeance::UpdateSingleLED(int /*led*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ void RGBController_CorsairVengeancePro::UpdateLEDs()
|
||||||
corsair->ApplyColors();
|
corsair->ApplyColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_CorsairVengeancePro::UpdateZoneLEDs(int zone)
|
void RGBController_CorsairVengeancePro::UpdateZoneLEDs(int /*zone*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
@ -220,7 +220,7 @@ void RGBController_CorsairVengeancePro::SetCustomMode()
|
||||||
|
|
||||||
void RGBController_CorsairVengeancePro::UpdateMode()
|
void RGBController_CorsairVengeancePro::UpdateMode()
|
||||||
{
|
{
|
||||||
unsigned int corsair_direction;
|
unsigned int corsair_direction = 0;
|
||||||
bool random = (modes[active_mode].color_mode == MODE_COLORS_RANDOM);
|
bool random = (modes[active_mode].color_mode == MODE_COLORS_RANDOM);
|
||||||
unsigned char mode_colors[6];
|
unsigned char mode_colors[6];
|
||||||
|
|
||||||
|
|
@ -246,6 +246,13 @@ void RGBController_CorsairVengeancePro::UpdateMode()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mode_colors[0] = 0;
|
||||||
|
mode_colors[1] = 0;
|
||||||
|
mode_colors[2] = 0;
|
||||||
|
mode_colors[3] = 0;
|
||||||
|
mode_colors[4] = 0;
|
||||||
|
mode_colors[5] = 0;
|
||||||
|
|
||||||
if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
|
if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
|
||||||
{
|
{
|
||||||
mode_colors[0] = RGBGetRValue(modes[active_mode].colors[0]);
|
mode_colors[0] = RGBGetRValue(modes[active_mode].colors[0]);
|
||||||
|
|
@ -257,7 +264,7 @@ void RGBController_CorsairVengeancePro::UpdateMode()
|
||||||
mode_colors[3] = RGBGetRValue(modes[active_mode].colors[1]);
|
mode_colors[3] = RGBGetRValue(modes[active_mode].colors[1]);
|
||||||
mode_colors[4] = RGBGetGValue(modes[active_mode].colors[1]);
|
mode_colors[4] = RGBGetGValue(modes[active_mode].colors[1]);
|
||||||
mode_colors[5] = RGBGetBValue(modes[active_mode].colors[1]);
|
mode_colors[5] = RGBGetBValue(modes[active_mode].colors[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
corsair->SetEffect(modes[active_mode].value,
|
corsair->SetEffect(modes[active_mode].value,
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ void RGBController_Crucial::SetupZones()
|
||||||
/*---------------------------------------------------------*\
|
/*---------------------------------------------------------*\
|
||||||
| Set up LEDs |
|
| Set up LEDs |
|
||||||
\*---------------------------------------------------------*/
|
\*---------------------------------------------------------*/
|
||||||
for(int led_idx = 0; led_idx < zones[0].leds_count; led_idx++)
|
for(std::size_t led_idx = 0; led_idx < zones[0].leds_count; led_idx++)
|
||||||
{
|
{
|
||||||
led new_led;
|
led new_led;
|
||||||
new_led.name = "DRAM LED ";
|
new_led.name = "DRAM LED ";
|
||||||
|
|
@ -160,12 +160,12 @@ void RGBController_Crucial::UpdateLEDs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_Crucial::UpdateZoneLEDs(int zone)
|
void RGBController_Crucial::UpdateZoneLEDs(int /*zone*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_Crucial::UpdateSingleLED(int led)
|
void RGBController_Crucial::UpdateSingleLED(int /*led*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ void RGBController_Dummy::SetupZones()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_Dummy::ResizeZone(int zone, int new_size)
|
void RGBController_Dummy::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -28,12 +28,12 @@ void RGBController_Dummy::UpdateLEDs()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_Dummy::UpdateZoneLEDs(int zone)
|
void RGBController_Dummy::UpdateZoneLEDs(int /*zone*/)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_Dummy::UpdateSingleLED(int led)
|
void RGBController_Dummy::UpdateSingleLED(int /*led*/)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,6 @@ RGBController_E131::RGBController_E131(std::vector<E131Device> device_list)
|
||||||
|
|
||||||
devices = device_list;
|
devices = device_list;
|
||||||
|
|
||||||
unsigned int led_zone_idx = 0;
|
|
||||||
|
|
||||||
mode Direct;
|
mode Direct;
|
||||||
Direct.name = "Direct";
|
Direct.name = "Direct";
|
||||||
Direct.value = 0;
|
Direct.value = 0;
|
||||||
|
|
@ -102,7 +100,7 @@ void RGBController_E131::SetupZones()
|
||||||
SetupColors();
|
SetupColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_E131::ResizeZone(int zone, int new_size)
|
void RGBController_E131::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||||
{
|
{
|
||||||
/*---------------------------------------------------------*\
|
/*---------------------------------------------------------*\
|
||||||
| This device does not support resizing zones |
|
| This device does not support resizing zones |
|
||||||
|
|
@ -170,12 +168,12 @@ void RGBController_E131::UpdateLEDs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_E131::UpdateZoneLEDs(int zone)
|
void RGBController_E131::UpdateZoneLEDs(int /*zone*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_E131::UpdateSingleLED(int led)
|
void RGBController_E131::UpdateSingleLED(int /*led*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -128,12 +128,12 @@ void RGBController_Faustus::UpdateLEDs()
|
||||||
str_set.close();
|
str_set.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_Faustus::UpdateZoneLEDs(int zone)
|
void RGBController_Faustus::UpdateZoneLEDs(int /*zone*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_Faustus::UpdateSingleLED(int led)
|
void RGBController_Faustus::UpdateSingleLED(int /*led*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ void RGBController_Hue2::SetupZones()
|
||||||
SetupColors();
|
SetupColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_Hue2::ResizeZone(int zone, int new_size)
|
void RGBController_Hue2::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -201,7 +201,7 @@ void RGBController_HuePlus::SetupZones()
|
||||||
SetupColors();
|
SetupColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_HuePlus::ResizeZone(int zone, int new_size)
|
void RGBController_HuePlus::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -140,9 +140,9 @@ void RGBController_HyperXDRAM::SetupZones()
|
||||||
zones.push_back(*new_zone);
|
zones.push_back(*new_zone);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int zone_idx = 0; zone_idx < zones.size(); zone_idx++)
|
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
|
||||||
{
|
{
|
||||||
for(int led_idx = 0; led_idx < zones[zone_idx].leds_count; led_idx++)
|
for(std::size_t led_idx = 0; led_idx < zones[zone_idx].leds_count; led_idx++)
|
||||||
{
|
{
|
||||||
led* new_led = new led();
|
led* new_led = new led();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -301,12 +301,12 @@ void RGBController_HyperXKeyboard::UpdateLEDs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_HyperXKeyboard::UpdateZoneLEDs(int zone)
|
void RGBController_HyperXKeyboard::UpdateZoneLEDs(int /*zone*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_HyperXKeyboard::UpdateSingleLED(int led)
|
void RGBController_HyperXKeyboard::UpdateSingleLED(int /*led*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,12 +62,12 @@ void RGBController_LEDStrip::UpdateLEDs()
|
||||||
strip->SetLEDs(colors);
|
strip->SetLEDs(colors);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_LEDStrip::UpdateZoneLEDs(int zone)
|
void RGBController_LEDStrip::UpdateZoneLEDs(int /*zone*/)
|
||||||
{
|
{
|
||||||
strip->SetLEDs(colors);
|
strip->SetLEDs(colors);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_LEDStrip::UpdateSingleLED(int led)
|
void RGBController_LEDStrip::UpdateSingleLED(int /*led*/)
|
||||||
{
|
{
|
||||||
strip->SetLEDs(colors);
|
strip->SetLEDs(colors);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ void RGBController_MSI3Zone::SetupZones()
|
||||||
SetupColors();
|
SetupColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_MSI3Zone::ResizeZone(int zone, int new_size)
|
void RGBController_MSI3Zone::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||||
{
|
{
|
||||||
/*---------------------------------------------------------*\
|
/*---------------------------------------------------------*\
|
||||||
| This device does not support resizing zones |
|
| This device does not support resizing zones |
|
||||||
|
|
@ -86,12 +86,12 @@ void RGBController_MSI3Zone::UpdateLEDs()
|
||||||
msi->SetLEDs(colors);
|
msi->SetLEDs(colors);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_MSI3Zone::UpdateZoneLEDs(int zone)
|
void RGBController_MSI3Zone::UpdateZoneLEDs(int /*zone*/)
|
||||||
{
|
{
|
||||||
msi->SetLEDs(colors);
|
msi->SetLEDs(colors);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_MSI3Zone::UpdateSingleLED(int led)
|
void RGBController_MSI3Zone::UpdateSingleLED(int /*led*/)
|
||||||
{
|
{
|
||||||
msi->SetLEDs(colors);
|
msi->SetLEDs(colors);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ void RGBController_MSIRGB::SetupZones()
|
||||||
SetupColors();
|
SetupColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_MSIRGB::ResizeZone(int zone, int new_size)
|
void RGBController_MSIRGB::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -64,12 +64,12 @@ void RGBController_MSIRGB::UpdateLEDs()
|
||||||
msi->SetColor(red, grn, blu);
|
msi->SetColor(red, grn, blu);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_MSIRGB::UpdateZoneLEDs(int zone)
|
void RGBController_MSIRGB::UpdateZoneLEDs(int /*zone*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_MSIRGB::UpdateSingleLED(int led)
|
void RGBController_MSIRGB::UpdateSingleLED(int /*led*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -110,17 +110,17 @@ void RGBController_OpenRazer::UpdateLEDs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_OpenRazer::UpdateZoneLEDs(int zone)
|
void RGBController_OpenRazer::UpdateZoneLEDs(int /*zone*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_OpenRazer::UpdateSingleLED(int led)
|
void RGBController_OpenRazer::UpdateSingleLED(int /*led*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_OpenRazer::SetupMatrixDevice(std::string dev_path, unsigned int rows, unsigned int cols)
|
void RGBController_OpenRazer::SetupMatrixDevice(unsigned int rows, unsigned int cols)
|
||||||
{
|
{
|
||||||
if(!matrix_custom_frame)
|
if(!matrix_custom_frame)
|
||||||
{
|
{
|
||||||
|
|
@ -145,7 +145,7 @@ void RGBController_OpenRazer::SetupMatrixDevice(std::string dev_path, unsigned i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_OpenRazer::SetupNonMatrixDevice(std::string dev_path)
|
void RGBController_OpenRazer::SetupNonMatrixDevice()
|
||||||
{
|
{
|
||||||
matrix_type = RAZER_TYPE_NOMATRIX;
|
matrix_type = RAZER_TYPE_NOMATRIX;
|
||||||
}
|
}
|
||||||
|
|
@ -185,8 +185,6 @@ void RGBController_OpenRazer::OpenFunctions(std::string dev_path)
|
||||||
|
|
||||||
RGBController_OpenRazer::RGBController_OpenRazer(std::string dev_path)
|
RGBController_OpenRazer::RGBController_OpenRazer(std::string dev_path)
|
||||||
{
|
{
|
||||||
unsigned int led_count = 0;
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------------*\
|
/*-----------------------------------------------------------------*\
|
||||||
| Open the OpenRazer device functions |
|
| Open the OpenRazer device functions |
|
||||||
\*-----------------------------------------------------------------*/
|
\*-----------------------------------------------------------------*/
|
||||||
|
|
@ -324,11 +322,11 @@ RGBController_OpenRazer::RGBController_OpenRazer(std::string dev_path)
|
||||||
\*---------------------------------------------------------*/
|
\*---------------------------------------------------------*/
|
||||||
if(device_list[i]->matrix_type == true)
|
if(device_list[i]->matrix_type == true)
|
||||||
{
|
{
|
||||||
SetupMatrixDevice(dev_path, device_list[i]->rows, device_list[i]->cols);
|
SetupMatrixDevice(device_list[i]->rows, device_list[i]->cols);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetupNonMatrixDevice(dev_path);
|
SetupNonMatrixDevice();
|
||||||
}
|
}
|
||||||
|
|
||||||
SetupZones();
|
SetupZones();
|
||||||
|
|
|
||||||
|
|
@ -55,8 +55,8 @@ public:
|
||||||
int device_index;
|
int device_index;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SetupMatrixDevice(std::string dev_path, unsigned int rows, unsigned int cols);
|
void SetupMatrixDevice(unsigned int rows, unsigned int cols);
|
||||||
void SetupNonMatrixDevice(std::string dev_path);
|
void SetupNonMatrixDevice();
|
||||||
|
|
||||||
unsigned int matrix_type;
|
unsigned int matrix_type;
|
||||||
unsigned int matrix_rows;
|
unsigned int matrix_rows;
|
||||||
|
|
|
||||||
|
|
@ -110,17 +110,17 @@ void RGBController_OpenRazer::UpdateLEDs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_OpenRazer::UpdateZoneLEDs(int zone)
|
void RGBController_OpenRazer::UpdateZoneLEDs(int /*zone*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_OpenRazer::UpdateSingleLED(int led)
|
void RGBController_OpenRazer::UpdateSingleLED(int /*led*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_OpenRazer::SetupMatrixDevice(device * razer_device, device_fn_type* razer_functions, unsigned int rows, unsigned int cols)
|
void RGBController_OpenRazer::SetupMatrixDevice(device_fn_type* razer_functions, unsigned int rows, unsigned int cols)
|
||||||
{
|
{
|
||||||
if(!razer_functions->matrix_custom_frame)
|
if(!razer_functions->matrix_custom_frame)
|
||||||
{
|
{
|
||||||
|
|
@ -145,7 +145,7 @@ void RGBController_OpenRazer::SetupMatrixDevice(device * razer_device, device_fn
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_OpenRazer::SetupNonMatrixDevice(device * razer_device, device_fn_type* razer_functions)
|
void RGBController_OpenRazer::SetupNonMatrixDevice()
|
||||||
{
|
{
|
||||||
matrix_type = RAZER_TYPE_NOMATRIX;
|
matrix_type = RAZER_TYPE_NOMATRIX;
|
||||||
}
|
}
|
||||||
|
|
@ -157,8 +157,6 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
|
||||||
this->razer_device = razer_device;
|
this->razer_device = razer_device;
|
||||||
this->razer_functions = razer_functions;
|
this->razer_functions = razer_functions;
|
||||||
|
|
||||||
unsigned int led_count = 0;
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------------*\
|
/*-----------------------------------------------------------------*\
|
||||||
| Start device at -1. This indicates the device was not detected |
|
| Start device at -1. This indicates the device was not detected |
|
||||||
\*-----------------------------------------------------------------*/
|
\*-----------------------------------------------------------------*/
|
||||||
|
|
@ -296,11 +294,11 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
|
||||||
\*---------------------------------------------------------*/
|
\*---------------------------------------------------------*/
|
||||||
if(device_list[i]->matrix_type == true)
|
if(device_list[i]->matrix_type == true)
|
||||||
{
|
{
|
||||||
SetupMatrixDevice(razer_device, razer_functions, device_list[i]->rows, device_list[i]->cols);
|
SetupMatrixDevice(razer_functions, device_list[i]->rows, device_list[i]->cols);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetupNonMatrixDevice(razer_device, razer_functions);
|
SetupNonMatrixDevice();
|
||||||
}
|
}
|
||||||
|
|
||||||
SetupZones();
|
SetupZones();
|
||||||
|
|
|
||||||
|
|
@ -89,8 +89,8 @@ public:
|
||||||
int device_index;
|
int device_index;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SetupMatrixDevice(device * razer_device, device_fn_type* razer_functions, unsigned int rows, unsigned int cols);
|
void SetupMatrixDevice(device_fn_type* razer_functions, unsigned int rows, unsigned int cols);
|
||||||
void SetupNonMatrixDevice(device * razer_device, device_fn_type* razer_functions);
|
void SetupNonMatrixDevice();
|
||||||
|
|
||||||
unsigned int matrix_type;
|
unsigned int matrix_type;
|
||||||
unsigned int matrix_rows;
|
unsigned int matrix_rows;
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ void RGBController_PatriotViper::SetupZones()
|
||||||
/*---------------------------------------------------------*\
|
/*---------------------------------------------------------*\
|
||||||
| Set up LEDs |
|
| Set up LEDs |
|
||||||
\*---------------------------------------------------------*/
|
\*---------------------------------------------------------*/
|
||||||
for(int led_idx = 0; led_idx < zones[0].leds_count; led_idx++)
|
for(std::size_t led_idx = 0; led_idx < zones[0].leds_count; led_idx++)
|
||||||
{
|
{
|
||||||
led* new_led = new led();
|
led* new_led = new led();
|
||||||
|
|
||||||
|
|
@ -165,7 +165,7 @@ void RGBController_PatriotViper::UpdateLEDs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_PatriotViper::UpdateZoneLEDs(int zone)
|
void RGBController_PatriotViper::UpdateZoneLEDs(int /*zone*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -226,7 +226,7 @@ void RGBController_Polychrome::SetupZones()
|
||||||
SetupColors();
|
SetupColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_Polychrome::ResizeZone(int zone, int new_size)
|
void RGBController_Polychrome::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||||
{
|
{
|
||||||
/*---------------------------------------------------------*\
|
/*---------------------------------------------------------*\
|
||||||
| This device does not support resizing zones |
|
| This device does not support resizing zones |
|
||||||
|
|
@ -245,12 +245,12 @@ void RGBController_Polychrome::UpdateLEDs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_Polychrome::UpdateZoneLEDs(int zone)
|
void RGBController_Polychrome::UpdateZoneLEDs(int /*zone*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_Polychrome::UpdateSingleLED(int led)
|
void RGBController_Polychrome::UpdateSingleLED(int /*led*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -209,7 +209,7 @@ void RGBController_PoseidonZRGB::SetupZones()
|
||||||
SetupColors();
|
SetupColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_PoseidonZRGB::ResizeZone(int zone, int new_size)
|
void RGBController_PoseidonZRGB::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||||
{
|
{
|
||||||
/*---------------------------------------------------------*\
|
/*---------------------------------------------------------*\
|
||||||
| This device does not support resizing zones |
|
| This device does not support resizing zones |
|
||||||
|
|
@ -228,12 +228,12 @@ void RGBController_PoseidonZRGB::UpdateLEDs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_PoseidonZRGB::UpdateZoneLEDs(int zone)
|
void RGBController_PoseidonZRGB::UpdateZoneLEDs(int /*zone*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_PoseidonZRGB::UpdateSingleLED(int led)
|
void RGBController_PoseidonZRGB::UpdateSingleLED(int /*led*/)
|
||||||
{
|
{
|
||||||
UpdateLEDs();
|
UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ int RGBController_RGBFusion::GetDeviceMode()
|
||||||
{
|
{
|
||||||
int dev_mode = rgb_fusion->GetMode();
|
int dev_mode = rgb_fusion->GetMode();
|
||||||
|
|
||||||
for(int mode = 0; mode < modes.size(); mode++)
|
for(std::size_t mode = 0; mode < modes.size(); mode++)
|
||||||
{
|
{
|
||||||
if(modes[mode].value == dev_mode)
|
if(modes[mode].value == dev_mode)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -221,7 +221,7 @@ void RGBController_RGBFusion2USB::SetupZones()
|
||||||
SetupColors();
|
SetupColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RGBController_RGBFusion2USB::ResizeZone(int zone, int new_size)
|
void RGBController_RGBFusion2USB::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -168,7 +168,7 @@ void RGBController_ThermaltakeRiing::SetupZones()
|
||||||
|
|
||||||
void RGBController_ThermaltakeRiing::ResizeZone(int zone, int new_size)
|
void RGBController_ThermaltakeRiing::ResizeZone(int zone, int new_size)
|
||||||
{
|
{
|
||||||
if((new_size >= zones[zone].leds_min) && (new_size <= zones[zone].leds_max))
|
if(((unsigned int)new_size >= zones[zone].leds_min) && ((unsigned int)new_size <= zones[zone].leds_max))
|
||||||
{
|
{
|
||||||
zones[zone].leds_count = new_size;
|
zones[zone].leds_count = new_size;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ void Ui::OpenRGBDevicePage::on_LEDBox_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
selected_zone = selected_zone - 1;
|
selected_zone = selected_zone - 1;
|
||||||
|
|
||||||
if(index < device->zones[selected_zone].leds_count)
|
if((unsigned int)index < device->zones[selected_zone].leds_count)
|
||||||
{
|
{
|
||||||
color = device->zones[selected_zone].colors[index];
|
color = device->zones[selected_zone].colors[index];
|
||||||
}
|
}
|
||||||
|
|
@ -198,7 +198,7 @@ void Ui::OpenRGBDevicePage::on_LEDBox_currentIndexChanged(int index)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Ui::OpenRGBDevicePage::on_ModeBox_currentIndexChanged(int index)
|
void Ui::OpenRGBDevicePage::on_ModeBox_currentIndexChanged(int /*index*/)
|
||||||
{
|
{
|
||||||
/*-----------------------------------------------------*\
|
/*-----------------------------------------------------*\
|
||||||
| Update mode user interface elements |
|
| Update mode user interface elements |
|
||||||
|
|
@ -492,7 +492,7 @@ void Ui::OpenRGBDevicePage::UpdateModeUi()
|
||||||
for (std::size_t i = 0; i < device->modes[selected_mode].colors.size(); i++)
|
for (std::size_t i = 0; i < device->modes[selected_mode].colors.size(); i++)
|
||||||
{
|
{
|
||||||
char id_buf[32];
|
char id_buf[32];
|
||||||
snprintf(id_buf, 16, "Mode Color %d", i);
|
snprintf(id_buf, 16, "Mode Color %lu", i);
|
||||||
ui->LEDBox->addItem(id_buf);
|
ui->LEDBox->addItem(id_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -509,7 +509,7 @@ void Ui::OpenRGBDevicePage::UpdateMode()
|
||||||
/*-----------------------------------------------------*\
|
/*-----------------------------------------------------*\
|
||||||
| Read selected mode |
|
| Read selected mode |
|
||||||
\*-----------------------------------------------------*/
|
\*-----------------------------------------------------*/
|
||||||
unsigned int current_mode = (unsigned int)ui->ModeBox->currentIndex();
|
int current_mode = ui->ModeBox->currentIndex();
|
||||||
|
|
||||||
if(current_mode >= 0)
|
if(current_mode >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -519,9 +519,9 @@ void Ui::OpenRGBDevicePage::UpdateMode()
|
||||||
bool current_random = ui->RandomCheck->isChecked();
|
bool current_random = ui->RandomCheck->isChecked();
|
||||||
int current_dir_idx = ui->DirectionBox->currentIndex();
|
int current_dir_idx = ui->DirectionBox->currentIndex();
|
||||||
int current_direction = 0;
|
int current_direction = 0;
|
||||||
bool supports_dir_lr = ( device->modes[current_mode].flags & MODE_FLAG_HAS_DIRECTION_LR );
|
bool supports_dir_lr = ( device->modes[(unsigned int)current_mode].flags & MODE_FLAG_HAS_DIRECTION_LR );
|
||||||
bool supports_dir_ud = ( device->modes[current_mode].flags & MODE_FLAG_HAS_DIRECTION_UD );
|
bool supports_dir_ud = ( device->modes[(unsigned int)current_mode].flags & MODE_FLAG_HAS_DIRECTION_UD );
|
||||||
bool supports_dir_hv = ( device->modes[current_mode].flags & MODE_FLAG_HAS_DIRECTION_HV );
|
bool supports_dir_hv = ( device->modes[(unsigned int)current_mode].flags & MODE_FLAG_HAS_DIRECTION_HV );
|
||||||
|
|
||||||
/*-----------------------------------------------------*\
|
/*-----------------------------------------------------*\
|
||||||
| Set the direction value |
|
| Set the direction value |
|
||||||
|
|
@ -560,7 +560,7 @@ void Ui::OpenRGBDevicePage::UpdateMode()
|
||||||
current_direction = current_dir_idx;
|
current_direction = current_dir_idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
device->modes[current_mode].direction = current_direction;
|
device->modes[(unsigned int)current_mode].direction = current_direction;
|
||||||
|
|
||||||
/*-----------------------------------------------------*\
|
/*-----------------------------------------------------*\
|
||||||
| If Speed Slider is enabled, read the speed value |
|
| If Speed Slider is enabled, read the speed value |
|
||||||
|
|
@ -574,43 +574,43 @@ void Ui::OpenRGBDevicePage::UpdateMode()
|
||||||
\*-----------------------------------------------------*/
|
\*-----------------------------------------------------*/
|
||||||
if(InvertedSpeed)
|
if(InvertedSpeed)
|
||||||
{
|
{
|
||||||
current_speed = device->modes[current_mode].speed_min - current_speed + device->modes[current_mode].speed_max;
|
current_speed = device->modes[(unsigned int)current_mode].speed_min - current_speed + device->modes[current_mode].speed_max;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------*\
|
/*-----------------------------------------------------*\
|
||||||
| Don't set the mode if the current mode is invalid |
|
| Don't set the mode if the current mode is invalid |
|
||||||
\*-----------------------------------------------------*/
|
\*-----------------------------------------------------*/
|
||||||
if(current_mode < device->modes.size())
|
if((unsigned int)current_mode < device->modes.size())
|
||||||
{
|
{
|
||||||
/*-----------------------------------------------------*\
|
/*-----------------------------------------------------*\
|
||||||
| Update mode parameters |
|
| Update mode parameters |
|
||||||
\*-----------------------------------------------------*/
|
\*-----------------------------------------------------*/
|
||||||
device->modes[current_mode].speed = current_speed;
|
device->modes[(unsigned int)current_mode].speed = current_speed;
|
||||||
|
|
||||||
if(current_per_led)
|
if(current_per_led)
|
||||||
{
|
{
|
||||||
device->modes[current_mode].color_mode = MODE_COLORS_PER_LED;
|
device->modes[(unsigned int)current_mode].color_mode = MODE_COLORS_PER_LED;
|
||||||
}
|
}
|
||||||
else if(current_mode_specific)
|
else if(current_mode_specific)
|
||||||
{
|
{
|
||||||
device->modes[current_mode].color_mode = MODE_COLORS_MODE_SPECIFIC;
|
device->modes[(unsigned int)current_mode].color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||||
}
|
}
|
||||||
else if(current_random)
|
else if(current_random)
|
||||||
{
|
{
|
||||||
device->modes[current_mode].color_mode = MODE_COLORS_RANDOM;
|
device->modes[(unsigned int)current_mode].color_mode = MODE_COLORS_RANDOM;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
device->modes[current_mode].color_mode = MODE_COLORS_NONE;
|
device->modes[(unsigned int)current_mode].color_mode = MODE_COLORS_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------*\
|
/*-----------------------------------------------------*\
|
||||||
| Change device mode |
|
| Change device mode |
|
||||||
\*-----------------------------------------------------*/
|
\*-----------------------------------------------------*/
|
||||||
device->SetMode(current_mode);
|
device->SetMode((unsigned int)current_mode);
|
||||||
|
|
||||||
if(device->modes[current_mode].color_mode == MODE_COLORS_PER_LED)
|
if(device->modes[(unsigned int)current_mode].color_mode == MODE_COLORS_PER_LED)
|
||||||
{
|
{
|
||||||
device->UpdateLEDs();
|
device->UpdateLEDs();
|
||||||
}
|
}
|
||||||
|
|
@ -684,7 +684,7 @@ void Ui::OpenRGBDevicePage::on_SetDeviceButton_clicked()
|
||||||
ui->BlueSpinBox->text().toInt()
|
ui->BlueSpinBox->text().toInt()
|
||||||
);
|
);
|
||||||
|
|
||||||
for(int i = 0; i < device->modes[selected_mode].colors.size(); i++)
|
for(std::size_t i = 0; i < device->modes[selected_mode].colors.size(); i++)
|
||||||
{
|
{
|
||||||
device->modes[selected_mode].colors[i] = color;
|
device->modes[selected_mode].colors[i] = color;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -256,7 +256,7 @@ void OpenRGBDialog2::RefreshProfileList()
|
||||||
ui->ProfileBox->clear();
|
ui->ProfileBox->clear();
|
||||||
profileMenu->clear();
|
profileMenu->clear();
|
||||||
|
|
||||||
for(int profile_index = 0; profile_index < profile_manager.profile_list.size(); profile_index++)
|
for(std::size_t profile_index = 0; profile_index < profile_manager.profile_list.size(); profile_index++)
|
||||||
{
|
{
|
||||||
/*-----------------------------------------------------*\
|
/*-----------------------------------------------------*\
|
||||||
| Fill in profile combo box |
|
| Fill in profile combo box |
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,9 @@ void rgb2hsv(unsigned int rgb, hsv_t* hsv)
|
||||||
|
|
||||||
unsigned int hsv2rgb(hsv_t* hsv)
|
unsigned int hsv2rgb(hsv_t* hsv)
|
||||||
{
|
{
|
||||||
unsigned char r, g, b;
|
unsigned char r = 0;
|
||||||
|
unsigned char g = 0;
|
||||||
|
unsigned char b = 0;
|
||||||
|
|
||||||
if (hsv->saturation == 0) {
|
if (hsv->saturation == 0) {
|
||||||
r = g = b = hsv->value;
|
r = g = b = hsv->value;
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ std::string find_usb_serial_port(unsigned short vid, unsigned short pid)
|
||||||
|
|
||||||
if(dir == NULL)
|
if(dir == NULL)
|
||||||
{
|
{
|
||||||
closedir(dir);
|
|
||||||
return ret_string;
|
return ret_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue