Replaced with template
This commit is contained in:
@@ -4,11 +4,19 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "ledstrip.h"
|
#include "ledstrip.h"
|
||||||
#include "ledstripdefines.h"
|
// #include "ledstripdefines.h"
|
||||||
|
|
||||||
using namespace espgui;
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
template<int16_t type>
|
||||||
|
class LedStripSetAnimationAction : public virtual ActionInterface
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void triggered() override { animation_type = type; }
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
class LedstripAnimationDefaultRainbowAction : public virtual ActionInterface
|
class LedstripAnimationDefaultRainbowAction : public virtual ActionInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -26,4 +34,5 @@ class LedstripAnimationSyncToSpeedAction : public virtual ActionInterface
|
|||||||
public:
|
public:
|
||||||
void triggered() override { animation_type = LEDSTRIP_ANIMATION_TYPE_SPEEDSYNCANIMATION; }
|
void triggered() override { animation_type = LEDSTRIP_ANIMATION_TYPE_SPEEDSYNCANIMATION; }
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
@@ -45,9 +45,9 @@ namespace {
|
|||||||
{
|
{
|
||||||
constructMenuItem<makeComponent<MenuItem, currentSelectedAnimationText, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, currentSelectedAnimationText, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, EmptyText, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, EmptyText, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ANIMATION_DEFAULTRAINBOW>, LedstripAnimationDefaultRainbowAction>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ANIMATION_DEFAULTRAINBOW>, LedStripSetAnimationAction<LEDSTRIP_ANIMATION_TYPE_DEFAULTRAINBOW>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ANIMATION_BETTERRAINBOW>, LedstripAnimationBetterRainbowAction>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ANIMATION_BETTERRAINBOW>, LedStripSetAnimationAction<LEDSTRIP_ANIMATION_TYPE_BETTERRAINBOW>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ANIMATION_SPEEDSYNCANIMATION>, LedstripAnimationSyncToSpeedAction>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ANIMATION_SPEEDSYNCANIMATION>, LedStripSetAnimationAction<LEDSTRIP_ANIMATION_TYPE_SPEEDSYNCANIMATION>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<LedstripMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<LedstripMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user