Convert mode from struct to class, add automatic initialization
* To avoid filtering in the profile manager and to ensure that color_mode is set to MODE_COLORS_RANDOM correctly for HW that has the mode flags MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_PER_LED_COLOR The values for speed_min, speed_max, colors_min and colors_max NEED to be initialised to allow for a saved profile to load correctly in `ProfileManager::LoadDeviceFromListWithOptions` Commit amended for code style by Adam Honse <calcprogrammer1@gmail.com>
This commit is contained in:
parent
cdcc2995b9
commit
b76265cf7d
2 changed files with 26 additions and 3 deletions
|
|
@ -3,6 +3,22 @@
|
|||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
mode::mode()
|
||||
{
|
||||
name = "";
|
||||
value = 0;
|
||||
flags = 0;
|
||||
speed_min = 0;
|
||||
speed_max = 0;
|
||||
colors_min = 1;
|
||||
colors_max = 1;
|
||||
}
|
||||
|
||||
mode::~mode()
|
||||
{
|
||||
colors.clear();
|
||||
}
|
||||
|
||||
RGBController::RGBController()
|
||||
{
|
||||
DeviceThreadRunning = true;
|
||||
|
|
|
|||
|
|
@ -61,10 +61,11 @@ enum
|
|||
};
|
||||
|
||||
/*------------------------------------------------------------------*\
|
||||
| Mode Type |
|
||||
| Mode Class |
|
||||
\*------------------------------------------------------------------*/
|
||||
typedef struct
|
||||
class mode
|
||||
{
|
||||
public:
|
||||
/*--------------------------------------------------------------*\
|
||||
| Mode Information |
|
||||
\*--------------------------------------------------------------*/
|
||||
|
|
@ -84,7 +85,13 @@ typedef struct
|
|||
unsigned int color_mode; /* Mode color selection */
|
||||
std::vector<RGBColor>
|
||||
colors; /* mode-specific colors */
|
||||
} mode;
|
||||
|
||||
/*--------------------------------------------------------------*\
|
||||
| Mode Constructor / Destructor |
|
||||
\*--------------------------------------------------------------*/
|
||||
mode();
|
||||
~mode();
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue