mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Webui: extend led hardware config + connection lost page (#226)
* split content and js tune leds config * implement connection lost page * split js/html in huebridge * add js action for connection lost * extend led config make connection loss nicer * tune led code add menu entry for grabber * more tuning of webui * switch back to botstrap textarea add v4l to components * add icon * extend schema for jsoneditor * implement ledcolors streaming with 4fps * implement component state
This commit is contained in:
28
include/hyperion/ComponentRegister.h
Normal file
28
include/hyperion/ComponentRegister.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <utils/Components.h>
|
||||
#include <utils/Logger.h>
|
||||
|
||||
// STL includes
|
||||
#include <map>
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class ComponentRegister : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ComponentRegister();
|
||||
~ComponentRegister();
|
||||
|
||||
std::map<hyperion::Components, bool> getRegister() { return _componentStates; };
|
||||
|
||||
public slots:
|
||||
void componentStateChanged(const hyperion::Components comp, const bool activated);
|
||||
|
||||
private:
|
||||
std::map<hyperion::Components, bool> _componentStates;
|
||||
Logger * _log;
|
||||
};
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#include <hyperion/ColorCorrection.h>
|
||||
#include <hyperion/ColorAdjustment.h>
|
||||
#include <hyperion/MessageForwarder.h>
|
||||
#include <hyperion/ComponentRegister.h>
|
||||
|
||||
// Effect engine includes
|
||||
#include <effectengine/EffectDefinition.h>
|
||||
@@ -158,6 +159,9 @@ public:
|
||||
/// @param state The state of the component [true | false]
|
||||
///
|
||||
void setComponentState(const hyperion::Components component, const bool state);
|
||||
|
||||
ComponentRegister& getComponentRegister() { return _componentRegister; };
|
||||
|
||||
public slots:
|
||||
///
|
||||
/// Writes a single color to all the leds for the given time and priority
|
||||
@@ -359,6 +363,8 @@ private:
|
||||
/// count of hardware leds
|
||||
unsigned _hwLedCount;
|
||||
|
||||
ComponentRegister _componentRegister;
|
||||
|
||||
/// register of input sources and it's prio channel
|
||||
PriorityRegister _priorityRegister;
|
||||
|
||||
|
@@ -29,6 +29,8 @@ public:
|
||||
void addProtoSlave(std::string slave);
|
||||
|
||||
bool protoForwardingEnabled();
|
||||
bool jsonForwardingEnabled();
|
||||
bool forwardingEnabled() { return jsonForwardingEnabled() || protoForwardingEnabled(); };
|
||||
QStringList getProtoSlaves();
|
||||
QList<MessageForwarder::JsonSlaveAddress> getJsonSlaves();
|
||||
|
||||
|
@@ -35,6 +35,22 @@ inline const char* componentToString(Components c)
|
||||
}
|
||||
}
|
||||
|
||||
inline const char* componentToIdString(Components c)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case COMP_SMOOTHING: return "SMOOTHING";
|
||||
case COMP_BLACKBORDER: return "BLACKBORDER";
|
||||
case COMP_KODICHECKER: return "KODICHECKER";
|
||||
case COMP_FORWARDER: return "FORWARDER";
|
||||
case COMP_UDPLISTENER: return "UDPLISTENER";
|
||||
case COMP_BOBLIGHTSERVER:return "BOBLIGHTSERVER";
|
||||
case COMP_GRABBER: return "GRABBER";
|
||||
case COMP_V4L: return "V4L";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
inline Components stringToComponent(QString component)
|
||||
{
|
||||
component = component.toUpper();
|
||||
|
Reference in New Issue
Block a user