mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-01-06 06:07:49 -05:00
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:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user