|
|
|
|
@ -101,20 +101,20 @@ RGBController_ThermaltakeRiing::RGBController_ThermaltakeRiing(ThermaltakeRiingC
|
|
|
|
|
Static.colors.resize(1);
|
|
|
|
|
modes.push_back(Static);
|
|
|
|
|
|
|
|
|
|
SetupZones();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RGBController_ThermaltakeRiing::SetupZones()
|
|
|
|
|
{
|
|
|
|
|
/*-------------------------------------------------*\
|
|
|
|
|
| Set size of colors array |
|
|
|
|
|
| Clear any existing zone/LED configuration |
|
|
|
|
|
\*-------------------------------------------------*/
|
|
|
|
|
unsigned int led_count = 0;
|
|
|
|
|
for (unsigned int channel_idx = 0; channel_idx < 5; channel_idx++)
|
|
|
|
|
{
|
|
|
|
|
led_count += riing->channel_leds[channel_idx];
|
|
|
|
|
}
|
|
|
|
|
colors.resize(led_count);
|
|
|
|
|
leds.clear();
|
|
|
|
|
zones.clear();
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------*\
|
|
|
|
|
| Set zones and leds |
|
|
|
|
|
\*-------------------------------------------------*/
|
|
|
|
|
unsigned int led_idx = 0;
|
|
|
|
|
for (unsigned int channel_idx = 0; channel_idx < 5; channel_idx++)
|
|
|
|
|
{
|
|
|
|
|
if(riing->channel_leds[channel_idx] > 0)
|
|
|
|
|
@ -128,7 +128,9 @@ RGBController_ThermaltakeRiing::RGBController_ThermaltakeRiing(ThermaltakeRiingC
|
|
|
|
|
new_zone->name.append(ch_idx_string);
|
|
|
|
|
new_zone->type = ZONE_TYPE_LINEAR;
|
|
|
|
|
|
|
|
|
|
std::vector<int> *new_zone_map = new std::vector<int>();
|
|
|
|
|
new_zone->leds_min = 0;
|
|
|
|
|
new_zone->leds_max = 60;
|
|
|
|
|
new_zone->leds_count = riing->channel_leds[channel_idx];
|
|
|
|
|
|
|
|
|
|
for (unsigned int led_ch_idx = 0; led_ch_idx < riing->channel_leds[channel_idx]; led_ch_idx++)
|
|
|
|
|
{
|
|
|
|
|
@ -143,79 +145,40 @@ RGBController_ThermaltakeRiing::RGBController_ThermaltakeRiing(ThermaltakeRiingC
|
|
|
|
|
|
|
|
|
|
leds.push_back(new_led);
|
|
|
|
|
leds_channel.push_back(channel_idx + 1);
|
|
|
|
|
|
|
|
|
|
new_zone_map->push_back(led_idx);
|
|
|
|
|
led_idx++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
new_zone->map.push_back(*new_zone_map);
|
|
|
|
|
zones.push_back(*new_zone);
|
|
|
|
|
zones_channel.push_back(channel_idx + 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SetupColors();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RGBController_ThermaltakeRiing::ResizeZone(int zone, int new_size)
|
|
|
|
|
{
|
|
|
|
|
riing->channel_leds[zone] = new_size;
|
|
|
|
|
|
|
|
|
|
SetupZones();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RGBController_ThermaltakeRiing::UpdateLEDs()
|
|
|
|
|
{
|
|
|
|
|
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
|
|
|
|
|
{
|
|
|
|
|
unsigned int channel = zones_channel[zone_idx];
|
|
|
|
|
|
|
|
|
|
std::vector<RGBColor> channel_colors;
|
|
|
|
|
|
|
|
|
|
for(std::size_t color = 0; color < colors.size(); color++)
|
|
|
|
|
{
|
|
|
|
|
if(leds_channel[color] == channel)
|
|
|
|
|
{
|
|
|
|
|
channel_colors.push_back(colors[color]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(channel_colors.size() > 0)
|
|
|
|
|
{
|
|
|
|
|
riing->SetChannelLEDs(channel, channel_colors);
|
|
|
|
|
}
|
|
|
|
|
riing->SetChannelLEDs(zone_idx, zones[zone_idx].colors, zones[zone_idx].leds_count);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RGBController_ThermaltakeRiing::UpdateZoneLEDs(int zone)
|
|
|
|
|
{
|
|
|
|
|
unsigned int channel = zones_channel[zone];
|
|
|
|
|
|
|
|
|
|
std::vector<RGBColor> channel_colors;
|
|
|
|
|
|
|
|
|
|
for(std::size_t color = 0; color < colors.size(); color++)
|
|
|
|
|
{
|
|
|
|
|
if(leds_channel[color] == channel)
|
|
|
|
|
{
|
|
|
|
|
channel_colors.push_back(colors[color]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(channel_colors.size() > 0)
|
|
|
|
|
{
|
|
|
|
|
riing->SetChannelLEDs(channel, channel_colors);
|
|
|
|
|
}
|
|
|
|
|
riing->SetChannelLEDs(zone, zones[zone].colors, zones[zone].leds_count);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RGBController_ThermaltakeRiing::UpdateSingleLED(int led)
|
|
|
|
|
{
|
|
|
|
|
unsigned int channel = leds_channel[led];
|
|
|
|
|
|
|
|
|
|
std::vector<RGBColor> channel_colors;
|
|
|
|
|
|
|
|
|
|
for(std::size_t color = 0; color < colors.size(); color++)
|
|
|
|
|
{
|
|
|
|
|
if(leds_channel[color] == channel)
|
|
|
|
|
{
|
|
|
|
|
channel_colors.push_back(colors[color]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(channel_colors.size() > 0)
|
|
|
|
|
{
|
|
|
|
|
riing->SetChannelLEDs(channel, channel_colors);
|
|
|
|
|
}
|
|
|
|
|
riing->SetChannelLEDs(channel, zones[channel].colors, zones[channel].leds_count);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RGBController_ThermaltakeRiing::SetCustomMode()
|
|
|
|
|
@ -227,22 +190,7 @@ void RGBController_ThermaltakeRiing::UpdateMode()
|
|
|
|
|
{
|
|
|
|
|
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
|
|
|
|
|
{
|
|
|
|
|
unsigned int channel = zones_channel[zone_idx];
|
|
|
|
|
|
|
|
|
|
std::vector<RGBColor> channel_colors;
|
|
|
|
|
|
|
|
|
|
for(std::size_t color = 0; color < colors.size(); color++)
|
|
|
|
|
{
|
|
|
|
|
if(leds_channel[color] == channel)
|
|
|
|
|
{
|
|
|
|
|
channel_colors.push_back(colors[color]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(channel_colors.size() > 0)
|
|
|
|
|
{
|
|
|
|
|
riing->SetMode(modes[active_mode].value, modes[active_mode].speed);
|
|
|
|
|
riing->SetChannelLEDs(channel, channel_colors);
|
|
|
|
|
}
|
|
|
|
|
riing->SetMode(modes[active_mode].value, modes[active_mode].speed);
|
|
|
|
|
riing->SetChannelLEDs(zone_idx, zones[zone_idx].colors, zones[zone_idx].leds_count);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|