fix coloradjustment via hyperion remote (#362)

* - fix coloradjustment via hyperion remote
- several small cleanups/refactorings

* fix color is shown as unknown in json serverinfo

* fix active color is not shown when autoselect is reactivated
This commit is contained in:
redPanther
2017-01-10 19:58:41 +01:00
committed by GitHub
parent ef14eb08c9
commit b2a6366176
15 changed files with 96 additions and 118 deletions

View File

@@ -270,7 +270,7 @@ public:
static MultiColorAdjustment * createLedColorsAdjustment(const unsigned ledCnt, const QJsonObject & colorAdjustmentConfig);
static ColorAdjustment * createColorAdjustment(const QJsonObject & adjustmentConfig);
static RgbTransform * createRgbTransform(const QJsonObject& colorConfig);
static RgbChannelAdjustment * createRgbChannelAdjustment(const QJsonArray& colorConfig, const RgbChannel color);
static RgbChannelAdjustment * createRgbChannelAdjustment(const QJsonObject & colorConfig, const QString channelName, const int defaultR, const int defaultG, const int defaultB);
static LinearColorSmoothing * createColorSmoothing(const QJsonObject & smoothingConfig, LedDevice* leddevice);
static MessageForwarder * createMessageForwarder(const QJsonObject & forwarderConfig);

View File

@@ -33,8 +33,8 @@ inline const char* componentToString(Components c)
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_COLOR: return "Solid color";
case COMP_EFFECT: return "Effect";
default: return "";
}
}

View File

@@ -50,7 +50,7 @@ public:
QString levelString;
} T_LOG_MESSAGE;
static Logger* getInstance(std::string name="", LogLevel minLevel=Logger::INFO);
static Logger* getInstance(QString name="", LogLevel minLevel=Logger::INFO);
static void deleteInstance(std::string name="");
static void setLogLevel(LogLevel level,std::string name="");
static LogLevel getLogLevel(std::string name="");

View File

@@ -2,6 +2,8 @@
// STL includes
#include <cstdint>
#include <QString>
#include <utils/Logger.h>
/// Correction for a single color byte value
/// All configuration values are unsigned int and assume the color value to be between 0 and 255
@@ -9,13 +11,13 @@ class RgbChannelAdjustment
{
public:
/// Default constructor
RgbChannelAdjustment();
RgbChannelAdjustment(QString channelName="");
/// Constructor
/// @param adjustR
/// @param adjustG
/// @param adjustB
RgbChannelAdjustment(uint8_t adjustR, uint8_t adjustG, uint8_t adjustB);
RgbChannelAdjustment(uint8_t adjustR, uint8_t adjustG, uint8_t adjustB, QString channelName="");
/// Destructor
~RgbChannelAdjustment();
@@ -64,4 +66,10 @@ private:
/// The mapping from input color to output color
uint8_t _mapping[3][256];
/// Name of this channel, usefull for debug messages
QString _channelName;
/// Logger instance
Logger * _log;
};