hyperion.ng/include/utils/Components.h
SJunkies 3ff7fe483f
fix: small collection of bugfixed debugger hints and warnings (#801)
* small collection of bugfixed debugger hints / warnings

* 'toStdVector' has been explicitly marked deprecated

* fixed double zip naming in artifacts

* V4L2 WebUI Fix

* Some code fixes based on alerts from lgtm.com

* only execute dynamic v4l2 enum code, if V4L2_AVAIL

* very high critical bugfix ;)

* merge fix

* some lgtm.com fixes

* lgtm fixes

* undo localtime_r fix

Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
2020-05-25 21:51:11 +02:00

90 lines
2.6 KiB
C++

#pragma once
#include <QString>
namespace hyperion
{
/**
* Enumeration of components in Hyperion.
*/
enum Components
{
COMP_INVALID,
COMP_ALL,
COMP_SMOOTHING,
COMP_BLACKBORDER,
COMP_FORWARDER,
COMP_BOBLIGHTSERVER,
COMP_GRABBER,
COMP_V4L,
COMP_COLOR,
COMP_IMAGE,
COMP_EFFECT,
COMP_LEDDEVICE,
COMP_FLATBUFSERVER,
COMP_PROTOSERVER
};
inline const char* componentToString(Components c)
{
switch (c)
{
case COMP_ALL: return "Hyperion";
case COMP_SMOOTHING: return "Smoothing";
case COMP_BLACKBORDER: return "Blackborder detector";
case COMP_FORWARDER: return "Json/Proto forwarder";
case COMP_BOBLIGHTSERVER:return "Boblight server";
case COMP_GRABBER: return "Framegrabber";
case COMP_V4L: return "V4L capture device";
case COMP_COLOR: return "Solid color";
case COMP_EFFECT: return "Effect";
case COMP_IMAGE: return "Image";
case COMP_LEDDEVICE: return "LED device";
case COMP_FLATBUFSERVER: return "Image Receiver";
case COMP_PROTOSERVER: return "Proto Server";
default: return "";
}
}
inline const char* componentToIdString(Components c)
{
switch (c)
{
case COMP_ALL: return "ALL";
case COMP_SMOOTHING: return "SMOOTHING";
case COMP_BLACKBORDER: return "BLACKBORDER";
case COMP_FORWARDER: return "FORWARDER";
case COMP_BOBLIGHTSERVER:return "BOBLIGHTSERVER";
case COMP_GRABBER: return "GRABBER";
case COMP_V4L: return "V4L";
case COMP_COLOR: return "COLOR";
case COMP_EFFECT: return "EFFECT";
case COMP_IMAGE: return "IMAGE";
case COMP_LEDDEVICE: return "LEDDEVICE";
case COMP_FLATBUFSERVER: return "FLATBUFSERVER";
case COMP_PROTOSERVER: return "PROTOSERVER";
default: return "";
}
}
inline Components stringToComponent(QString component)
{
component = component.toUpper();
if (component == "ALL") return COMP_ALL;
if (component == "SMOOTHING") return COMP_SMOOTHING;
if (component == "BLACKBORDER") return COMP_BLACKBORDER;
if (component == "FORWARDER") return COMP_FORWARDER;
if (component == "BOBLIGHTSERVER")return COMP_BOBLIGHTSERVER;
if (component == "GRABBER") return COMP_GRABBER;
if (component == "V4L") return COMP_V4L;
if (component == "COLOR") return COMP_COLOR;
if (component == "EFFECT") return COMP_EFFECT;
if (component == "IMAGE") return COMP_IMAGE;
if (component == "LEDDEVICE") return COMP_LEDDEVICE;
if (component == "FLATBUFSERVER") return COMP_FLATBUFSERVER;
if (component == "PROTOSERVER") return COMP_PROTOSERVER;
return COMP_INVALID;
}
} // end of namespace