Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random cleanup #861

Merged
merged 1 commit into from
Jul 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/api/JsonAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
///
Expand Down
2 changes: 1 addition & 1 deletion include/grabber/AmlogicGrabber.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class AmlogicGrabber : public Grabber
/// @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
Expand Down
5 changes: 0 additions & 5 deletions include/grabber/AmlogicWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ class AmlogicWrapper : public GrabberWrapper
///
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
Expand Down
2 changes: 1 addition & 1 deletion include/grabber/DispmanxFrameGrabber.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DispmanxFrameGrabber : public Grabber
/// @param[in] height The heigth of the captured screenshot
///
DispmanxFrameGrabber(const unsigned width, const unsigned height);
~DispmanxFrameGrabber();
~DispmanxFrameGrabber() override;


///
Expand Down
1 change: 0 additions & 1 deletion include/grabber/DispmanxFrameGrabberMock.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 0 additions & 5 deletions include/grabber/DispmanxWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ class DispmanxWrapper: public GrabberWrapper
///
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
Expand Down
7 changes: 0 additions & 7 deletions include/grabber/FramebufferFrameGrabber.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class FramebufferFrameGrabber : public Grabber
/// @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
Expand All @@ -36,12 +35,6 @@ class FramebufferFrameGrabber : public Grabber
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;
};
5 changes: 0 additions & 5 deletions include/grabber/FramebufferWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ class FramebufferWrapper: public GrabberWrapper
///
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
Expand Down
2 changes: 1 addition & 1 deletion include/grabber/OsxFrameGrabber.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class OsxFrameGrabber : public Grabber
/// @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
Expand Down
5 changes: 0 additions & 5 deletions include/grabber/OsxWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ class OsxWrapper: public GrabberWrapper
///
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
Expand Down
2 changes: 1 addition & 1 deletion include/grabber/QtGrabber.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class QtGrabber : public Grabber

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
Expand Down
5 changes: 0 additions & 5 deletions include/grabber/QtWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ class QtWrapper: public GrabberWrapper
///
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
Expand Down
1 change: 0 additions & 1 deletion include/grabber/V4L2Wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class V4L2Wrapper : public GrabberWrapper
VideoStandard videoStandard,
PixelFormat pixelFormat,
int pixelDecimation );
virtual ~V4L2Wrapper() {};

bool getSignalDetectionEnable();

Expand Down
2 changes: 1 addition & 1 deletion include/grabber/X11Grabber.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class X11Grabber : public Grabber

X11Grabber(int cropLeft, int cropRight, int cropTop, int cropBottom, int pixelDecimation);

virtual ~X11Grabber();
~X11Grabber() override;

bool Setup();

Expand Down
5 changes: 0 additions & 5 deletions include/grabber/X11Wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ class X11Wrapper: public GrabberWrapper
///
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
Expand Down
1 change: 0 additions & 1 deletion include/hyperion/CaptureCont.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion include/hyperion/Grabber.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
31 changes: 12 additions & 19 deletions include/hyperion/Hyperion.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

// stl includes
#include <list>
#include <QMap>

// QT includes
#include <QString>
Expand All @@ -11,6 +10,7 @@
#include <QJsonObject>
#include <QJsonValue>
#include <QJsonArray>
#include <QMap>
#include <QMutex>

// hyperion-utils includes
Expand Down Expand Up @@ -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
Expand All @@ -94,7 +87,7 @@ class Hyperion : public QObject
///
/// @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();
Expand All @@ -110,8 +103,8 @@ class Hyperion : public QObject

///
/// @brief Get the current active led device
/// @return The device nam
/// e
/// @return The device name
///
const QString & getActiveDeviceType();

///
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions include/hyperion/HyperionIManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class Hyperion;
class InstanceTable;

enum instanceState{
enum class InstanceState{
H_STARTED,
H_ON_STOP,
H_STOPPED,
Expand All @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -103,7 +103,7 @@ public slots:
/// @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
Expand Down Expand Up @@ -172,7 +172,7 @@ private slots:
/// @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;
Expand Down
1 change: 1 addition & 0 deletions include/hyperion/LedString.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ inline QString colorOrderToString(const ColorOrder colorOrder)
return "not-a-colororder";
}
}

inline ColorOrder stringToColorOrder(const QString & order)
{
if (order == "rgb")
Expand Down
5 changes: 2 additions & 3 deletions include/leddevice/LedDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -186,7 +186,6 @@ public slots:
/// Time a device requires mandatorily between two writes
int _latchTime_ms;


protected slots:

/// Write the last data to the leds again
Expand Down
4 changes: 2 additions & 2 deletions include/leddevice/LedDeviceWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -106,7 +106,7 @@ private slots:
private:
///
/// @brief switchOff() the device and Stops the device thread
///
///
void stopDeviceThread();

private:
Expand Down
2 changes: 1 addition & 1 deletion include/protoserver/ProtoServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ProtoServer : public QObject

public:
ProtoServer(const QJsonDocument& config, QObject* parent = nullptr);
~ProtoServer();
~ProtoServer() override;

public slots:
///
Expand Down
Loading