figments: input: remove unused event intents, move stringification into figments lib
This commit is contained in:
parent
89e943b767
commit
e43b594637
@ -98,3 +98,55 @@ BufferedInputSource::setEvent(InputEvent::Intent intent, Variant &&v)
|
|||||||
{
|
{
|
||||||
m_eventQueue.insert(InputEvent{intent, std::move(v)});
|
m_eventQueue.insert(InputEvent{intent, std::move(v)});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char*
|
||||||
|
InputEvent::name() const
|
||||||
|
{
|
||||||
|
switch (intent) {
|
||||||
|
case InputEvent::BeatDetect:
|
||||||
|
return "beat-detection";
|
||||||
|
case InputEvent::Beat:
|
||||||
|
return "beat";
|
||||||
|
case InputEvent::ReadyToRoll:
|
||||||
|
return "ready-to-roll";
|
||||||
|
case InputEvent::PowerToggle:
|
||||||
|
return "power-toggle";
|
||||||
|
case InputEvent::SetPower:
|
||||||
|
return "set-power";
|
||||||
|
case InputEvent::SetPattern:
|
||||||
|
return "set-pattern";
|
||||||
|
case InputEvent::SetScene:
|
||||||
|
return "set-scene";
|
||||||
|
case InputEvent::SetColor:
|
||||||
|
return "set-color";
|
||||||
|
case InputEvent::Acceleration:
|
||||||
|
return "acceleration";
|
||||||
|
case InputEvent::SetBrightness:
|
||||||
|
return "set-brightness";
|
||||||
|
case InputEvent::FirmwareUpdate:
|
||||||
|
return "firmware-update";
|
||||||
|
case InputEvent::NetworkStatus:
|
||||||
|
return "network-status";
|
||||||
|
case InputEvent::NetworkActivity:
|
||||||
|
return "network-activity";
|
||||||
|
case InputEvent::StartThing:
|
||||||
|
return "start-thing";
|
||||||
|
case InputEvent::StopThing:
|
||||||
|
return "stop-thing";
|
||||||
|
case InputEvent::SaveConfigurationRequest:
|
||||||
|
return "save-configuration";
|
||||||
|
case InputEvent::ConfigurationChanged:
|
||||||
|
return "configuration-changed";
|
||||||
|
case InputEvent::IdleStart:
|
||||||
|
return "idle-start";
|
||||||
|
case InputEvent::IdleStop:
|
||||||
|
return "idle-stop";
|
||||||
|
case InputEvent::ButtonPress:
|
||||||
|
return "button";
|
||||||
|
case InputEvent::LoadConfigurationByName:
|
||||||
|
return "load-config";
|
||||||
|
case None:
|
||||||
|
return "none";
|
||||||
|
}
|
||||||
|
return "unknown";
|
||||||
|
}
|
||||||
|
@ -55,9 +55,10 @@ struct InputEvent: public Variant {
|
|||||||
// An empty non-event
|
// An empty non-event
|
||||||
None,
|
None,
|
||||||
|
|
||||||
// An input from the user, for other tasks to translate into canonical
|
// System activity
|
||||||
// types. Makes for easy button re-mapping on the fly.
|
ReadyToRoll,
|
||||||
UserInput,
|
IdleStart,
|
||||||
|
IdleStop,
|
||||||
|
|
||||||
//
|
//
|
||||||
// The canonical types
|
// The canonical types
|
||||||
@ -65,6 +66,8 @@ struct InputEvent: public Variant {
|
|||||||
// Hardware inputs
|
// Hardware inputs
|
||||||
ButtonPress,
|
ButtonPress,
|
||||||
Acceleration,
|
Acceleration,
|
||||||
|
|
||||||
|
// Network management
|
||||||
NetworkStatus,
|
NetworkStatus,
|
||||||
NetworkActivity,
|
NetworkActivity,
|
||||||
|
|
||||||
@ -74,15 +77,10 @@ struct InputEvent: public Variant {
|
|||||||
SetBrightness,
|
SetBrightness,
|
||||||
|
|
||||||
// Animation sequencing
|
// Animation sequencing
|
||||||
PreviousPattern,
|
|
||||||
NextPattern,
|
|
||||||
SetPattern,
|
SetPattern,
|
||||||
PreviousScene,
|
|
||||||
NextScene,
|
|
||||||
SetScene,
|
SetScene,
|
||||||
|
|
||||||
// Timekeeping
|
// Timekeeping
|
||||||
ScheduleChange,
|
|
||||||
Beat,
|
Beat,
|
||||||
BeatDetect,
|
BeatDetect,
|
||||||
|
|
||||||
@ -91,17 +89,13 @@ struct InputEvent: public Variant {
|
|||||||
StopThing,
|
StopThing,
|
||||||
|
|
||||||
// Configuration
|
// Configuration
|
||||||
SetDisplayOffset,
|
|
||||||
SetDisplayLength,
|
|
||||||
LoadConfigurationByName,
|
LoadConfigurationByName,
|
||||||
SetColor,
|
|
||||||
SaveConfigurationRequest,
|
SaveConfigurationRequest,
|
||||||
ConfigurationChanged,
|
ConfigurationChanged,
|
||||||
|
SetColor,
|
||||||
|
|
||||||
// Firmware events
|
// Firmware events
|
||||||
FirmwareUpdate,
|
FirmwareUpdate,
|
||||||
|
|
||||||
ReadyToRoll,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename Value>
|
template<typename Value>
|
||||||
@ -118,6 +112,8 @@ struct InputEvent: public Variant {
|
|||||||
return intent != otherIntent;
|
return intent != otherIntent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* name() const;
|
||||||
|
|
||||||
Intent intent;
|
Intent intent;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user