mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
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>
This commit is contained in:
@@ -86,4 +86,4 @@ inline Components stringToComponent(QString component)
|
||||
return COMP_INVALID;
|
||||
}
|
||||
|
||||
}; // end of namespace
|
||||
} // end of namespace
|
||||
|
@@ -61,4 +61,4 @@ QString getDirName( QString sourceFile);
|
||||
/// @param[in] log The logger of the caller
|
||||
///
|
||||
void resolveFileError(const QFile& file, Logger* log);
|
||||
};
|
||||
}
|
||||
|
@@ -203,7 +203,7 @@ public:
|
||||
assert(other._width == _width);
|
||||
assert(other._height == _height);
|
||||
|
||||
memcpy(_pixels, other._pixels, _width*_height*sizeof(Pixel_T));
|
||||
memcpy(_pixels, other._pixels, _width * _height * sizeof(Pixel_T));
|
||||
}
|
||||
|
||||
///
|
||||
@@ -258,7 +258,7 @@ public:
|
||||
_height = 1;
|
||||
_pixels = new Pixel_T[2];
|
||||
_endOfPixels = _pixels + 1;
|
||||
memset(_pixels, 0, _width * _height * sizeof(Pixel_T));
|
||||
memset(_pixels, 0, (unsigned long) _width * _height * sizeof(Pixel_T));
|
||||
}
|
||||
|
||||
private:
|
||||
|
@@ -92,4 +92,4 @@ namespace JsonUtils{
|
||||
/// @return true on success else false
|
||||
///
|
||||
bool resolveRefs(const QJsonObject& schema, QJsonObject& obj, Logger* log);
|
||||
};
|
||||
}
|
||||
|
@@ -103,4 +103,4 @@ protected:
|
||||
const int _loggerMaxMsgBufferSize;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(Logger::T_LOG_MESSAGE);
|
||||
Q_DECLARE_METATYPE(Logger::T_LOG_MESSAGE)
|
||||
|
@@ -4,8 +4,8 @@
|
||||
#include <QString>
|
||||
|
||||
namespace Process {
|
||||
|
||||
void restartHyperion(bool asNewProcess=false);
|
||||
|
||||
void restartHyperion(bool asNewProcess=false);
|
||||
QByteArray command_exec(QString cmd, QByteArray data="");
|
||||
|
||||
};
|
||||
}
|
||||
|
@@ -13,8 +13,8 @@ namespace RGBW {
|
||||
SUB_MIN_COOL_ADJUST,
|
||||
WHITE_OFF
|
||||
};
|
||||
|
||||
|
||||
WhiteAlgorithm stringToWhiteAlgorithm(QString str);
|
||||
void Rgb_to_Rgbw(ColorRgb input, ColorRgbw * output, const WhiteAlgorithm algorithm);
|
||||
|
||||
};
|
||||
}
|
||||
|
@@ -6,94 +6,94 @@
|
||||
/// @brief Provide util methods to work with SettingsManager class
|
||||
///
|
||||
namespace settings {
|
||||
// all available settings sections
|
||||
enum type {
|
||||
BGEFFECT,
|
||||
FGEFFECT,
|
||||
BLACKBORDER,
|
||||
BOBLSERVER,
|
||||
COLOR,
|
||||
DEVICE,
|
||||
EFFECTS,
|
||||
NETFORWARD,
|
||||
SYSTEMCAPTURE,
|
||||
GENERAL,
|
||||
V4L2,
|
||||
JSONSERVER,
|
||||
LEDCONFIG,
|
||||
LEDS,
|
||||
LOGGER,
|
||||
SMOOTHING,
|
||||
WEBSERVER,
|
||||
INSTCAPTURE,
|
||||
NETWORK,
|
||||
FLATBUFSERVER,
|
||||
PROTOSERVER,
|
||||
INVALID
|
||||
};
|
||||
// all available settings sections
|
||||
enum type {
|
||||
BGEFFECT,
|
||||
FGEFFECT,
|
||||
BLACKBORDER,
|
||||
BOBLSERVER,
|
||||
COLOR,
|
||||
DEVICE,
|
||||
EFFECTS,
|
||||
NETFORWARD,
|
||||
SYSTEMCAPTURE,
|
||||
GENERAL,
|
||||
V4L2,
|
||||
JSONSERVER,
|
||||
LEDCONFIG,
|
||||
LEDS,
|
||||
LOGGER,
|
||||
SMOOTHING,
|
||||
WEBSERVER,
|
||||
INSTCAPTURE,
|
||||
NETWORK,
|
||||
FLATBUFSERVER,
|
||||
PROTOSERVER,
|
||||
INVALID
|
||||
};
|
||||
|
||||
///
|
||||
/// @brief Convert settings::type to string representation
|
||||
/// @param type The settings::type from enum
|
||||
/// @return The settings type as string
|
||||
///
|
||||
inline QString typeToString(const type& type)
|
||||
{
|
||||
switch (type)
|
||||
///
|
||||
/// @brief Convert settings::type to string representation
|
||||
/// @param type The settings::type from enum
|
||||
/// @return The settings type as string
|
||||
///
|
||||
inline QString typeToString(const type& type)
|
||||
{
|
||||
case BGEFFECT: return "backgroundEffect";
|
||||
case FGEFFECT: return "foregroundEffect";
|
||||
case BLACKBORDER: return "blackborderdetector";
|
||||
case BOBLSERVER: return "boblightServer";
|
||||
case COLOR: return "color";
|
||||
case DEVICE: return "device";
|
||||
case EFFECTS: return "effects";
|
||||
case NETFORWARD: return "forwarder";
|
||||
case SYSTEMCAPTURE: return "framegrabber";
|
||||
case GENERAL: return "general";
|
||||
case V4L2: return "grabberV4L2";
|
||||
case JSONSERVER: return "jsonServer";
|
||||
case LEDCONFIG: return "ledConfig";
|
||||
case LEDS: return "leds";
|
||||
case LOGGER: return "logger";
|
||||
case SMOOTHING: return "smoothing";
|
||||
case WEBSERVER: return "webConfig";
|
||||
case INSTCAPTURE: return "instCapture";
|
||||
case NETWORK: return "network";
|
||||
case FLATBUFSERVER: return "flatbufServer";
|
||||
case PROTOSERVER: return "protoServer";
|
||||
default: return "invalid";
|
||||
switch (type)
|
||||
{
|
||||
case BGEFFECT: return "backgroundEffect";
|
||||
case FGEFFECT: return "foregroundEffect";
|
||||
case BLACKBORDER: return "blackborderdetector";
|
||||
case BOBLSERVER: return "boblightServer";
|
||||
case COLOR: return "color";
|
||||
case DEVICE: return "device";
|
||||
case EFFECTS: return "effects";
|
||||
case NETFORWARD: return "forwarder";
|
||||
case SYSTEMCAPTURE: return "framegrabber";
|
||||
case GENERAL: return "general";
|
||||
case V4L2: return "grabberV4L2";
|
||||
case JSONSERVER: return "jsonServer";
|
||||
case LEDCONFIG: return "ledConfig";
|
||||
case LEDS: return "leds";
|
||||
case LOGGER: return "logger";
|
||||
case SMOOTHING: return "smoothing";
|
||||
case WEBSERVER: return "webConfig";
|
||||
case INSTCAPTURE: return "instCapture";
|
||||
case NETWORK: return "network";
|
||||
case FLATBUFSERVER: return "flatbufServer";
|
||||
case PROTOSERVER: return "protoServer";
|
||||
default: return "invalid";
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// @brief Convert string to settings::type representation
|
||||
/// @param type The string to convert
|
||||
/// @return The settings type from enum
|
||||
///
|
||||
inline type stringToType(const QString& type)
|
||||
{
|
||||
if (type == "backgroundEffect") return BGEFFECT;
|
||||
else if (type == "foregroundEffect") return FGEFFECT;
|
||||
else if (type == "blackborderdetector") return BLACKBORDER;
|
||||
else if (type == "boblightServer") return BOBLSERVER;
|
||||
else if (type == "color") return COLOR;
|
||||
else if (type == "device") return DEVICE;
|
||||
else if (type == "effects") return EFFECTS;
|
||||
else if (type == "forwarder") return NETFORWARD;
|
||||
else if (type == "framegrabber") return SYSTEMCAPTURE;
|
||||
else if (type == "general") return GENERAL;
|
||||
else if (type == "grabberV4L2") return V4L2;
|
||||
else if (type == "jsonServer") return JSONSERVER;
|
||||
else if (type == "ledConfig") return LEDCONFIG;
|
||||
else if (type == "leds") return LEDS;
|
||||
else if (type == "logger") return LOGGER;
|
||||
else if (type == "smoothing") return SMOOTHING;
|
||||
else if (type == "webConfig") return WEBSERVER;
|
||||
else if (type == "instCapture") return INSTCAPTURE;
|
||||
else if (type == "network") return NETWORK;
|
||||
else if (type == "flatbufServer") return FLATBUFSERVER;
|
||||
else if (type == "protoServer") return PROTOSERVER;
|
||||
else return INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// @brief Convert string to settings::type representation
|
||||
/// @param type The string to convert
|
||||
/// @return The settings type from enum
|
||||
///
|
||||
inline type stringToType(const QString& type)
|
||||
{
|
||||
if (type == "backgroundEffect") return BGEFFECT;
|
||||
else if (type == "foregroundEffect") return FGEFFECT;
|
||||
else if (type == "blackborderdetector") return BLACKBORDER;
|
||||
else if (type == "boblightServer") return BOBLSERVER;
|
||||
else if (type == "color") return COLOR;
|
||||
else if (type == "device") return DEVICE;
|
||||
else if (type == "effects") return EFFECTS;
|
||||
else if (type == "forwarder") return NETFORWARD;
|
||||
else if (type == "framegrabber") return SYSTEMCAPTURE;
|
||||
else if (type == "general") return GENERAL;
|
||||
else if (type == "grabberV4L2") return V4L2;
|
||||
else if (type == "jsonServer") return JSONSERVER;
|
||||
else if (type == "ledConfig") return LEDCONFIG;
|
||||
else if (type == "leds") return LEDS;
|
||||
else if (type == "logger") return LOGGER;
|
||||
else if (type == "smoothing") return SMOOTHING;
|
||||
else if (type == "webConfig") return WEBSERVER;
|
||||
else if (type == "instCapture") return INSTCAPTURE;
|
||||
else if (type == "network") return NETWORK;
|
||||
else if (type == "flatbufServer") return FLATBUFSERVER;
|
||||
else if (type == "protoServer") return PROTOSERVER;
|
||||
else return INVALID;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user