Add additional mode parameters to RGBController API and update most of the RGBController drivers' mode specifications to match
This commit is contained in:
parent
8b8012a431
commit
2efd0dc81d
10 changed files with 449 additions and 169 deletions
|
|
@ -41,9 +41,16 @@ enum
|
|||
|
||||
enum
|
||||
{
|
||||
HUE_PLUS_MODE_FIXED = 0x00, /* Fixed colors mode */
|
||||
HUE_PLUS_MODE_FADING = 0x01, /* Fading mode */
|
||||
HUE_PLUS_MODE_SPECTRUM = 0x02, /* Spectrum cycle mode */
|
||||
HUE_PLUS_MODE_FIXED = 0x00, /* Fixed colors mode */
|
||||
HUE_PLUS_MODE_FADING = 0x01, /* Fading mode */
|
||||
HUE_PLUS_MODE_SPECTRUM = 0x02, /* Spectrum cycle mode */
|
||||
HUE_PLUS_MODE_MARQUEE = 0x03, /* Marquee mode */
|
||||
HUE_PLUS_MODE_COVER_MARQUEE = 0x04, /* Cover marquee mode */
|
||||
HUE_PLUS_MODE_ALTERNATING = 0x05, /* Alternating mode */
|
||||
HUE_PLUS_MODE_PULSING = 0x06, /* Pulsing mode */
|
||||
HUE_PLUS_MODE_BREATHING = 0x07, /* Breathing mode */
|
||||
HUE_PLUS_MODE_ALERT = 0x08, /* Alert mode */
|
||||
HUE_PLUS_MODE_CANDLELIGHT = 0x09, /* Candlelight mode */
|
||||
HUE_PLUS_NUM_MODES /* Number of Hue Plus modes */
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -25,9 +25,24 @@ typedef struct
|
|||
std::string name; /* LED name */
|
||||
} led;
|
||||
|
||||
enum
|
||||
{
|
||||
MODE_FLAG_HAS_SPEED = (1 << 0), /* Mode has speed parameter */
|
||||
MODE_FLAG_HAS_DIRECTION_LR = (1 << 1), /* Mode has left/right parameter */
|
||||
MODE_FLAG_HAS_DIRECTION_UD = (1 << 2), /* Mode has up/down parameter */
|
||||
MODE_FLAG_HAS_DIRECTION_HV = (1 << 3), /* Mode has horiz/vert parameter */
|
||||
MODE_FLAG_HAS_BRIGHTNESS = (1 << 4), /* Mode has brightness parameter */
|
||||
MODE_FLAG_HAS_COLOR = (1 << 5), /* Mode has custom color parameter */
|
||||
MODE_FLAG_RANDOM_COLOR = (1 << 6), /* Mode has random color option */
|
||||
MODE_FLAG_PER_LED_COLOR = (1 << 7), /* Mode uses device LED colors */
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
std::string name; /* Mode name */
|
||||
std::string name; /* Mode name */
|
||||
int value; /* Device-specific mode value */
|
||||
unsigned int speed; /* Mode speed parameter value */
|
||||
unsigned int flags; /* Mode flags bitfield */
|
||||
} mode;
|
||||
|
||||
typedef int zone_type;
|
||||
|
|
|
|||
|
|
@ -11,25 +11,33 @@
|
|||
|
||||
int RGBController_Aura::GetMode()
|
||||
{
|
||||
int dev_mode = aura->AuraRegisterRead(AURA_REG_MODE);
|
||||
|
||||
if (aura->AuraRegisterRead(AURA_REG_DIRECT))
|
||||
{
|
||||
return(0);
|
||||
dev_mode = 0xFFFF;
|
||||
}
|
||||
else
|
||||
|
||||
for(int mode = 0; mode < modes.size(); mode++)
|
||||
{
|
||||
return(aura->AuraRegisterRead(AURA_REG_MODE) + 1);
|
||||
if(modes[mode].value == dev_mode)
|
||||
{
|
||||
return(mode);
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
void RGBController_Aura::SetMode(int mode)
|
||||
{
|
||||
if (mode == 0)
|
||||
if (modes[mode].value == 0xFFFF)
|
||||
{
|
||||
aura->SetDirect(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
aura->SetMode(mode - 1);
|
||||
aura->SetMode(modes[mode].value);
|
||||
aura->SetDirect(false);
|
||||
}
|
||||
}
|
||||
|
|
@ -118,28 +126,65 @@ RGBController_Aura::RGBController_Aura(AuraController * aura_ptr)
|
|||
name = "ASUS Aura Motherboard";
|
||||
}
|
||||
|
||||
mode aura_modes[AURA_NUMBER_MODES + 1];
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 0xFFFF;
|
||||
Direct.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Direct);
|
||||
|
||||
aura_modes[0].name = "Direct";
|
||||
aura_modes[1].name = "Off";
|
||||
aura_modes[2].name = "Static";
|
||||
aura_modes[3].name = "Breathing";
|
||||
aura_modes[4].name = "Flashing";
|
||||
aura_modes[5].name = "Spectrum Cycle";
|
||||
aura_modes[6].name = "Rainbow";
|
||||
aura_modes[7].name = "Spectrum Cycle Breathing";
|
||||
aura_modes[8].name = "Chase Fade";
|
||||
aura_modes[9].name = "Spectrum Cycle Chase Fade";
|
||||
aura_modes[10].name = "Chase";
|
||||
aura_modes[11].name = "Spectrum Cycle Chase";
|
||||
aura_modes[12].name = "Spectrum Cycle Wave";
|
||||
aura_modes[13].name = "Chase Rainbow Pulse";
|
||||
aura_modes[14].name = "Random Flicker";
|
||||
mode Off;
|
||||
Off.name = "Off";
|
||||
Off.value = AURA_MODE_OFF;
|
||||
Off.flags = 0;
|
||||
modes.push_back(Off);
|
||||
|
||||
for (std::size_t i = 0; i < (AURA_NUMBER_MODES + 1); i++)
|
||||
{
|
||||
modes.push_back(aura_modes[i]);
|
||||
}
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = AURA_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Static);
|
||||
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = AURA_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_RANDOM_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Breathing);
|
||||
|
||||
mode Flashing;
|
||||
Flashing.name = "Flashing";
|
||||
Flashing.value = AURA_MODE_FLASHING;
|
||||
Flashing.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Flashing);
|
||||
|
||||
mode SpectrumCycle;
|
||||
SpectrumCycle.name = "Spectrum Cycle";
|
||||
SpectrumCycle.value = AURA_MODE_SPECTRUM_CYCLE;
|
||||
SpectrumCycle.flags = 0;
|
||||
modes.push_back(SpectrumCycle);
|
||||
|
||||
mode Rainbow;
|
||||
Rainbow.name = "Rainbow";
|
||||
Rainbow.value = AURA_MODE_RAINBOW;
|
||||
Rainbow.flags = 0;
|
||||
modes.push_back(Rainbow);
|
||||
|
||||
mode ChaseFade;
|
||||
ChaseFade.name = "Chase Fade";
|
||||
ChaseFade.value = AURA_MODE_CHASE_FADE;
|
||||
ChaseFade.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_RANDOM_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(ChaseFade);
|
||||
|
||||
mode Chase;
|
||||
Chase.name = "Chase";
|
||||
Chase.value = AURA_MODE_CHASE;
|
||||
Chase.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_RANDOM_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Chase);
|
||||
|
||||
mode RandomFlicker;
|
||||
RandomFlicker.name = "Random Flicker";
|
||||
RandomFlicker.value = AURA_MODE_RANDOM_FLICKER;
|
||||
RandomFlicker.flags = 0;
|
||||
modes.push_back(RandomFlicker);
|
||||
|
||||
colors.resize(aura->GetLEDCount());
|
||||
|
||||
|
|
|
|||
|
|
@ -11,17 +11,17 @@
|
|||
|
||||
int RGBController_Corsair::GetMode()
|
||||
{
|
||||
return(CORSAIR_VENGEANCE_RGB_MODE_SINGLE);
|
||||
return(0);
|
||||
}
|
||||
|
||||
void RGBController_Corsair::SetMode(int mode)
|
||||
{
|
||||
corsair->SetMode(mode);
|
||||
corsair->SetMode(modes[mode].value);
|
||||
}
|
||||
|
||||
void RGBController_Corsair::SetCustomMode()
|
||||
{
|
||||
|
||||
corsair->SetMode(CORSAIR_VENGEANCE_RGB_MODE_SINGLE);
|
||||
}
|
||||
|
||||
void RGBController_Corsair::UpdateLEDs()
|
||||
|
|
@ -53,16 +53,23 @@ RGBController_Corsair::RGBController_Corsair(CorsairController* corsair_ptr)
|
|||
|
||||
type = DEVICE_TYPE_DRAM;
|
||||
|
||||
mode corsair_modes[CORSAIR_NUMBER_MODES];
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = CORSAIR_VENGEANCE_RGB_MODE_SINGLE;
|
||||
Static.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Static);
|
||||
|
||||
corsair_modes[0].name = "Static";
|
||||
corsair_modes[1].name = "Fade";
|
||||
corsair_modes[2].name = "Pulse";
|
||||
mode Fade;
|
||||
Fade.name = "Fade";
|
||||
Fade.value = CORSAIR_VENGEANCE_RGB_MODE_FADE;
|
||||
Fade.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Fade);
|
||||
|
||||
for (int i = 0; i < CORSAIR_NUMBER_MODES; i++)
|
||||
{
|
||||
modes.push_back(corsair_modes[i]);
|
||||
}
|
||||
mode Pulse;
|
||||
Pulse.name = "Pulse";
|
||||
Pulse.value = CORSAIR_VENGEANCE_RGB_MODE_PULSE;
|
||||
Pulse.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Pulse);
|
||||
|
||||
for (unsigned int i = 0; i < corsair->GetLEDCount(); i++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,38 +11,14 @@
|
|||
|
||||
int RGBController_CorsairPro::GetMode()
|
||||
{
|
||||
switch (corsair->GetEffect())
|
||||
int dev_mode = corsair->GetEffect();
|
||||
|
||||
for(int mode = 0; mode < modes.size(); mode++)
|
||||
{
|
||||
case CORSAIR_PRO_MODE_COLOR_SHIFT:
|
||||
return(0);
|
||||
break;
|
||||
case CORSAIR_PRO_MODE_COLOR_PULSE:
|
||||
return(1);
|
||||
break;
|
||||
case CORSAIR_PRO_MODE_RAINBOW_WAVE:
|
||||
return(2);
|
||||
break;
|
||||
case CORSAIR_PRO_MODE_COLOR_WAVE:
|
||||
return(3);
|
||||
break;
|
||||
case CORSAIR_PRO_MODE_VISOR:
|
||||
return(4);
|
||||
break;
|
||||
case CORSAIR_PRO_MODE_RAIN:
|
||||
return(5);
|
||||
break;
|
||||
case CORSAIR_PRO_MODE_MARQUEE:
|
||||
return(6);
|
||||
break;
|
||||
case CORSAIR_PRO_MODE_RAINBOW:
|
||||
return(7);
|
||||
break;
|
||||
case CORSAIR_PRO_MODE_SEQUENTIAL:
|
||||
return(8);
|
||||
break;
|
||||
case CORSAIR_PRO_MODE_STATIC:
|
||||
return(9);
|
||||
break;
|
||||
if(modes[mode].value == dev_mode)
|
||||
{
|
||||
return(mode);
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
|
|
@ -50,39 +26,7 @@ int RGBController_CorsairPro::GetMode()
|
|||
|
||||
void RGBController_CorsairPro::SetMode(int mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case 0:
|
||||
corsair->SetEffect(CORSAIR_PRO_MODE_COLOR_SHIFT);
|
||||
break;
|
||||
case 1:
|
||||
corsair->SetEffect(CORSAIR_PRO_MODE_COLOR_PULSE);
|
||||
break;
|
||||
case 2:
|
||||
corsair->SetEffect(CORSAIR_PRO_MODE_RAINBOW_WAVE);
|
||||
break;
|
||||
case 3:
|
||||
corsair->SetEffect(CORSAIR_PRO_MODE_COLOR_WAVE);
|
||||
break;
|
||||
case 4:
|
||||
corsair->SetEffect(CORSAIR_PRO_MODE_VISOR);
|
||||
break;
|
||||
case 5:
|
||||
corsair->SetEffect(CORSAIR_PRO_MODE_RAIN);
|
||||
break;
|
||||
case 6:
|
||||
corsair->SetEffect(CORSAIR_PRO_MODE_MARQUEE);
|
||||
break;
|
||||
case 7:
|
||||
corsair->SetEffect(CORSAIR_PRO_MODE_RAINBOW);
|
||||
break;
|
||||
case 8:
|
||||
corsair->SetEffect(CORSAIR_PRO_MODE_SEQUENTIAL);
|
||||
break;
|
||||
case 9:
|
||||
corsair->SetEffect(CORSAIR_PRO_MODE_STATIC);
|
||||
break;
|
||||
}
|
||||
corsair->SetEffect(modes[mode].value);
|
||||
}
|
||||
|
||||
void RGBController_CorsairPro::SetCustomMode()
|
||||
|
|
@ -129,23 +73,65 @@ RGBController_CorsairPro::RGBController_CorsairPro(CorsairProController* corsair
|
|||
|
||||
type = DEVICE_TYPE_DRAM;
|
||||
|
||||
mode corsair_modes[CORSAIR_PRO_NUMBER_MODES];
|
||||
mode ColorShift;
|
||||
ColorShift.name = "Color Shift";
|
||||
ColorShift.value = CORSAIR_PRO_MODE_COLOR_SHIFT;
|
||||
ColorShift.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_COLOR | MODE_FLAG_RANDOM_COLOR;
|
||||
modes.push_back(ColorShift);
|
||||
|
||||
corsair_modes[0].name = "Color Shift";
|
||||
corsair_modes[1].name = "Color Pulse";
|
||||
corsair_modes[2].name = "Rainbow Wave";
|
||||
corsair_modes[3].name = "Color Wave";
|
||||
corsair_modes[4].name = "Visor";
|
||||
corsair_modes[5].name = "Rain";
|
||||
corsair_modes[6].name = "Marquee";
|
||||
corsair_modes[7].name = "Rainbow";
|
||||
corsair_modes[8].name = "Sequential";
|
||||
corsair_modes[9].name = "Static";
|
||||
mode ColorPulse;
|
||||
ColorPulse.name = "Color Pulse";
|
||||
ColorPulse.value = CORSAIR_PRO_MODE_COLOR_PULSE;
|
||||
ColorPulse.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_COLOR | MODE_FLAG_RANDOM_COLOR;
|
||||
modes.push_back(ColorPulse);
|
||||
|
||||
for (int i = 0; i < CORSAIR_PRO_NUMBER_MODES; i++)
|
||||
{
|
||||
modes.push_back(corsair_modes[i]);
|
||||
}
|
||||
mode RainbowWave;
|
||||
RainbowWave.name = "Rainbow Wave";
|
||||
RainbowWave.value = CORSAIR_PRO_MODE_RAINBOW_WAVE;
|
||||
RainbowWave.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD;
|
||||
modes.push_back(RainbowWave);
|
||||
|
||||
mode ColorWave;
|
||||
ColorWave.name = "Color Wave";
|
||||
ColorWave.value = CORSAIR_PRO_MODE_COLOR_WAVE;
|
||||
ColorWave.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_COLOR | MODE_FLAG_RANDOM_COLOR;
|
||||
modes.push_back(ColorWave);
|
||||
|
||||
mode Visor;
|
||||
Visor.name = "Visor";
|
||||
Visor.value = CORSAIR_PRO_MODE_VISOR;
|
||||
Visor.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_HV | MODE_FLAG_HAS_COLOR | MODE_FLAG_RANDOM_COLOR;
|
||||
modes.push_back(Visor);
|
||||
|
||||
mode Rain;
|
||||
Rain.name = "Rain";
|
||||
Rain.value = CORSAIR_PRO_MODE_RAIN;
|
||||
Rain.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_COLOR | MODE_FLAG_RANDOM_COLOR;
|
||||
modes.push_back(Rain);
|
||||
|
||||
mode Marquee;
|
||||
Marquee.name = "Marquee";
|
||||
Marquee.value = CORSAIR_PRO_MODE_MARQUEE;
|
||||
Marquee.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_COLOR;
|
||||
modes.push_back(Marquee);
|
||||
|
||||
mode Rainbow;
|
||||
Rainbow.name = "Rainbow";
|
||||
Rainbow.value = CORSAIR_PRO_MODE_RAINBOW;
|
||||
Rainbow.flags = MODE_FLAG_HAS_SPEED;
|
||||
modes.push_back(Rainbow);
|
||||
|
||||
mode Sequential;
|
||||
Sequential.name = "Sequential";
|
||||
Sequential.value = CORSAIR_PRO_MODE_SEQUENTIAL;
|
||||
Sequential.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_COLOR | MODE_FLAG_RANDOM_COLOR;
|
||||
modes.push_back(Sequential);
|
||||
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = CORSAIR_PRO_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Static);
|
||||
|
||||
colors.resize(corsair->GetLEDCount());
|
||||
|
||||
|
|
|
|||
|
|
@ -17,9 +17,53 @@ RGBController_Hue2::RGBController_Hue2(Hue2Controller* hue2_ptr)
|
|||
|
||||
type = DEVICE_TYPE_LEDSTRIP;
|
||||
|
||||
mode led_mode;
|
||||
led_mode.name = "Custom";
|
||||
modes.push_back(led_mode);
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = HUE_2_MODE_FIXED;
|
||||
Direct.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Direct);
|
||||
|
||||
mode Fading;
|
||||
Fading.name = "Fading";
|
||||
Fading.value = HUE_2_MODE_FADING;
|
||||
Fading.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Fading);
|
||||
|
||||
mode SpectrumCycle;
|
||||
SpectrumCycle.name = "Spectrum Cycle";
|
||||
SpectrumCycle.value = HUE_2_MODE_SPECTRUM;
|
||||
SpectrumCycle.flags = 0;
|
||||
modes.push_back(SpectrumCycle);
|
||||
|
||||
mode Marquee;
|
||||
Marquee.name = "Marquee";
|
||||
Marquee.value = HUE_2_MODE_MARQUEE;
|
||||
Marquee.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Marquee);
|
||||
|
||||
mode CoverMarquee;
|
||||
CoverMarquee.name = "Cover Marquee";
|
||||
CoverMarquee.value = HUE_2_MODE_COVER_MARQUEE;
|
||||
CoverMarquee.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(CoverMarquee);
|
||||
|
||||
mode Alternating;
|
||||
Alternating.name = "Alternating";
|
||||
Alternating.value = HUE_2_MODE_ALTERNATING;
|
||||
Alternating.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Alternating);
|
||||
|
||||
mode Pulsing;
|
||||
Pulsing.name = "Pulsing";
|
||||
Pulsing.value = HUE_2_MODE_PULSING;
|
||||
Pulsing.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Pulsing);
|
||||
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = HUE_2_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Breathing);
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Set size of colors array |
|
||||
|
|
@ -80,9 +124,27 @@ int RGBController_Hue2::GetMode()
|
|||
return 0;
|
||||
}
|
||||
|
||||
void RGBController_Hue2::SetMode(int /*mode*/)
|
||||
void RGBController_Hue2::SetMode(int mode)
|
||||
{
|
||||
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)
|
||||
{
|
||||
hue2->SetChannelEffect(channel, modes[mode].value, channel_colors);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_Hue2::SetCustomMode()
|
||||
|
|
|
|||
|
|
@ -19,9 +19,65 @@ RGBController_HuePlus::RGBController_HuePlus(HuePlusController* hueplus_ptr)
|
|||
|
||||
location = hueplus->GetLEDString();
|
||||
|
||||
mode led_mode;
|
||||
led_mode.name = "Custom";
|
||||
modes.push_back(led_mode);
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = HUE_PLUS_MODE_FIXED;
|
||||
Direct.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Direct);
|
||||
|
||||
mode Fading;
|
||||
Fading.name = "Fading";
|
||||
Fading.value = HUE_PLUS_MODE_FADING;
|
||||
Fading.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Fading);
|
||||
|
||||
mode SpectrumCycle;
|
||||
SpectrumCycle.name = "Spectrum Cycle";
|
||||
SpectrumCycle.value = HUE_PLUS_MODE_SPECTRUM;
|
||||
SpectrumCycle.flags = 0;
|
||||
modes.push_back(SpectrumCycle);
|
||||
|
||||
mode Marquee;
|
||||
Marquee.name = "Marquee";
|
||||
Marquee.value = HUE_PLUS_MODE_MARQUEE;
|
||||
Marquee.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Marquee);
|
||||
|
||||
mode CoverMarquee;
|
||||
CoverMarquee.name = "Cover Marquee";
|
||||
CoverMarquee.value = HUE_PLUS_MODE_COVER_MARQUEE;
|
||||
CoverMarquee.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(CoverMarquee);
|
||||
|
||||
mode Alternating;
|
||||
Alternating.name = "Alternating";
|
||||
Alternating.value = HUE_PLUS_MODE_ALTERNATING;
|
||||
Alternating.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Alternating);
|
||||
|
||||
mode Pulsing;
|
||||
Pulsing.name = "Pulsing";
|
||||
Pulsing.value = HUE_PLUS_MODE_PULSING;
|
||||
Pulsing.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Pulsing);
|
||||
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = HUE_PLUS_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Breathing);
|
||||
|
||||
mode Alert;
|
||||
Alert.name = "Alert";
|
||||
Alert.value = HUE_PLUS_MODE_ALERT;
|
||||
Alert.flags = 0;
|
||||
modes.push_back(Alert);
|
||||
|
||||
mode Candlelight;
|
||||
Candlelight.name = "Candlelight";
|
||||
Candlelight.value = HUE_PLUS_MODE_CANDLELIGHT;
|
||||
Candlelight.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Candlelight);
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Set size of colors array |
|
||||
|
|
@ -82,9 +138,27 @@ int RGBController_HuePlus::GetMode()
|
|||
return 0;
|
||||
}
|
||||
|
||||
void RGBController_HuePlus::SetMode(int /*mode*/)
|
||||
void RGBController_HuePlus::SetMode(int mode)
|
||||
{
|
||||
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)
|
||||
{
|
||||
hueplus->SetChannelEffect(channel, modes[mode].value, channel_colors);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_HuePlus::SetCustomMode()
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ int RGBController_HyperX::GetMode()
|
|||
|
||||
void RGBController_HyperX::SetMode(int mode)
|
||||
{
|
||||
hyperx->SetMode(mode);
|
||||
hyperx->SetMode(modes[mode].value);
|
||||
}
|
||||
|
||||
void RGBController_HyperX::SetCustomMode()
|
||||
|
|
@ -105,22 +105,59 @@ RGBController_HyperX::RGBController_HyperX(HyperXController* hyperx_ptr)
|
|||
|
||||
type = DEVICE_TYPE_DRAM;
|
||||
|
||||
mode hyperx_modes[HYPERX_NUMBER_MODES];
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = HYPERX_MODE_DIRECT;
|
||||
Direct.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Direct);
|
||||
|
||||
hyperx_modes[0].name = "Direct";
|
||||
hyperx_modes[1].name = "Static";
|
||||
hyperx_modes[2].name = "Rainbow";
|
||||
hyperx_modes[3].name = "Comet";
|
||||
hyperx_modes[4].name = "Heartbeat";
|
||||
hyperx_modes[5].name = "Spectrum Cycle";
|
||||
hyperx_modes[6].name = "Breathing";
|
||||
hyperx_modes[7].name = "Bounce";
|
||||
hyperx_modes[8].name = "Blink";
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = HYPERX_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_COLOR;
|
||||
modes.push_back(Static);
|
||||
|
||||
mode Rainbow;
|
||||
Rainbow.name = "Rainbow";
|
||||
Rainbow.value = HYPERX_MODE_RAINBOW;
|
||||
Rainbow.flags = 0;
|
||||
modes.push_back(Rainbow);
|
||||
|
||||
mode Comet;
|
||||
Comet.name = "Comet";
|
||||
Comet.value = HYPERX_MODE_COMET;
|
||||
Comet.flags = MODE_FLAG_HAS_COLOR;
|
||||
modes.push_back(Comet);
|
||||
|
||||
mode Heartbeat;
|
||||
Heartbeat.name = "Heartbeat";
|
||||
Heartbeat.value = HYPERX_MODE_HEARTBEAT;
|
||||
Heartbeat.flags = MODE_FLAG_HAS_COLOR;
|
||||
modes.push_back(Heartbeat);
|
||||
|
||||
mode SpectrumCycle;
|
||||
SpectrumCycle.name = "Spectrum Cycle";
|
||||
SpectrumCycle.value = HYPERX_MODE_CYCLE;
|
||||
SpectrumCycle.flags = 0;
|
||||
modes.push_back(SpectrumCycle);
|
||||
|
||||
for (int i = 0; i < HYPERX_NUMBER_MODES; i++)
|
||||
{
|
||||
modes.push_back(hyperx_modes[i]);
|
||||
}
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = HYPERX_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_COLOR;
|
||||
modes.push_back(Breathing);
|
||||
|
||||
mode Bounce;
|
||||
Bounce.name = "Bounce";
|
||||
Bounce.value = HYPERX_MODE_BOUNCE;
|
||||
Bounce.flags = MODE_FLAG_HAS_COLOR;
|
||||
modes.push_back(Bounce);
|
||||
|
||||
mode Blink;
|
||||
Blink.name = "Blink";
|
||||
Blink.value = HYPERX_MODE_BLINK;
|
||||
Blink.flags = MODE_FLAG_HAS_COLOR;
|
||||
modes.push_back(Blink);
|
||||
|
||||
colors.resize(hyperx->GetLEDCount());
|
||||
|
||||
|
|
|
|||
|
|
@ -16,13 +16,13 @@ int RGBController_PatriotViper::GetMode()
|
|||
|
||||
void RGBController_PatriotViper::SetMode(int mode)
|
||||
{
|
||||
if(mode == 0)
|
||||
if(modes[mode].value == 0xFFFF)
|
||||
{
|
||||
viper->SetDirect();
|
||||
}
|
||||
else
|
||||
{
|
||||
viper->SetMode(mode - 1);
|
||||
viper->SetMode(modes[mode].value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -88,23 +88,53 @@ RGBController_PatriotViper::RGBController_PatriotViper(PatriotViperController* v
|
|||
|
||||
type = DEVICE_TYPE_DRAM;
|
||||
|
||||
mode viper_modes[10];
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 0xFFFF;
|
||||
Direct.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Direct);
|
||||
|
||||
viper_modes[0].name = "Direct";
|
||||
viper_modes[1].name = "Dark";
|
||||
viper_modes[2].name = "Breathing";
|
||||
viper_modes[3].name = "Viper";
|
||||
viper_modes[4].name = "Heartbeat";
|
||||
viper_modes[5].name = "Marquee";
|
||||
viper_modes[6].name = "Raindrop";
|
||||
viper_modes[7].name = "Aurora";
|
||||
viper_modes[8].name = "Unknown";
|
||||
viper_modes[9].name = "Neon";
|
||||
mode Dark;
|
||||
Dark.name = "Dark";
|
||||
Dark.value = VIPER_MODE_DARK;
|
||||
Dark.flags = 0;
|
||||
modes.push_back(Dark);
|
||||
|
||||
for (int i = 0; i < 9; i++)
|
||||
{
|
||||
modes.push_back(viper_modes[i]);
|
||||
}
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = VIPER_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Breathing);
|
||||
|
||||
mode Viper;
|
||||
Viper.name = "Viper";
|
||||
Viper.value = VIPER_MODE_VIPER;
|
||||
Viper.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Viper);
|
||||
|
||||
mode Heartbeat;
|
||||
Heartbeat.name = "Heartbeat";
|
||||
Heartbeat.value = VIPER_MODE_HEARTBEAT;
|
||||
Heartbeat.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Heartbeat);
|
||||
|
||||
mode Marquee;
|
||||
Marquee.name = "Marquee";
|
||||
Marquee.value = VIPER_MODE_MARQUEE;
|
||||
Marquee.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Marquee);
|
||||
|
||||
mode Raindrop;
|
||||
Raindrop.name = "Raindrop";
|
||||
Raindrop.value = VIPER_MODE_RAINDROP;
|
||||
Raindrop.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Raindrop);
|
||||
|
||||
mode Aurora;
|
||||
Aurora.name = "Aurora";
|
||||
Aurora.value = VIPER_MODE_AURORA;
|
||||
Aurora.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Aurora);
|
||||
|
||||
colors.resize(viper->GetLEDCount());
|
||||
|
||||
|
|
|
|||
|
|
@ -11,12 +11,22 @@
|
|||
|
||||
int RGBController_RGBFusion::GetMode()
|
||||
{
|
||||
return(rgb_fusion->GetMode());
|
||||
int dev_mode = rgb_fusion->GetMode();
|
||||
|
||||
for(int mode = 0; mode < modes.size(); mode++)
|
||||
{
|
||||
if(modes[mode].value == dev_mode)
|
||||
{
|
||||
return(mode);
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
void RGBController_RGBFusion::SetMode(int mode)
|
||||
{
|
||||
rgb_fusion->SetMode(mode);
|
||||
rgb_fusion->SetMode(modes[mode].value);
|
||||
}
|
||||
|
||||
void RGBController_RGBFusion::SetCustomMode()
|
||||
|
|
@ -68,16 +78,23 @@ RGBController_RGBFusion::RGBController_RGBFusion(RGBFusionController* rgb_fusion
|
|||
|
||||
type = DEVICE_TYPE_MOTHERBOARD;
|
||||
|
||||
mode rgb_fusion_modes[RGB_FUSION_NUMBER_MODES];
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = RGB_FUSION_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
|
||||
modes.push_back(Static);
|
||||
|
||||
rgb_fusion_modes[0].name = "Static";
|
||||
rgb_fusion_modes[1].name = "Breathing";
|
||||
rgb_fusion_modes[2].name = "Flashing";
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = RGB_FUSION_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_COLOR;
|
||||
modes.push_back(Breathing);
|
||||
|
||||
for (int i = 0; i < RGB_FUSION_NUMBER_MODES; i++)
|
||||
{
|
||||
modes.push_back(rgb_fusion_modes[i]);
|
||||
}
|
||||
mode Flashing;
|
||||
Flashing.name = "Flashing";
|
||||
Flashing.value = RGB_FUSION_MODE_FLASHING;
|
||||
Flashing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_COLOR;
|
||||
modes.push_back(Flashing);
|
||||
|
||||
colors.resize(rgb_fusion->GetLEDCount());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue