@@ -28,15 +28,18 @@ RGBController_CMR6000Controller::RGBController_CMR6000Controller(CMR6000Controll
2828 Off.color_mode = MODE_COLORS_NONE;
2929 modes.push_back (Off);
3030
31- mode Static;
32- Static.name = " Static" ;
33- Static.value = CM_MR6000_MODE_STATIC;
34- Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
35- Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
36- Static.colors_min = 1 ;
37- Static.colors_max = 1 ;
38- Static.colors .resize (1 );
39- modes.push_back (Static);
31+ mode Direct;
32+ Direct.name = " Direct" ;
33+ Direct.value = CM_MR6000_MODE_DIRECT;
34+ Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR| MODE_FLAG_HAS_BRIGHTNESS;
35+ Direct.color_mode = MODE_COLORS_PER_LED;
36+ Direct.colors_min = 1 ;
37+ Direct.colors_max = 1 ;
38+ Direct.colors .resize (1 );
39+ Direct.brightness_min = 0x00 ;
40+ Direct.brightness_max = 0xFF ;
41+ Direct.brightness = 0xFF ;
42+ modes.push_back (Direct);
4043
4144 mode ColorCycle;
4245 ColorCycle.name = " Color Cycle" ;
@@ -55,31 +58,19 @@ RGBController_CMR6000Controller::RGBController_CMR6000Controller(CMR6000Controll
5558 mode Breathing;
5659 Breathing.name = " Breathing" ;
5760 Breathing.value = CM_MR6000_MODE_BREATHE;
58- Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
61+ Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
5962 Breathing.speed_min = MR6000_BREATHE_SPEED_SLOWEST;
6063 Breathing.speed = MR6000_BREATHE_SPEED_NORMAL;
6164 Breathing.speed_max = MR6000_BREATHE_SPEED_FASTEST;
62- Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC ;
65+ Breathing.color_mode = MODE_COLORS_PER_LED ;
6366 Breathing.colors_min = 1 ;
6467 Breathing.colors_max = 1 ;
6568 Breathing.colors .resize (1 );
6669 Breathing.speed = speed;
6770 modes.push_back (Breathing);
6871
6972 SetupZones ();
70- active_mode = cmr6000->GetMode ();
71- if (modes[active_mode].flags & MODE_FLAG_HAS_MODE_SPECIFIC_COLOR)
72- {
73- modes[active_mode].colors [0 ] = ToRGBColor (cmr6000->GetLedRed (), cmr6000->GetLedGreen (), cmr6000->GetLedBlue ());
74- }
75- if (modes[active_mode].flags & MODE_FLAG_HAS_RANDOM_COLOR)
76- {
77- modes[active_mode].color_mode = (cmr6000->GetRandomColours ()) ? MODE_COLORS_RANDOM : MODE_COLORS_MODE_SPECIFIC;
78- }
79- if (modes[active_mode].flags & MODE_FLAG_HAS_SPEED)
80- {
81- modes[active_mode].speed = cmr6000->GetLedSpeed ();
82- }
73+ active_mode = 1 ;
8374}
8475
8576RGBController_CMR6000Controller::~RGBController_CMR6000Controller ()
@@ -100,6 +91,7 @@ void RGBController_CMR6000Controller::SetupZones()
10091
10192 led GP_led;
10293 GP_led.name = " Logo" ;
94+ GP_led.value = 0 ;
10395 leds.push_back (GP_led);
10496
10597 SetupColors ();
@@ -119,11 +111,11 @@ void RGBController_CMR6000Controller::DeviceUpdateLEDs()
119111 unsigned char grn = 0 ;
120112 unsigned char blu = 0 ;
121113
122- if (modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC )
114+ if (modes[active_mode].color_mode == MODE_COLORS_PER_LED )
123115 {
124- red = RGBGetRValue (modes[active_mode]. colors [0 ]);
125- grn = RGBGetGValue (modes[active_mode]. colors [0 ]);
126- blu = RGBGetBValue (modes[active_mode]. colors [0 ]);
116+ red = RGBGetRValue (colors[0 ]);
117+ grn = RGBGetGValue (colors[0 ]);
118+ blu = RGBGetBValue (colors[0 ]);
127119 }
128120
129121 unsigned char rnd = (modes[active_mode].color_mode == MODE_COLORS_RANDOM) ? 0xA0 : 0x20 ;
0 commit comments