Various Cleanups (#1075)

* LedDevice - Address clang findings

* Fix Windows Warnings

* Ensure newInput is initialised

* Clean-up unused elements for Plaform Capture

* Fix initialization problem and spellings

* Address clang findings and spelling corrections

* LedDevice clean-ups

* Cleanups

* Align that getLedCount is int

* Have "display" as default for Grabbers

* Fix config during start-up for missing elements

* Framegrabber Clean-up - Remove non supported grabbers from selection, filter valid options

* Typo

* Framegrabber.json - Fix property numbering

* Preselect active Grabbertype

* Sort Grabbernames

* Align options with selected element

* Fix deletion of pointer to incomplete type 'BonjourBrowserWrapper'

* Address macOS compile warnings

* Have default layout = 1 LED only to avoid errors as in #673

* Address lgtm findings

* Address finding that params passed to LedDevice discovery were not considered

* Cleanups after merging with latest master

* Update Changelog

* Address lgtm findings

* Fix comment

* Test Fix

* Fix Python Warning

* Handle Dummy Device assignment correctly

* Address delete called on non-final 'commandline::Option' that has virtual functions but non-virtual destructor

* Correct that QTimer.start accepts only int

* Have Release Python GIL & reset threat state chnage downward compatible

* Correct format specifier

* LedDevice - add assertions

* Readonly DB - Fix merge issue

* Smoothing - Fix wrong defaults

* LedDevice - correct assertion

* Show smoothing config set# in debug and related values.

* Suppress error on windows, if default file is "/dev/null"

* CMAKE - Allow to define QT_BASE_DIR dynamically via environment-variable

* Ignore Visual Studio specific files

Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
This commit is contained in:
LordGrey
2020-11-14 17:58:56 +01:00
committed by GitHub
parent d28540a7fe
commit efc2046ab5
93 changed files with 1140 additions and 1172 deletions

View File

@@ -38,7 +38,7 @@ public:
_height(other._height),
_pixels(new Pixel_T[other._width * other._height + 1])
{
memcpy(_pixels, other._pixels, (long) other._width * other._height * sizeof(Pixel_T));
memcpy(_pixels, other._pixels, static_cast<ulong>(other._width) * static_cast<ulong>(other._height) * sizeof(Pixel_T));
}
ImageData& operator=(ImageData rhs)
@@ -150,7 +150,7 @@ public:
ssize_t size() const
{
return (ssize_t) _width * _height * sizeof(Pixel_T);
return static_cast<ssize_t>(_width) * static_cast<ssize_t>(_height) * sizeof(Pixel_T);
}
void clear()
@@ -163,7 +163,7 @@ public:
_pixels = new Pixel_T[2];
}
memset(_pixels, 0, (unsigned long) _width * _height * sizeof(Pixel_T));
memset(_pixels, 0, static_cast<unsigned long>(_width) * static_cast<unsigned long>(_height) * sizeof(Pixel_T));
}
private:

View File

@@ -16,7 +16,7 @@ class NetOrigin : public QObject
Q_OBJECT
private:
friend class HyperionDaemon;
NetOrigin(QObject* parent = 0, Logger* log = Logger::getInstance("NETWORK"));
NetOrigin(QObject* parent = nullptr, Logger* log = Logger::getInstance("NETWORK"));
public:
///
@@ -33,8 +33,8 @@ public:
///
bool isLocalAddress(const QHostAddress& address, const QHostAddress& local) const;
static NetOrigin* getInstance(){ return instance; };
static NetOrigin* instance;
static NetOrigin *getInstance() { return instance; }
static NetOrigin *instance;
private slots:
///

View File

@@ -19,9 +19,6 @@ public:
/// @param adjustB
RgbChannelAdjustment(uint8_t adjustR, uint8_t adjustG, uint8_t adjustB, QString channelName="");
/// Destructor
~RgbChannelAdjustment();
///
/// Transform the given array value
///

View File

@@ -36,9 +36,9 @@ namespace hyperion {
{
std::vector<ColorRgb> fg_color = {
ColorRgb {
(uint8_t)FGCONFIG_ARRAY.at(0).toInt(0),
(uint8_t)FGCONFIG_ARRAY.at(1).toInt(0),
(uint8_t)FGCONFIG_ARRAY.at(2).toInt(0)
static_cast<uint8_t>(FGCONFIG_ARRAY.at(0).toInt(0)),
static_cast<uint8_t>(FGCONFIG_ARRAY.at(1).toInt(0)),
static_cast<uint8_t>(FGCONFIG_ARRAY.at(2).toInt(0))
}
};
hyperion->setColor(FG_PRIORITY, fg_color, fg_duration_ms);
@@ -62,22 +62,22 @@ namespace hyperion {
{
const double backlightThreshold = colorConfig["backlightThreshold"].toDouble(0.0);
const bool backlightColored = colorConfig["backlightColored"].toBool(false);
const double brightness = colorConfig["brightness"].toInt(100);
const double brightnessComp = colorConfig["brightnessCompensation"].toInt(100);
const int brightness = colorConfig["brightness"].toInt(100);
const int brightnessComp = colorConfig["brightnessCompensation"].toInt(100);
const double gammaR = colorConfig["gammaRed"].toDouble(1.0);
const double gammaG = colorConfig["gammaGreen"].toDouble(1.0);
const double gammaB = colorConfig["gammaBlue"].toDouble(1.0);
return RgbTransform(gammaR, gammaG, gammaB, backlightThreshold, backlightColored, brightness, brightnessComp);
return RgbTransform(gammaR, gammaG, gammaB, backlightThreshold, backlightColored, static_cast<uint8_t>(brightness), static_cast<uint8_t>(brightnessComp));
}
RgbChannelAdjustment createRgbChannelAdjustment(const QJsonObject& colorConfig, const QString& channelName, int defaultR, int defaultG, int defaultB)
{
const QJsonArray& channelConfig = colorConfig[channelName].toArray();
return RgbChannelAdjustment(
channelConfig[0].toInt(defaultR),
channelConfig[1].toInt(defaultG),
channelConfig[2].toInt(defaultB),
static_cast<uint8_t>(channelConfig[0].toInt(defaultR)),
static_cast<uint8_t>(channelConfig[1].toInt(defaultG)),
static_cast<uint8_t>(channelConfig[2].toInt(defaultB)),
"ChannelAdjust_" + channelName.toUpper()
);
}
@@ -101,7 +101,7 @@ namespace hyperion {
return adjustment;
}
MultiColorAdjustment * createLedColorsAdjustment(unsigned ledCnt, const QJsonObject & colorConfig)
MultiColorAdjustment * createLedColorsAdjustment(int ledCnt, const QJsonObject & colorConfig)
{
// Create the result, the transforms are added to this
MultiColorAdjustment * adjustment = new MultiColorAdjustment(ledCnt);
@@ -233,7 +233,7 @@ namespace hyperion {
std::sort(midPointsY.begin(), midPointsY.end());
midPointsY.erase(std::unique(midPointsY.begin(), midPointsY.end()), midPointsY.end());
QSize gridSize( midPointsX.size(), midPointsY.size() );
QSize gridSize( static_cast<int>(midPointsX.size()), static_cast<int>(midPointsY.size()) );
// Correct the grid in case it is malformed in width vs height
// Expected is at least 50% of width <-> height

View File

@@ -48,7 +48,7 @@ public:
{
case QJsonValue::Array:
{
for (const QJsonValue &v : value.toArray())
for (const QJsonValueRef v : value.toArray())
{
ret = getDefaultValue(v);
if (!ret.isEmpty())