Add generic implementation of SetCustomMode to RGBController class
This commit is contained in:
parent
3af17b6d8e
commit
afb975e5fc
2 changed files with 32 additions and 1 deletions
|
|
@ -1539,6 +1539,37 @@ void RGBController::DeviceUpdateLEDs()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RGBController::SetCustomMode()
|
||||||
|
{
|
||||||
|
/*-------------------------------------------------*\
|
||||||
|
| Search the Controller's mode list for a suitable |
|
||||||
|
| per-LED custom mode in the following order: |
|
||||||
|
| 1. Direct |
|
||||||
|
| 2. Custom |
|
||||||
|
| 3. Static |
|
||||||
|
\*-------------------------------------------------*/
|
||||||
|
#define NUM_CUSTOM_MODE_NAMES 3
|
||||||
|
|
||||||
|
const std::string custom_mode_names[] =
|
||||||
|
{
|
||||||
|
"Direct",
|
||||||
|
"Custom",
|
||||||
|
"Static"
|
||||||
|
};
|
||||||
|
|
||||||
|
for(unsigned int custom_mode_idx = 0; custom_mode_idx < NUM_CUSTOM_MODE_NAMES; custom_mode_idx++)
|
||||||
|
{
|
||||||
|
for(unsigned int mode_idx = 0; mode_idx < modes.size(); mode_idx++)
|
||||||
|
{
|
||||||
|
if(modes[mode_idx].name == custom_mode_names[custom_mode_idx] && modes[mode_idx].color_mode == MODE_COLORS_PER_LED)
|
||||||
|
{
|
||||||
|
active_mode = mode_idx;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void RGBController::DeviceUpdateMode()
|
void RGBController::DeviceUpdateMode()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -325,7 +325,7 @@ public:
|
||||||
virtual void DeviceUpdateMode() = 0;
|
virtual void DeviceUpdateMode() = 0;
|
||||||
void DeviceSaveMode();
|
void DeviceSaveMode();
|
||||||
|
|
||||||
virtual void SetCustomMode() = 0;
|
void SetCustomMode();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::thread* DeviceCallThread;
|
std::thread* DeviceCallThread;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue