Random cleanup (#861)

Co-authored-by: Seker <murat.seker@barco.com>
This commit is contained in:
Murat Seker
2020-07-12 09:19:59 +02:00
committed by GitHub
parent de9ece5139
commit 138b7d9c94
74 changed files with 115 additions and 234 deletions

View File

@@ -85,7 +85,7 @@ private slots:
/// @param instance The index of instance
/// @param name The name of the instance, just available with H_CREATED
///
void handleInstanceStateChange(const instanceState &state, const quint8 &instance, const QString &name = QString());
void handleInstanceStateChange(const InstanceState &state, const quint8 &instance, const QString &name = QString());
signals:
///

View File

@@ -18,7 +18,7 @@ public:
/// @param[in] height The heigth of the captured screenshot
///
AmlogicGrabber(const unsigned width, const unsigned height);
~AmlogicGrabber();
~AmlogicGrabber() override;
///
/// Captures a single snapshot of the display and writes the data to the given image. The

View File

@@ -20,11 +20,6 @@ public:
///
AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight);
///
/// Destructor of this dispmanx frame grabber. Releases any claimed resources.
///
virtual ~AmlogicWrapper() {};
public slots:
///
/// Performs a single frame grab and computes the led-colors

View File

@@ -27,7 +27,7 @@ public:
/// @param[in] height The heigth of the captured screenshot
///
DispmanxFrameGrabber(const unsigned width, const unsigned height);
~DispmanxFrameGrabber();
~DispmanxFrameGrabber() override;
///

View File

@@ -36,5 +36,4 @@ int vc_dispmanx_resource_read_data(DISPMANX_RESOURCE_HANDLE_T vc_resource, VC_R
void vc_dispmanx_rect_set(VC_RECT_T *rectangle, int left, int top, int width, int height);
int vc_dispmanx_snapshot(int, DISPMANX_RESOURCE_HANDLE_T resource, int vc_flags);
#endif

View File

@@ -22,11 +22,6 @@ public:
///
DispmanxWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz);
///
/// Destructor of this dispmanx frame grabber. Releases any claimed resources.
///
virtual ~DispmanxWrapper() {};
public slots:
///
/// Performs a single frame grab and computes the led-colors

View File

@@ -18,7 +18,6 @@ public:
/// @param[in] height The heigth of the captured screenshot
///
FramebufferFrameGrabber(const QString & device, const unsigned width, const unsigned height);
~FramebufferFrameGrabber();
///
/// Captures a single snapshot of the display and writes the data to the given image. The
@@ -36,12 +35,6 @@ public:
virtual void setDevicePath(const QString& path);
private:
/// Framebuffer file descriptor
int _fbfd;
/// Pointer to framebuffer
unsigned char * _fbp;
/// Framebuffer device e.g. /dev/fb0
QString _fbDevice;
};

View File

@@ -22,11 +22,6 @@ public:
///
FramebufferWrapper(const QString & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz);
///
/// Destructor of this framebuffer frame grabber. Releases any claimed resources.
///
virtual ~FramebufferWrapper() {};
public slots:
///
/// Performs a single frame grab and computes the led-colors

View File

@@ -25,7 +25,7 @@ public:
/// @param[in] height The heigth of the captured screenshot
///
OsxFrameGrabber(const unsigned display, const unsigned width, const unsigned height);
~OsxFrameGrabber();
~OsxFrameGrabber() override;
///
/// Captures a single snapshot of the display and writes the data to the given image. The

View File

@@ -22,11 +22,6 @@ public:
///
OsxWrapper(const unsigned display, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz);
///
/// Destructor of this osx frame grabber. Releases any claimed resources.
///
virtual ~OsxWrapper() {};
public slots:
///
/// Performs a single frame grab and computes the led-colors

View File

@@ -17,7 +17,7 @@ public:
QtGrabber(int cropLeft, int cropRight, int cropTop, int cropBottom, int pixelDecimation, int display);
virtual ~QtGrabber();
~QtGrabber() override;
///
/// Captures a single snapshot of the display and writes the data to the given image. The

View File

@@ -21,11 +21,6 @@ public:
///
QtWrapper(int cropLeft, int cropRight, int cropTop, int cropBottom, int pixelDecimation, int display, const unsigned updateRate_Hz);
///
/// Destructor of this qt frame grabber. Releases any claimed resources.
///
virtual ~QtWrapper() {};
public slots:
///
/// Performs a single frame grab and computes the led-colors

View File

@@ -16,7 +16,6 @@ public:
VideoStandard videoStandard,
PixelFormat pixelFormat,
int pixelDecimation );
virtual ~V4L2Wrapper() {};
bool getSignalDetectionEnable();

View File

@@ -19,7 +19,7 @@ public:
X11Grabber(int cropLeft, int cropRight, int cropTop, int cropBottom, int pixelDecimation);
virtual ~X11Grabber();
~X11Grabber() override;
bool Setup();

View File

@@ -26,11 +26,6 @@ public:
///
X11Wrapper(int cropLeft, int cropRight, int cropTop, int cropBottom, int pixelDecimation, const unsigned updateRate_Hz);
///
/// Destructor of this framebuffer frame grabber. Releases any claimed resources.
///
virtual ~X11Wrapper() {};
public slots:
///
/// Performs a single frame grab and computes the led-colors

View File

@@ -17,7 +17,6 @@ class CaptureCont : public QObject
Q_OBJECT
public:
CaptureCont(Hyperion* hyperion);
~CaptureCont();
void setSystemCaptureEnable(const bool& enable);
void setV4LCaptureEnable(const bool& enable);

View File

@@ -23,7 +23,6 @@ class Grabber : public QObject
public:
Grabber(QString grabberName = "", int width=0, int height=0, int cropLeft=0, int cropRight=0, int cropTop=0, int cropBottom=0);
virtual ~Grabber();
///
/// Set the video mode (2D/3D)

View File

@@ -2,7 +2,6 @@
// stl includes
#include <list>
#include <QMap>
// QT includes
#include <QString>
@@ -11,6 +10,7 @@
#include <QJsonObject>
#include <QJsonValue>
#include <QJsonArray>
#include <QMap>
#include <QMutex>
// hyperion-utils includes
@@ -59,32 +59,25 @@ class Hyperion : public QObject
Q_OBJECT
public:
/// Type definition of the info structure used by the priority muxer
typedef PriorityMuxer::InputInfo InputInfo;
///
/// RGB-Color channel enumeration
///
enum RgbChannel
{
BLACK, WHITE, RED, GREEN, BLUE, CYAN, MAGENTA, YELLOW, INVALID
};
using InputInfo = PriorityMuxer::InputInfo;
///
/// Destructor; cleans up resources
///
virtual ~Hyperion();
~Hyperion() override;
///
/// free all alocated objects, should be called only from constructor or before restarting hyperion
///
void freeObjects(bool emitCloseSignal=false);
ImageProcessor* getImageProcessor() { return _imageProcessor; };
ImageProcessor* getImageProcessor() { return _imageProcessor; }
///
/// @brief Get instance index of this instance
/// @return The index of this instance
///
const quint8 & getInstanceIndex() { return _instIndex; };
const quint8 & getInstanceIndex() { return _instIndex; }
///
/// Returns the number of attached leds
@@ -94,7 +87,7 @@ public:
///
/// @brief Return the size of led grid
///
QSize getLedGridSize() const { return _ledGridSize; };
QSize getLedGridSize() const { return _ledGridSize; }
/// gets the methode how image is maped to leds
const int & getLedMappingType();
@@ -110,8 +103,8 @@ public:
///
/// @brief Get the current active led device
/// @return The device nam
/// e
/// @return The device name
///
const QString & getActiveDeviceType();
///
@@ -206,7 +199,7 @@ public slots:
/// @return EffectEngine instance pointer
///
EffectEngine* getEffectEngineInstance() { return _effectEngine; };
EffectEngine* getEffectEngineInstance() { return _effectEngine; }
///
/// @brief Save an effect
/// @param obj The effect args
@@ -259,7 +252,7 @@ public slots:
/// @brief Get a pointer to the priorityMuxer instance
/// @return PriorityMuxer instance pointer
///
PriorityMuxer* getMuxerInstance() { return &_muxer; };
PriorityMuxer* getMuxerInstance() { return &_muxer; }
///
/// @brief enable/disable automatic/priorized source selection
@@ -335,7 +328,7 @@ public slots:
/// @brief Get the component Register
/// return Component register pointer
///
ComponentRegister& getComponentRegister() { return _componentRegister; };
ComponentRegister& getComponentRegister() { return _componentRegister; }
///
/// @brief Called from components to update their current state. DO NOT CALL FROM USERS
@@ -489,7 +482,7 @@ private slots:
///
/// @brief Apply new videoMode from Daemon to _currVideoMode
///
void handleNewVideoMode(const VideoMode& mode) { _currVideoMode = mode; };
void handleNewVideoMode(const VideoMode& mode) { _currVideoMode = mode; }
private:
friend class HyperionDaemon;

View File

@@ -12,7 +12,7 @@
class Hyperion;
class InstanceTable;
enum instanceState{
enum class InstanceState{
H_STARTED,
H_ON_STOP,
H_STOPPED,
@@ -29,7 +29,7 @@ class HyperionIManager : public QObject
public:
// global instance pointer
static HyperionIManager* getInstance() { return HIMinstance; };
static HyperionIManager* getInstance() { return HIMinstance; }
static HyperionIManager* HIMinstance;
public slots:
@@ -38,7 +38,7 @@ public slots:
/// @param inst The instance to check
/// @return True when running else false
///
bool IsInstanceRunning(const quint8& inst) { return _runningInstances.contains(inst); };
bool IsInstanceRunning(const quint8& inst) { return _runningInstances.contains(inst); }
///
/// @brief Get a Hyperion instance by index
@@ -103,7 +103,7 @@ signals:
/// @param instance The index of instance
/// @param name The name of the instance, just available with H_CREATED
///
void instanceStateChanged(const instanceState& state, const quint8& instance, const QString& name = QString());
void instanceStateChanged(const InstanceState& state, const quint8& instance, const QString& name = QString());
///
/// @brief Emits whenever something changes, the lazy version of instanceStateChanged (- H_ON_STOP) + saveName() emit
@@ -172,7 +172,7 @@ private:
/// @brief check if a instance is allowed for management. Instance 0 represents the root instance
/// @apram inst The instance to check
///
bool isInstAllowed(const quint8& inst) { return (inst > 0); };
bool isInstAllowed(const quint8& inst) { return (inst > 0); }
private:
Logger* _log;

View File

@@ -40,6 +40,7 @@ inline QString colorOrderToString(const ColorOrder colorOrder)
return "not-a-colororder";
}
}
inline ColorOrder stringToColorOrder(const QString & order)
{
if (order == "rgb")

View File

@@ -36,7 +36,7 @@ class LedDevice : public QObject
public:
LedDevice(const QJsonObject& config = QJsonObject(), QObject* parent = nullptr);
virtual ~LedDevice();
~LedDevice() override;
///
/// @brief Get color order of device
@@ -92,7 +92,7 @@ public slots:
///
/// Is called on thread start, all construction tasks and init should run here
///
virtual void start() { _deviceReady = (open() == 0 ? true : false);}
virtual void start() { _deviceReady = (open() == 0); }
///
/// Update the RGB-Color values to the leds.
@@ -186,7 +186,6 @@ protected:
/// Time a device requires mandatorily between two writes
int _latchTime_ms;
protected slots:
/// Write the last data to the leds again

View File

@@ -19,7 +19,7 @@ class LedDeviceWrapper : public QObject
Q_OBJECT
public:
explicit LedDeviceWrapper(Hyperion* hyperion);
~LedDeviceWrapper();
~LedDeviceWrapper() override;
///
/// @brief Contructs a new LedDevice, moves to thread and starts
/// @param config With the given config
@@ -106,7 +106,7 @@ protected:
private:
///
/// @brief switchOff() the device and Stops the device thread
///
///
void stopDeviceThread();
private:

View File

@@ -22,7 +22,7 @@ class ProtoServer : public QObject
public:
ProtoServer(const QJsonDocument& config, QObject* parent = nullptr);
~ProtoServer();
~ProtoServer() override;
public slots:
///

View File

@@ -24,7 +24,7 @@ public:
///
/// @brief Sends BYE BYE and stop server
///
///
void stopServer();
public slots:
@@ -50,23 +50,23 @@ private:
///
/// @brief Build http url for current ip:port/desc.xml
///
const QString getDescAddress();
QString getDescAddress() const;
///
/// @brief Get the base address
///
const QString getBaseAddress();
QString getBaseAddress() const;
///
/// @brief Build the ssdp description (description.xml)
///
const QString buildDesc();
QString buildDesc() const;
///
/// @brief Get the local address of interface
/// @return the address, might be empty
///
const QString getLocalAddress();
QString getLocalAddress() const;
///
/// @brief Send alive/byebye message based on _deviceList

View File

@@ -4,8 +4,6 @@
#include <cstdint>
#include <ostream>
struct ColorArgb;
struct ColorArgb
{
@@ -49,4 +47,3 @@ inline std::ostream& operator<<(std::ostream& os, const ColorArgb& color)
os << "{" << unsigned(color.alpha) << "," << unsigned(color.red) << "," << unsigned(color.green) << "," << unsigned(color.blue) << "}";
return os;
}

View File

@@ -4,8 +4,6 @@
#include <cstdint>
#include <iostream>
struct ColorBgr;
///
/// Plain-Old-Data structure containing the red-green-blue color specification. Size of the
/// structure is exactly 3-bytes for easy writing to led-device

View File

@@ -6,8 +6,6 @@
#include <QTextStream>
struct ColorRgb;
///
/// Plain-Old-Data structure containing the red-green-blue color specification. Size of the
/// structure is exactly 3-bytes for easy writing to led-device
@@ -87,4 +85,3 @@ inline bool operator>=(const ColorRgb & lhs, const ColorRgb & rhs)
{
return (lhs.red >= rhs.red) && (lhs.green >= rhs.green) && (lhs.blue >= rhs.blue);
}

View File

@@ -4,8 +4,6 @@
#include <cstdint>
#include <ostream>
struct ColorRgba;
struct ColorRgba
{
@@ -49,4 +47,3 @@ inline std::ostream& operator<<(std::ostream& os, const ColorRgba& color)
os << "{" << unsigned(color.alpha) << "," << unsigned(color.red) << "," << unsigned(color.green) << "," << unsigned(color.blue) << "}";
return os;
}

View File

@@ -4,8 +4,6 @@
#include <cstdint>
#include <iostream>
struct ColorRgbw;
///
/// Plain-Old-Data structure containing the red-green-blue color specification. Size of the
/// structure is exactly 3-bytes for easy writing to led-device

View File

@@ -67,7 +67,7 @@ inline const char* componentToIdString(Components c)
}
}
inline Components stringToComponent(QString component)
inline Components stringToComponent(QString component)
{
component = component.toUpper();
if (component == "ALL") return COMP_ALL;

View File

@@ -10,8 +10,8 @@
namespace FileUtils {
QString getBaseName(QString sourceFile);
QString getDirName(QString sourceFile);
QString getBaseName(QString sourceFile);
QString getDirName(QString sourceFile);
///
/// @brief remove directory recursive given by path

View File

@@ -21,7 +21,7 @@ public:
return & instance;
}
private:
GlobalSignals() {}
GlobalSignals() = default;
public:
GlobalSignals(GlobalSignals const&) = delete;

View File

@@ -21,7 +21,7 @@ For more profiler function see the macros listed below
*/
#ifndef ENABLE_PROFILER
#error "Profiler is not for productive code, enable it via cmake or remove header include"
#error "Profiler is not for production code, enable it via cmake or remove header include"
#endif
// profiler
@@ -50,4 +50,3 @@ private:
unsigned int _blockId;
clock_t _startTime;
};

View File

@@ -26,11 +26,6 @@ public:
///
RgbTransform(double gammaR, double gammaG, double gammaB, double backlightThreshold, bool backlightColored, uint8_t brightness, uint8_t brightnessCompensation);
///
/// Destructor
///
~RgbTransform();
/// @return The current red gamma value
double getGammaR() const;

View File

@@ -20,7 +20,6 @@ public:
QString domainName;
};
~SysInfo();
static HyperionSysInfo get();
private:

View File

@@ -34,15 +34,15 @@ class WebServer : public QObject {
public:
WebServer (const QJsonDocument& config, const bool& useSsl, QObject * parent = 0);
virtual ~WebServer (void);
~WebServer () override;
void start();
void stop();
quint16 getPort() { return _port; };
quint16 getPort() const { return _port; }
/// check if server has been inited
bool isInited() { return _inited; };
bool isInited() const { return _inited; }
///
/// @brief Set a new description, if empty the description is NotFound for clients