mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-05-24 06:25:01 -04:00
Added brightness control to CMR6000 device for color cycle mode
Commits merged by Adam Honse <calcprogrammer1@gmail.com>
This commit is contained in:
@@ -104,12 +104,17 @@ unsigned char CMR6000Controller::GetLedSpeed()
|
||||
return current_speed;
|
||||
}
|
||||
|
||||
unsigned char CMR6000Controller::GetBrightness()
|
||||
{
|
||||
return current_brightness;
|
||||
}
|
||||
|
||||
bool CMR6000Controller::GetRandomColours()
|
||||
{
|
||||
return current_random;
|
||||
}
|
||||
|
||||
void CMR6000Controller::SetMode(unsigned char mode, unsigned char speed, unsigned char red, unsigned char green, unsigned char blue, unsigned char random)
|
||||
void CMR6000Controller::SetMode(unsigned char mode, unsigned char speed, unsigned char red, unsigned char green, unsigned char blue, unsigned char random, unsigned char brightness)
|
||||
{
|
||||
current_mode = mode;
|
||||
current_speed = speed;
|
||||
@@ -117,7 +122,7 @@ void CMR6000Controller::SetMode(unsigned char mode, unsigned char speed, unsigne
|
||||
current_green = green;
|
||||
current_blue = blue;
|
||||
current_random = random;
|
||||
current_brightness = (current_mode == CM_MR6000_MODE_COLOR_CYCLE) ? 0x7F : 0xFF; //Color_Cycle brightness needs to be clamped to 0x7F to avoid wash out
|
||||
current_brightness = brightness;
|
||||
|
||||
SendUpdate();
|
||||
}
|
||||
|
||||
@@ -56,8 +56,9 @@ public:
|
||||
unsigned char GetLedGreen();
|
||||
unsigned char GetLedBlue();
|
||||
unsigned char GetLedSpeed();
|
||||
unsigned char GetBrightness();
|
||||
bool GetRandomColours();
|
||||
void SetMode(unsigned char mode, unsigned char speed, unsigned char red, unsigned char green, unsigned char blue, unsigned char random);
|
||||
void SetMode(unsigned char mode, unsigned char speed, unsigned char red, unsigned char green, unsigned char blue, unsigned char random, unsigned char brightness);
|
||||
|
||||
private:
|
||||
std::string device_name;
|
||||
|
||||
@@ -39,14 +39,17 @@ RGBController_CMR6000Controller::RGBController_CMR6000Controller(CMR6000Controll
|
||||
modes.push_back(Static);
|
||||
|
||||
mode ColorCycle;
|
||||
ColorCycle.name = "Color Cycle";
|
||||
ColorCycle.value = CM_MR6000_MODE_COLOR_CYCLE;
|
||||
ColorCycle.flags = MODE_FLAG_HAS_SPEED;
|
||||
ColorCycle.speed_min = MR6000_CYCLE_SPEED_SLOWEST;
|
||||
ColorCycle.speed = MR6000_CYCLE_SPEED_NORMAL;
|
||||
ColorCycle.speed_max = MR6000_CYCLE_SPEED_FASTEST;
|
||||
ColorCycle.color_mode = MODE_COLORS_NONE;
|
||||
ColorCycle.speed = speed;
|
||||
ColorCycle.name = "Color Cycle";
|
||||
ColorCycle.value = CM_MR6000_MODE_COLOR_CYCLE;
|
||||
ColorCycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
ColorCycle.speed_min = MR6000_CYCLE_SPEED_SLOWEST;
|
||||
ColorCycle.speed = MR6000_CYCLE_SPEED_NORMAL;
|
||||
ColorCycle.speed_max = MR6000_CYCLE_SPEED_FASTEST;
|
||||
ColorCycle.color_mode = MODE_COLORS_NONE;
|
||||
ColorCycle.speed = speed;
|
||||
ColorCycle.brightness_min = 0x00;
|
||||
ColorCycle.brightness_max = 0xFF;
|
||||
ColorCycle.brightness = 0x7F;
|
||||
modes.push_back(ColorCycle);
|
||||
|
||||
mode Breathing;
|
||||
@@ -124,8 +127,9 @@ void RGBController_CMR6000Controller::DeviceUpdateLEDs()
|
||||
}
|
||||
|
||||
unsigned char rnd = (modes[active_mode].color_mode == MODE_COLORS_RANDOM) ? 0xA0 : 0x20;
|
||||
unsigned char bri = (modes[active_mode].flags & MODE_FLAG_HAS_BRIGHTNESS) ? modes[active_mode].brightness : 0xFF;
|
||||
|
||||
cmr6000->SetMode(modes[active_mode].value, modes[active_mode].speed, red, grn, blu, rnd);
|
||||
cmr6000->SetMode(modes[active_mode].value, modes[active_mode].speed, red, grn, blu, rnd, bri);
|
||||
}
|
||||
|
||||
void RGBController_CMR6000Controller::UpdateZoneLEDs(int /*zone*/)
|
||||
|
||||
Reference in New Issue
Block a user