2016-08-04 13:10:53 +02:00
|
|
|
#pragma once
|
2016-08-11 07:13:55 +02:00
|
|
|
#include <QString>
|
2016-08-04 13:10:53 +02:00
|
|
|
|
2021-09-15 10:32:19 +02:00
|
|
|
#include "HyperionConfig.h"
|
|
|
|
|
2016-08-11 07:13:55 +02:00
|
|
|
namespace hyperion
|
|
|
|
{
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2016-08-04 13:10:53 +02:00
|
|
|
/**
|
|
|
|
* Enumeration of components in Hyperion.
|
|
|
|
*/
|
|
|
|
enum Components
|
|
|
|
{
|
2016-08-11 07:13:55 +02:00
|
|
|
COMP_INVALID,
|
2018-12-27 23:11:32 +01:00
|
|
|
COMP_ALL,
|
2016-08-11 07:13:55 +02:00
|
|
|
COMP_SMOOTHING,
|
|
|
|
COMP_BLACKBORDER,
|
2022-01-07 14:47:51 +01:00
|
|
|
#if defined(ENABLE_FORWARDER)
|
2016-08-11 07:13:55 +02:00
|
|
|
COMP_FORWARDER,
|
2022-01-07 14:47:51 +01:00
|
|
|
#endif
|
|
|
|
#if defined(ENABLE_BOBLIGHT_SERVER)
|
2016-08-11 07:13:55 +02:00
|
|
|
COMP_BOBLIGHTSERVER,
|
2021-09-15 10:32:19 +02:00
|
|
|
#endif
|
2016-08-31 00:54:47 +02:00
|
|
|
COMP_GRABBER,
|
2016-10-10 18:29:54 +02:00
|
|
|
COMP_V4L,
|
|
|
|
COMP_COLOR,
|
2018-12-27 23:11:32 +01:00
|
|
|
COMP_IMAGE,
|
2017-03-01 15:23:53 +01:00
|
|
|
COMP_EFFECT,
|
2018-12-28 18:12:45 +01:00
|
|
|
COMP_LEDDEVICE,
|
2022-01-07 14:47:51 +01:00
|
|
|
#if defined(ENABLE_FLATBUF_SERVER)
|
2019-02-17 15:26:11 +01:00
|
|
|
COMP_FLATBUFSERVER,
|
2022-01-07 14:47:51 +01:00
|
|
|
#endif
|
|
|
|
#if defined(ENABLE_PROTOBUF_SERVER)
|
2019-02-17 15:26:11 +01:00
|
|
|
COMP_PROTOSERVER
|
2022-01-07 14:47:51 +01:00
|
|
|
#endif
|
2016-08-04 13:10:53 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
inline const char* componentToString(Components c)
|
|
|
|
{
|
|
|
|
switch (c)
|
|
|
|
{
|
2018-12-27 23:11:32 +01:00
|
|
|
case COMP_ALL: return "Hyperion";
|
2016-08-11 07:13:55 +02:00
|
|
|
case COMP_SMOOTHING: return "Smoothing";
|
|
|
|
case COMP_BLACKBORDER: return "Blackborder detector";
|
2022-01-07 14:47:51 +01:00
|
|
|
#if defined(ENABLE_FORWARDER)
|
2016-08-11 07:13:55 +02:00
|
|
|
case COMP_FORWARDER: return "Json/Proto forwarder";
|
2022-01-07 14:47:51 +01:00
|
|
|
#endif
|
|
|
|
#if defined(ENABLE_BOBLIGHT_SERVER)
|
2016-08-11 07:13:55 +02:00
|
|
|
case COMP_BOBLIGHTSERVER:return "Boblight server";
|
2021-09-15 10:32:19 +02:00
|
|
|
#endif
|
2016-08-11 07:13:55 +02:00
|
|
|
case COMP_GRABBER: return "Framegrabber";
|
2016-10-10 18:29:54 +02:00
|
|
|
case COMP_V4L: return "V4L capture device";
|
2017-01-10 19:58:41 +01:00
|
|
|
case COMP_COLOR: return "Solid color";
|
|
|
|
case COMP_EFFECT: return "Effect";
|
2018-12-27 23:11:32 +01:00
|
|
|
case COMP_IMAGE: return "Image";
|
2017-03-21 17:55:46 +01:00
|
|
|
case COMP_LEDDEVICE: return "LED device";
|
2022-01-07 14:47:51 +01:00
|
|
|
#if defined(ENABLE_FLATBUF_SERVER)
|
2019-02-17 15:26:11 +01:00
|
|
|
case COMP_FLATBUFSERVER: return "Image Receiver";
|
2022-01-07 14:47:51 +01:00
|
|
|
#endif
|
|
|
|
#if defined(ENABLE_PROTOBUF_SERVER)
|
2019-02-17 15:26:11 +01:00
|
|
|
case COMP_PROTOSERVER: return "Proto Server";
|
2022-01-07 14:47:51 +01:00
|
|
|
#endif
|
2016-08-11 07:13:55 +02:00
|
|
|
default: return "";
|
2016-08-04 13:10:53 +02:00
|
|
|
}
|
2016-08-11 07:13:55 +02:00
|
|
|
}
|
|
|
|
|
2016-09-07 20:10:37 +02:00
|
|
|
inline const char* componentToIdString(Components c)
|
|
|
|
{
|
|
|
|
switch (c)
|
|
|
|
{
|
2018-12-27 23:11:32 +01:00
|
|
|
case COMP_ALL: return "ALL";
|
2016-09-07 20:10:37 +02:00
|
|
|
case COMP_SMOOTHING: return "SMOOTHING";
|
|
|
|
case COMP_BLACKBORDER: return "BLACKBORDER";
|
2022-01-07 14:47:51 +01:00
|
|
|
#if defined(ENABLE_FORWARDER)
|
2016-09-07 20:10:37 +02:00
|
|
|
case COMP_FORWARDER: return "FORWARDER";
|
2022-01-07 14:47:51 +01:00
|
|
|
#endif
|
|
|
|
#if defined(ENABLE_BOBLIGHT_SERVER)
|
2016-09-07 20:10:37 +02:00
|
|
|
case COMP_BOBLIGHTSERVER:return "BOBLIGHTSERVER";
|
2021-09-15 10:32:19 +02:00
|
|
|
#endif
|
2016-09-07 20:10:37 +02:00
|
|
|
case COMP_GRABBER: return "GRABBER";
|
|
|
|
case COMP_V4L: return "V4L";
|
2016-10-10 18:29:54 +02:00
|
|
|
case COMP_COLOR: return "COLOR";
|
|
|
|
case COMP_EFFECT: return "EFFECT";
|
2018-12-27 23:11:32 +01:00
|
|
|
case COMP_IMAGE: return "IMAGE";
|
2017-03-21 17:55:46 +01:00
|
|
|
case COMP_LEDDEVICE: return "LEDDEVICE";
|
2022-01-07 14:47:51 +01:00
|
|
|
#if defined(ENABLE_FLATBUF_SERVER)
|
2018-12-28 18:12:45 +01:00
|
|
|
case COMP_FLATBUFSERVER: return "FLATBUFSERVER";
|
2022-01-07 14:47:51 +01:00
|
|
|
#endif
|
|
|
|
#if defined(ENABLE_PROTOBUF_SERVER)
|
2019-02-17 15:26:11 +01:00
|
|
|
case COMP_PROTOSERVER: return "PROTOSERVER";
|
2022-01-07 14:47:51 +01:00
|
|
|
#endif
|
2016-09-07 20:10:37 +02:00
|
|
|
default: return "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-08 23:12:43 +02:00
|
|
|
inline Components stringToComponent(const QString& component)
|
2016-08-11 07:13:55 +02:00
|
|
|
{
|
2020-08-08 23:12:43 +02:00
|
|
|
const QString cmp = component.toUpper();
|
|
|
|
if (cmp == "ALL") return COMP_ALL;
|
|
|
|
if (cmp == "SMOOTHING") return COMP_SMOOTHING;
|
|
|
|
if (cmp == "BLACKBORDER") return COMP_BLACKBORDER;
|
2022-01-07 14:47:51 +01:00
|
|
|
#if defined(ENABLE_FORWARDER)
|
2020-08-08 23:12:43 +02:00
|
|
|
if (cmp == "FORWARDER") return COMP_FORWARDER;
|
2022-01-07 14:47:51 +01:00
|
|
|
#endif
|
|
|
|
#if defined(ENABLE_BOBLIGHT_SERVER)
|
2020-08-08 23:12:43 +02:00
|
|
|
if (cmp == "BOBLIGHTSERVER")return COMP_BOBLIGHTSERVER;
|
2021-09-15 10:32:19 +02:00
|
|
|
#endif
|
2020-08-08 23:12:43 +02:00
|
|
|
if (cmp == "GRABBER") return COMP_GRABBER;
|
|
|
|
if (cmp == "V4L") return COMP_V4L;
|
|
|
|
if (cmp == "COLOR") return COMP_COLOR;
|
|
|
|
if (cmp == "EFFECT") return COMP_EFFECT;
|
|
|
|
if (cmp == "IMAGE") return COMP_IMAGE;
|
|
|
|
if (cmp == "LEDDEVICE") return COMP_LEDDEVICE;
|
2022-01-07 14:47:51 +01:00
|
|
|
#if defined(ENABLE_FLATBUF_SERVER)
|
2020-08-08 23:12:43 +02:00
|
|
|
if (cmp == "FLATBUFSERVER") return COMP_FLATBUFSERVER;
|
2022-01-07 14:47:51 +01:00
|
|
|
#endif
|
|
|
|
#if defined(ENABLE_PROTOBUF_SERVER)
|
2020-08-08 23:12:43 +02:00
|
|
|
if (cmp == "PROTOSERVER") return COMP_PROTOSERVER;
|
2022-01-07 14:47:51 +01:00
|
|
|
#endif
|
2016-08-11 07:13:55 +02:00
|
|
|
return COMP_INVALID;
|
|
|
|
}
|
|
|
|
|
2020-05-25 21:51:11 +02:00
|
|
|
} // end of namespace
|