Merge branch 'master' into refactor/led_device

This commit is contained in:
Murat Seker
2020-08-23 21:02:25 +02:00
committed by GitHub
272 changed files with 1711 additions and 1738 deletions

View File

@@ -38,25 +38,25 @@ public:
/// @brief Get the unique id (imported from removed class 'Stats')
/// @return The unique id
///
const QString &getID() { return _uuid; };
QString getID() const { return _uuid; }
///
/// @brief Check authorization is required according to the user setting
/// @return True if authorization required else false
///
const bool &isAuthRequired() { return _authRequired; };
bool isAuthRequired() const { return _authRequired; }
///
/// @brief Check if authorization is required for local network connections
/// @return True if authorization required else false
///
const bool &isLocalAuthRequired() { return _localAuthRequired; };
bool isLocalAuthRequired() const { return _localAuthRequired; }
///
/// @brief Check if authorization is required for local network connections for admin access
/// @return True if authorization required else false
///
const bool &isLocalAdminAuthRequired() { return _localAdminAuthRequired; };
bool isLocalAdminAuthRequired() const { return _localAdminAuthRequired; }
///
/// @brief Reset Hyperion user
@@ -68,18 +68,18 @@ public:
/// @brief Check if user auth is temporary blocked due to failed attempts
/// @return True on blocked and no further Auth requests will be accepted
///
bool isUserAuthBlocked() { return (_userAuthAttempts.length() >= 10); };
bool isUserAuthBlocked() const { return (_userAuthAttempts.length() >= 10); }
///
/// @brief Check if token auth is temporary blocked due to failed attempts
/// @return True on blocked and no further Auth requests will be accepted
///
bool isTokenAuthBlocked() { return (_tokenAuthAttempts.length() >= 25); };
bool isTokenAuthBlocked() const { return (_tokenAuthAttempts.length() >= 25); }
/// Pointer of this instance
static AuthManager *manager;
/// Get Pointer of this instance
static AuthManager *getInstance() { return manager; };
static AuthManager *getInstance() { return manager; }
public slots:
@@ -158,32 +158,32 @@ public slots:
/// @param id The id of the request
/// @param accept The accept or deny the request
///
void handlePendingTokenRequest(const QString &id, const bool &accept);
void handlePendingTokenRequest(const QString &id, bool accept);
///
/// @brief Get pending requests
/// @return All pending requests
///
QVector<AuthManager::AuthDefinition> getPendingRequests();
QVector<AuthManager::AuthDefinition> getPendingRequests() const;
///
/// @brief Get the current valid token for user. Make sure this call is allowed!
/// @param usr the defined user
/// @return The token
///
const QString getUserToken(const QString &usr = "Hyperion");
QString getUserToken(const QString &usr = "Hyperion") const;
///
/// @brief Get all available token entries
///
QVector<AuthManager::AuthDefinition> getTokenList();
QVector<AuthManager::AuthDefinition> getTokenList() const;
///
/// @brief Handle settings update from Hyperion Settingsmanager emit
/// @param type settings type from enum
/// @param config configuration object
///
void handleSettingsUpdate(const settings::type &type, const QJsonDocument &config);
void handleSettingsUpdate(settings::type type, const QJsonDocument &config);
signals:
///
@@ -201,7 +201,7 @@ signals:
/// @param comment The comment that was part of the request
/// @param id The id that was part of the request
///
void tokenResponse(const bool &success, QObject *caller, const QString &token, const QString &comment, const QString &id);
void tokenResponse(bool success, QObject *caller, const QString &token, const QString &comment, const QString &id);
///
/// @brief Emits whenever the token list changes
@@ -214,7 +214,7 @@ private:
/// @brief Increment counter for token/user auth
/// @param user If true we increment USER auth instead of token
///
void setAuthBlock(const bool &user = false);
void setAuthBlock(bool user = false);
/// Database interface for auth table
AuthTable *_authTable;

View File

@@ -29,7 +29,7 @@ private slots:
/// @param type settingyType from enum
/// @param config configuration object
///
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config)
void handleSettingsUpdate(settings::type type, const QJsonDocument& config)
{
if(type == settings::BGEFFECT)
{

View File

@@ -18,8 +18,8 @@ class CaptureCont : public QObject
public:
CaptureCont(Hyperion* hyperion);
void setSystemCaptureEnable(const bool& enable);
void setV4LCaptureEnable(const bool& enable);
void setSystemCaptureEnable(bool enable);
void setV4LCaptureEnable(bool enable);
private slots:
///
@@ -27,14 +27,14 @@ private slots:
/// @param component The component from enum
/// @param enable The new state
///
void handleCompStateChangeRequest(const hyperion::Components component, bool enable);
void handleCompStateChangeRequest(hyperion::Components component, bool enable);
///
/// @brief Handle settings update from Hyperion Settingsmanager emit or this constructor
/// @param type settingyType from enum
/// @param config configuration object
///
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config);
void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
///
/// @brief forward system image

View File

@@ -20,17 +20,17 @@ class ComponentRegister : public QObject
public:
ComponentRegister(Hyperion* hyperion);
~ComponentRegister();
~ComponentRegister() override;
///
/// @brief Check if a component is currently enabled
/// @param comp The component from enum
/// @return True if component is running else false. Not found is -1
///
int isComponentEnabled(const hyperion::Components& comp) const;
int isComponentEnabled(hyperion::Components comp) const;
/// contains all components and their state
std::map<hyperion::Components, bool> getRegister() const { return _componentStates; };
std::map<hyperion::Components, bool> getRegister() const { return _componentStates; }
signals:
///
@@ -38,7 +38,7 @@ signals:
/// @param comp The component
/// @param state The new state of the component
///
void updatedComponentState(const hyperion::Components comp, const bool state);
void updatedComponentState(hyperion::Components comp, bool state);
public slots:
///
@@ -46,13 +46,13 @@ public slots:
/// @param comp The component
/// @param state The new state of the component
///
void setNewComponentState(const hyperion::Components comp, const bool activated);
void setNewComponentState(hyperion::Components comp, bool activated);
private slots:
///
/// @brief Handle COMP_ALL changes from Hyperion->compStateChangeRequest
///
void handleCompStateChangeRequest(const hyperion::Components comps, const bool activated);
void handleCompStateChangeRequest(hyperion::Components comps, bool activated);
private:
/// Hyperion instance

View File

@@ -22,7 +22,7 @@ class Grabber : public QObject
Q_OBJECT
public:
Grabber(QString grabberName = "", int width=0, int height=0, int cropLeft=0, int cropRight=0, int cropTop=0, int cropBottom=0);
Grabber(const QString& grabberName = "", int width=0, int height=0, int cropLeft=0, int cropRight=0, int cropTop=0, int cropBottom=0);
///
/// Set the video mode (2D/3D)
@@ -119,35 +119,35 @@ public:
/// @brief Get a list of all available V4L devices
/// @return List of all available V4L devices on success else empty List
///
virtual QStringList getV4L2devices() { return QStringList(); }
virtual QStringList getV4L2devices() const { return QStringList(); }
///
/// @brief Get the V4L device name
/// @param devicePath The device path
/// @return The name of the V4L device on success else empty String
///
virtual QString getV4L2deviceName(QString devicePath) { return QString(); }
virtual QString getV4L2deviceName(const QString& /*devicePath*/) const { return QString(); }
///
/// @brief Get a name/index pair of supported device inputs
/// @param devicePath The device path
/// @return multi pair of name/index on success else empty pair
///
virtual QMultiMap<QString, int> getV4L2deviceInputs(QString devicePath) { return QMultiMap<QString, int>(); }
virtual QMultiMap<QString, int> getV4L2deviceInputs(const QString& /*devicePath*/) const { return QMultiMap<QString, int>(); }
///
/// @brief Get a list of supported device resolutions
/// @param devicePath The device path
/// @return List of resolutions on success else empty List
///
virtual QStringList getResolutions(QString devicePath) { return QStringList(); }
virtual QStringList getResolutions(const QString& /*devicePath*/) const { return QStringList(); }
///
/// @brief Get a list of supported device framerates
/// @param devicePath The device path
/// @return List of framerates on success else empty List
///
virtual QStringList getFramerates(QString devicePath) { return QStringList(); }
virtual QStringList getFramerates(const QString& devicePath) const { return QStringList(); }
protected:
ImageResampler _imageResampler;

View File

@@ -29,9 +29,9 @@ class GrabberWrapper : public QObject
{
Q_OBJECT
public:
GrabberWrapper(QString grabberName, Grabber * ggrabber, unsigned width, unsigned height, const unsigned updateRate_Hz = 0);
GrabberWrapper(const QString& grabberName, Grabber * ggrabber, unsigned width, unsigned height, unsigned updateRate_Hz = 0);
virtual ~GrabberWrapper();
~GrabberWrapper() override;
static GrabberWrapper* instance;
static GrabberWrapper* getInstance(){ return instance; }
@@ -60,35 +60,35 @@ public:
/// @brief Get a list of all available V4L devices
/// @return List of all available V4L devices on success else empty List
///
virtual QStringList getV4L2devices();
virtual QStringList getV4L2devices() const;
///
/// @brief Get the V4L device name
/// @param devicePath The device path
/// @return The name of the V4L device on success else empty String
///
virtual QString getV4L2deviceName(QString devicePath);
virtual QString getV4L2deviceName(const QString& devicePath) const;
///
/// @brief Get a name/index pair of supported device inputs
/// @param devicePath The device path
/// @return multi pair of name/index on success else empty pair
///
virtual QMultiMap<QString, int> getV4L2deviceInputs(QString devicePath);
virtual QMultiMap<QString, int> getV4L2deviceInputs(const QString& devicePath) const;
///
/// @brief Get a list of supported device resolutions
/// @param devicePath The device path
/// @return List of resolutions on success else empty List
///
virtual QStringList getResolutions(QString devicePath);
virtual QStringList getResolutions(const QString& devicePath) const;
///
/// @brief Get a list of supported device framerates
/// @param devicePath The device path
/// @return List of framerates on success else empty List
///
virtual QStringList getFramerates(QString devicePath);
virtual QStringList getFramerates(const QString& devicePath) const;
static QStringList availableGrabbers();
@@ -122,7 +122,7 @@ public slots:
/// Set the video mode (2D/3D)
/// @param[in] mode The new video mode
///
virtual void setVideoMode(const VideoMode& videoMode);
virtual void setVideoMode(VideoMode videoMode);
///
/// Set the crop values
@@ -138,7 +138,7 @@ public slots:
/// @param type settingyType from enum
/// @param config configuration object
///
virtual void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config);
virtual void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
signals:
///
@@ -149,7 +149,7 @@ signals:
private slots:
/// @brief Handle a source request event from Hyperion.
/// Will start and stop grabber based on active listeners count
void handleSourceRequest(const hyperion::Components& component, const int hyperionInd, const bool listen);
void handleSourceRequest(hyperion::Components component, int hyperionInd, bool listen);
///
/// @brief Update Update capture rate

View File

@@ -120,7 +120,7 @@ public slots:
/// @param[in] owner Specific owner string, might be empty
/// @param[in] smooth_cfg The smooth id to use
///
void registerInput(const int priority, const hyperion::Components& component, const QString& origin = "System", const QString& owner = "", unsigned smooth_cfg = 0);
void registerInput(int priority, hyperion::Components component, const QString& origin = "System", const QString& owner = "", unsigned smooth_cfg = 0);
///
/// @brief Update the current color of a priority (prev registered with registerInput())
@@ -131,7 +131,7 @@ public slots:
/// @param clearEffect Should be true when NOT called from an effect
/// @return True on success, false when priority is not found
///
bool setInput(const int priority, const std::vector<ColorRgb>& ledColors, const int timeout_ms = -1, const bool& clearEffect = true);
bool setInput(int priority, const std::vector<ColorRgb>& ledColors, int timeout_ms = -1, bool clearEffect = true);
///
/// @brief Update the current image of a priority (prev registered with registerInput())
@@ -142,7 +142,7 @@ public slots:
/// @param clearEffect Should be true when NOT called from an effect
/// @return True on success, false when priority is not found
///
bool setInputImage(const int priority, const Image<ColorRgb>& image, const int64_t timeout_ms = -1, const bool& clearEffect = true);
bool setInputImage(int priority, const Image<ColorRgb>& image, int64_t timeout_ms = -1, bool clearEffect = true);
///
/// Writes a single color to all the leds for the given time and priority
@@ -155,20 +155,20 @@ public slots:
/// @param[in] origin The setter
/// @param clearEffect Should be true when NOT called from an effect
///
void setColor(const int priority, const std::vector<ColorRgb> &ledColors, const int timeout_ms = -1, const QString& origin = "System" ,bool clearEffects = true);
void setColor(int priority, const std::vector<ColorRgb> &ledColors, int timeout_ms = -1, const QString& origin = "System" ,bool clearEffects = true);
///
/// @brief Set the given priority to inactive
/// @param priority The priority
/// @return True on success false if not found
///
bool setInputInactive(const quint8& priority);
bool setInputInactive(quint8 priority);
///
/// Returns the list with unique adjustment identifiers
/// @return The list with adjustment identifiers
///
const QStringList & getAdjustmentIds() const;
QStringList getAdjustmentIds() const;
///
/// Returns the ColorAdjustment with the given identifier
@@ -187,7 +187,7 @@ public slots:
/// @param[in] forceClearAll Force the clear
/// @return True on success else false (not found)
///
bool clear(const int priority, bool forceClearAll=false);
bool clear(int priority, bool forceClearAll=false);
/// #############
// EFFECTENGINE
@@ -233,15 +233,15 @@ public slots:
/// Get the list of available effects
/// @return The list of available effects
const std::list<EffectDefinition> &getEffects() const;
std::list<EffectDefinition> getEffects() const;
/// Get the list of active effects
/// @return The list of active effects
const std::list<ActiveEffectDefinition> &getActiveEffects() const;
std::list<ActiveEffectDefinition> getActiveEffects() const;
/// Get the list of available effect schema files
/// @return The list of available effect schema files
const std::list<EffectSchema> &getEffectSchemas() const;
std::list<EffectSchema> getEffectSchemas() const;
/// #############
/// PRIORITYMUXER
@@ -255,18 +255,18 @@ public slots:
/// @brief enable/disable automatic/priorized source selection
/// @param state The new state
///
void setSourceAutoSelect(const bool state);
void setSourceAutoSelect(bool state);
///
/// @brief set current input source to visible
/// @param priority the priority channel which should be vidible
/// @return true if success, false on error
///
bool setVisiblePriority(const int& priority);
bool setVisiblePriority(int priority);
/// gets current state of automatic/priorized source selection
/// @return the state
bool sourceAutoSelectEnabled();
bool sourceAutoSelectEnabled() const;
///
/// Returns the current priority
@@ -280,7 +280,7 @@ public slots:
///
/// @return bool
///
bool isCurrentPriority(const int priority) const;
bool isCurrentPriority(int priority) const;
///
/// Returns a list of all registered priorities
@@ -296,7 +296,7 @@ public slots:
///
/// @return The information of the given, a not found priority will return lowest priority as fallback
///
InputInfo getPriorityInfo(const int priority) const;
InputInfo getPriorityInfo(int priority) const;
/// #############
/// SETTINGSMANAGER
@@ -305,11 +305,11 @@ public slots:
/// @param type The settingsType from enum
/// @return Data Document
///
QJsonDocument getSetting(const settings::type& type) const;
QJsonDocument getSetting(settings::type type) const;
/// gets the current json config object from SettingsManager
/// @return json config
const QJsonObject& getQJsonConfig() const;
QJsonObject getQJsonConfig() const;
///
/// @brief Save a complete json config
@@ -317,7 +317,7 @@ public slots:
/// @param correct If true will correct json against schema before save
/// @return True on success else false
///
bool saveSettings(QJsonObject config, const bool& correct = false);
bool saveSettings(const QJsonObject& config, bool correct = false);
/// ############
/// COMPONENTREGISTER
@@ -332,7 +332,7 @@ public slots:
/// @param[in] component The component from enum
/// @param[in] state The state of the component [true | false]
///
void setNewComponentState(const hyperion::Components& component, const bool& state);
void setNewComponentState(hyperion::Components component, bool state);
///
/// @brief Get a list of all contrable components and their current state
@@ -345,16 +345,16 @@ public slots:
/// @param The component to test
/// @return Component state
///
int isComponentEnabled(const hyperion::Components& comp);
int isComponentEnabled(hyperion::Components comp) const;
/// sets the methode how image is maped to leds at ImageProcessor
void setLedMappingType(const int& mappingType);
void setLedMappingType(int mappingType);
///
/// Set the video mode (2D/3D)
/// @param[in] mode The new video mode
///
void setVideoMode(const VideoMode& mode);
void setVideoMode(VideoMode mode);
///
/// @brief Init after thread start
@@ -383,13 +383,13 @@ signals:
/// @param component The component from enum
/// @param enabled The new state of the component
///
void compStateChangeRequest(const hyperion::Components component, bool enabled);
void compStateChangeRequest(hyperion::Components component, bool enabled);
///
/// @brief Emits whenever the imageToLedsMapping has changed
/// @param mappingType The new mapping type
///
void imageToLedsMappingChanged(const int& mappingType);
void imageToLedsMappingChanged(int mappingType);
///
/// @brief Emits whenever the visible priority delivers a image which is applied in update()
@@ -402,27 +402,27 @@ signals:
void forwardJsonMessage(QJsonObject);
/// Signal which is emitted, when a new system proto image should be forwarded
void forwardSystemProtoMessage(const QString, const Image<ColorRgb>);
void forwardSystemProtoMessage(const QString&, const Image<ColorRgb>&);
/// Signal which is emitted, when a new V4l proto image should be forwarded
void forwardV4lProtoMessage(const QString, const Image<ColorRgb>);
void forwardV4lProtoMessage(const QString&, const Image<ColorRgb>&);
///
/// @brief Is emitted from clients who request a videoMode change
///
void videoMode(const VideoMode& mode);
void videoMode(VideoMode mode);
///
/// @brief A new videoMode was requested (called from Daemon!)
///
void newVideoMode(const VideoMode& mode);
void newVideoMode(VideoMode mode);
///
/// @brief Emits whenever a config part changed. SIGNAL PIPE helper for SettingsManager -> HyperionDaemon
/// @param type The settings type from enum
/// @param data The data as QJsonDocument
///
void settingsChanged(const settings::type& type, const QJsonDocument& data);
void settingsChanged(settings::type type, const QJsonDocument& data);
///
/// @brief Emits whenever the adjustments have been updated
@@ -459,19 +459,19 @@ private slots:
/// @brief Handle whenever the visible component changed
/// @param comp The new component
///
void handleVisibleComponentChanged(const hyperion::Components& comp);
void handleVisibleComponentChanged(hyperion::Components comp);
///
/// @brief Apply settings updates for LEDS and COLOR
/// @param type The type from enum
/// @param config The configuration
///
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config);
void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
///
/// @brief Apply new videoMode from Daemon to _currVideoMode
///
void handleNewVideoMode(const VideoMode& mode) { _currVideoMode = mode; }
void handleNewVideoMode(VideoMode mode) { _currVideoMode = mode; }
private:
friend class HyperionDaemon;
@@ -481,7 +481,7 @@ private:
/// @brief Constructs the Hyperion instance, just accessible for HyperionIManager
/// @param instance The instance index
///
Hyperion(const quint8& instance);
Hyperion(quint8 instance);
/// instance index
const quint8 _instIndex;

View File

@@ -38,19 +38,19 @@ 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(quint8 inst) const { return _runningInstances.contains(inst); }
///
/// @brief Get a Hyperion instance by index
/// @param intance the index
/// @return Hyperion instance, if index is not found returns instance 0
///
Hyperion* getHyperionInstance(const quint8& instance = 0);
Hyperion* getHyperionInstance(quint8 instance = 0);
///
/// @brief Get instance data of all instaces in db + running state
///
const QVector<QVariantMap> getInstanceData();
QVector<QVariantMap> getInstanceData() const;
///
/// @brief Start a Hyperion instance
@@ -58,20 +58,20 @@ public slots:
/// @param block If true return when thread has been started
/// @return Return true on success, false if not found in db
///
bool startInstance(const quint8& inst, const bool& block = false);
bool startInstance(quint8 inst, bool block = false);
///
/// @brief Stop a Hyperion instance
/// @param instance Instance index
/// @return Return true on success, false if not found in db
///
bool stopInstance(const quint8& inst);
bool stopInstance(quint8 inst);
///
/// @brief Toggle the state of all Hyperion instances
/// @param pause If true all instances toggle to pause, else to resume
///
void toggleStateAllInstances(const bool& pause = false);
void toggleStateAllInstances(bool pause = false);
///
/// @brief Create a new Hyperion instance entry in db
@@ -79,14 +79,14 @@ public slots:
/// @param start If true it will be started after creation (async)
/// @return Return true on success false if name is already in use or a db error occurred
///
bool createInstance(const QString& name, const bool& start = false);
bool createInstance(const QString& name, bool start = false);
///
/// @brief Delete Hyperion instance entry in db. Cleanup also all associated table data for this instance
/// @param inst The instance index
/// @return Return true on success, false if not found or not allowed
///
bool deleteInstance(const quint8& inst);
bool deleteInstance(quint8 inst);
///
/// @brief Assign a new name to the given instance
@@ -94,7 +94,7 @@ public slots:
/// @param name The instance name index
/// @return Return true on success, false if not found
///
bool saveName(const quint8& inst, const QString& name);
bool saveName(quint8 inst, const QString& name);
signals:
///
@@ -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(InstanceState state, quint8 instance, const QString& name = QString());
///
/// @brief Emits whenever something changes, the lazy version of instanceStateChanged (- H_ON_STOP) + saveName() emit
@@ -118,7 +118,7 @@ signals:
///
/// @brief PIPE videoMode back to Hyperion
///
void newVideoMode(const VideoMode& mode);
void newVideoMode(VideoMode mode);
///////////////////////////////////////
/// FROM HYPERION TO HYPERIONDAEMON ///
@@ -127,17 +127,17 @@ signals:
///
/// @brief PIPE settings events from Hyperion
///
void settingsChanged(const settings::type& type, const QJsonDocument& data);
void settingsChanged(settings::type type, const QJsonDocument& data);
///
/// @brief PIPE videoMode request changes from Hyperion to HyperionDaemon
///
void requestVideoMode(const VideoMode& mode);
void requestVideoMode(VideoMode mode);
///
/// @brief PIPE component state changes from Hyperion to HyperionDaemon
///
void compStateChangeRequest(const hyperion::Components component, bool enable);
void compStateChangeRequest(hyperion::Components component, bool enable);
private slots:
///
@@ -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(quint8 inst) const { return (inst > 0); }
private:
Logger* _log;

View File

@@ -36,7 +36,7 @@ public:
///
ImageProcessor(const LedString& ledString, Hyperion* hyperion);
~ImageProcessor();
~ImageProcessor() override;
///
/// Specifies the width and height of 'incomming' images. This will resize the buffer-image to
@@ -46,7 +46,7 @@ public:
/// @param[in] width The new width of the buffer-image
/// @param[in] height The new height of the buffer-image
///
void setSize(const unsigned width, const unsigned height);
void setSize(unsigned width, unsigned height);
///
/// @brief Update the led string (eg on settings change)
@@ -54,15 +54,15 @@ public:
void setLedString(const LedString& ledString);
/// Returns starte of black border detector
bool blackBorderDetectorEnabled();
bool blackBorderDetectorEnabled() const;
/// Returns the current _userMappingType, this may not be the current applied type!
const int & getUserLedMappingType() { return _userMappingType; };
int getUserLedMappingType() const { return _userMappingType; }
/// Returns the current _mappingType
const int & ledMappingType() { return _mappingType; };
int ledMappingType() const { return _mappingType; }
static int mappingTypeToInt(QString mappingType);
static int mappingTypeToInt(const QString& mappingType);
static QString mappingTypeToStr(int mappingType);
///
@@ -215,7 +215,7 @@ private:
}
private slots:
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config);
void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
private:
Logger * _log;

View File

@@ -57,8 +57,8 @@ namespace hyperion
///
unsigned height() const;
unsigned horizontalBorder() const { return _horizontalBorder; };
unsigned verticalBorder() const { return _verticalBorder; };
unsigned horizontalBorder() const { return _horizontalBorder; }
unsigned verticalBorder() const { return _verticalBorder; }
///
/// Determines the mean color for each led using the mapping the image given

View File

@@ -20,7 +20,7 @@ enum class ColorOrder
ORDER_RGB, ORDER_RBG, ORDER_GRB, ORDER_BRG, ORDER_GBR, ORDER_BGR
};
inline QString colorOrderToString(const ColorOrder colorOrder)
inline QString colorOrderToString(ColorOrder colorOrder)
{
switch (colorOrder)
{

View File

@@ -34,10 +34,10 @@ class MessageForwarder : public QObject
Q_OBJECT
public:
MessageForwarder(Hyperion* hyperion);
~MessageForwarder();
~MessageForwarder() override;
void addJsonSlave(QString slave);
void addFlatbufferSlave(QString slave);
void addJsonSlave(const QString& slave);
void addFlatbufferSlave(const QString& slave);
private slots:
///
@@ -45,20 +45,20 @@ private slots:
/// @param type settingyType from enum
/// @param config configuration object
///
void handleSettingsUpdate(const settings::type &type, const QJsonDocument &config);
void handleSettingsUpdate(settings::type type, const QJsonDocument &config);
///
/// @brief Handle component state change MessageForwarder
/// @param component The component from enum
/// @param enable The new state
///
void handleCompStateChangeRequest(const hyperion::Components component, bool enable);
void handleCompStateChangeRequest(hyperion::Components component, bool enable);
///
/// @brief Handle priority updates from Priority Muxer
/// @param priority The new visible priority
///
void handlePriorityChanges(const quint8 &priority);
void handlePriorityChanges(quint8 priority);
///
/// @brief Forward message to all json slaves

View File

@@ -16,7 +16,7 @@
class MultiColorAdjustment
{
public:
MultiColorAdjustment(const unsigned ledCnt);
MultiColorAdjustment(unsigned ledCnt);
~MultiColorAdjustment();
/**
@@ -26,7 +26,7 @@ public:
*/
void addAdjustment(ColorAdjustment * adjustment);
void setAdjustmentForLed(const QString& id, const unsigned startLed, unsigned endLed);
void setAdjustmentForLed(const QString& id, unsigned startLed, unsigned endLed);
bool verifyAdjustments() const;
@@ -36,7 +36,7 @@ public:
/// Returns the identifier of all the unique ColorAdjustment
///
/// @return The list with unique id's of the ColorAdjustment
const QStringList & getAdjustmentIds();
QStringList getAdjustmentIds() const;
///
/// Returns the pointer to the ColorAdjustment with the given id

View File

@@ -68,20 +68,20 @@ public:
///
/// Destructor
///
~PriorityMuxer();
~PriorityMuxer() override;
///
/// @brief Start/Stop the PriorityMuxer update timer; On disabled no priority and timeout updates will be performend
/// @param enable The new state
///
void setEnable(const bool& enable);
void setEnable(bool enable);
/// @brief Enable or disable auto source selection
/// @param enable True if it should be enabled else false
/// @param update True to update _currentPriority - INTERNAL usage.
/// @return True if changed has been applied, false if the state is unchanged
///
bool setSourceAutoSelectEnabled(const bool& enabel, const bool& update = true);
bool setSourceAutoSelectEnabled(bool enabel, bool update = true);
///
/// @brief Get the state of source auto selection
@@ -94,13 +94,13 @@ public:
/// @param priority The
/// @return True on success, false if priority not found
///
bool setPriority(const uint8_t priority);
bool setPriority(uint8_t priority);
///
/// @brief Update all ledColos with min length of >= 1 to fit the new led length
/// @param[in] ledCount The count of leds
///
void updateLedColorsLength(const int& ledCount);
void updateLedColorsLength(int ledCount);
///
/// Returns the current priority
@@ -114,7 +114,7 @@ public:
/// @param priority The priority channel
/// @return True if the priority channel exists else false
///
bool hasPriority(const int priority) const;
bool hasPriority(int priority) const;
///
/// Returns the number of active priorities
@@ -131,7 +131,7 @@ public:
///
/// @return The information for the specified priority channel
///
const InputInfo getInputInfo(const int priority) const;
InputInfo getInputInfo(int priority) const;
///
/// @brief Register a new input by priority, the priority is not active (timeout -100 isn't muxer recognized) until you start to update the data with setInput()
@@ -142,7 +142,7 @@ public:
/// @param[in] owner Speicifc owner string, might be empty
/// @param[in] smooth_cfg The smooth id to use
///
void registerInput(const int priority, const hyperion::Components& component, const QString& origin = "System", const QString& owner = "", unsigned smooth_cfg = SMOOTHING_MODE_DEFAULT);
void registerInput(int priority, hyperion::Components component, const QString& origin = "System", const QString& owner = "", unsigned smooth_cfg = SMOOTHING_MODE_DEFAULT);
///
/// @brief Update the current color of a priority (prev registered with registerInput())
@@ -151,7 +151,7 @@ public:
/// @param timeout_ms The new timeout (defaults to -1 endless)
/// @return True on success, false when priority is not found
///
bool setInput(const int priority, const std::vector<ColorRgb>& ledColors, int64_t timeout_ms = -1);
bool setInput(int priority, const std::vector<ColorRgb>& ledColors, int64_t timeout_ms = -1);
///
/// @brief Update the current image of a priority (prev registered with registerInput())
@@ -160,14 +160,14 @@ public:
/// @param timeout_ms The new timeout (defaults to -1 endless)
/// @return True on success, false when priority is not found
///
bool setInputImage(const int priority, const Image<ColorRgb>& image, int64_t timeout_ms = -1);
bool setInputImage(int priority, const Image<ColorRgb>& image, int64_t timeout_ms = -1);
///
/// @brief Set the given priority to inactive
/// @param priority The priority
/// @return True on success false if not found
///
bool setInputInactive(const quint8& priority);
bool setInputInactive(quint8 priority);
///
/// Clears the specified priority channel and update _currentPriority on success
@@ -175,7 +175,7 @@ public:
/// @param[in] priority The priority of the channel to clear
/// @return True if priority has been cleared else false (not found)
///
bool clearInput(const uint8_t priority);
bool clearInput(uint8_t priority);
///
/// Clears all priority channels
@@ -185,7 +185,7 @@ public:
///
/// @brief Queue a manual push where muxer doesn't recognize them (e.g. continous single color pushes)
///
void queuePush(void){ emit timeRunner(); };
void queuePush() { emit timeRunner(); }
signals:
///
@@ -198,38 +198,38 @@ signals:
/// @param priority The priority which has changed
/// @param state If true it was added else it was removed!
///
void priorityChanged(const quint8& priority, const bool& state);
void priorityChanged(quint8 priority, bool state);
///
/// @brief Emits whenever the visible priority has changed
/// @param priority The new visible priority
///
void visiblePriorityChanged(const quint8& priority);
void visiblePriorityChanged(quint8 priority);
///
/// @brief Emits whenever the current visible component changed
/// @param comp The new component
///
void visibleComponentChanged(const hyperion::Components& comp);
void visibleComponentChanged(hyperion::Components comp);
///
/// @brief Emits whenever a priority changes active state
/// @param priority The priority who changed the active state
/// @param state The new state, state true = active else false
///
void activeStateChanged(const quint8& priority, const bool& state);
void activeStateChanged(quint8 priority, bool state);
///
/// @brief Emits whenever the auto selection state has been changed
/// @param state The new state of auto selection; True enabled else false
///
void autoSelectChanged(const bool& state);
void autoSelectChanged(bool state);
///
/// @brief Emits whenever something changes which influences the priorities listing
/// Emits also in 1s interval when a COLOR or EFFECT is running with a timeout > -1
///
void prioritiesChanged(void);
void prioritiesChanged();
///
/// internal used signal to resolve treading issues with timer
@@ -246,14 +246,14 @@ private slots:
/// Updates the current time. Channels with a configured time out will be checked and cleared if
/// required.
///
void setCurrentTime(void);
void setCurrentTime();
private:
///
/// @brief Get the component of the given priority
/// @return The component
///
hyperion::Components getComponentOfPriority(const int& priority);
hyperion::Components getComponentOfPriority(int priority) const;
/// Logger instance
Logger* _log;

View File

@@ -21,7 +21,7 @@ public:
/// @params instance Instance index of HyperionInstanceManager
/// @params parent The parent hyperion instance
///
SettingsManager(const quint8& instance, QObject* parent = nullptr);
SettingsManager(quint8 instance, QObject* parent = nullptr);
///
/// @brief Save a complete json config
@@ -29,20 +29,20 @@ public:
/// @param correct If true will correct json against schema before save
/// @return True on success else false
///
bool saveSettings(QJsonObject config, const bool& correct = false);
bool saveSettings(QJsonObject config, bool correct = false);
///
/// @brief get a single setting json from config
/// @param type The settings::type from enum
/// @return The requested json data as QJsonDocument
///
const QJsonDocument getSetting(const settings::type& type);
QJsonDocument getSetting(settings::type type) const;
///
/// @brief get the full settings object of this instance (with global settings)
/// @return The requested json
///
const QJsonObject & getSettings() { return _qconfig; };
const QJsonObject & getSettings() const { return _qconfig; };
signals:
///
@@ -50,7 +50,7 @@ signals:
/// @param type The settings type from enum
/// @param data The data as QJsonDocument
///
void settingsChanged(const settings::type& type, const QJsonDocument& data);
void settingsChanged(settings::type type, const QJsonDocument& data);
private:
///