hyperion.ng/include/utils/Components.h
redPanther f1cc82b8c7 enable components at runtime + grabber refactoring (#160)
* implement enable/disable on runtime for:
- smoothing
- kodi
- udplistener
- boblight

* implement enable/disable for forwarder
refactor component

* - implement grabber enable/disable at runtime
- big grabber refactoring. now with common base class for all grabbers

* implement enable/disable at runtime for bb detector

* osx fix

* try to fix cutted travis output for osx build
2016-08-11 07:13:55 +02:00

51 lines
1.3 KiB
C++

#pragma once
#include <QString>
namespace hyperion
{
/**
* Enumeration of components in Hyperion.
*/
enum Components
{
COMP_INVALID,
COMP_SMOOTHING,
COMP_BLACKBORDER,
COMP_KODICHECKER,
COMP_FORWARDER,
COMP_UDPLISTENER,
COMP_BOBLIGHTSERVER,
COMP_GRABBER
};
inline const char* componentToString(Components c)
{
switch (c)
{
case COMP_SMOOTHING: return "Smoothing";
case COMP_BLACKBORDER: return "Blackborder detector";
case COMP_KODICHECKER: return "KodiVideoChecker";
case COMP_FORWARDER: return "Json/Proto forwarder";
case COMP_UDPLISTENER: return "UDP listener";
case COMP_BOBLIGHTSERVER:return "Boblight server";
case COMP_GRABBER: return "Framegrabber";
default: return "";
}
}
inline Components stringToComponent(QString component)
{
component = component.toUpper();
if (component == "SMOOTHING") return COMP_SMOOTHING;
if (component == "BLACKBORDER") return COMP_BLACKBORDER;
if (component == "KODICHECKER") return COMP_KODICHECKER;
if (component == "FORWARDER") return COMP_FORWARDER;
if (component == "UDPLISTENER") return COMP_UDPLISTENER;
if (component == "BOBLIGHTSERVER")return COMP_BOBLIGHTSERVER;
if (component == "GRABBER") return COMP_GRABBER;
return COMP_INVALID;
}
}