Pass primitive types by value (#935)

This commit is contained in:
Murat Seker 2020-08-08 13:09:15 +02:00 committed by GitHub
parent 5758b19cbc
commit c00d8e62fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
146 changed files with 505 additions and 505 deletions

View File

@ -46,14 +46,14 @@ public:
/// @param localConnection Is this a local network connection? Use utils/NetOrigin to check that /// @param localConnection Is this a local network connection? Use utils/NetOrigin to check that
/// @param parent Parent QObject /// @param parent Parent QObject
/// ///
API(Logger *log, const bool &localConnection, QObject *parent); API(Logger *log, bool localConnection, QObject *parent);
protected: protected:
/// ///
/// @brief Initialize the API /// @brief Initialize the API
/// This call is REQUIRED! /// This call is REQUIRED!
/// ///
void init(void); void init();
/// ///
/// @brief Set a single color /// @brief Set a single color
@ -62,7 +62,7 @@ protected:
/// @param[in] timeout_ms The time the leds are set to the given color [ms] /// @param[in] timeout_ms The time the leds are set to the given color [ms]
/// @param[in] origin The setter /// @param[in] origin The setter
/// ///
void setColor(const int &priority, const std::vector<uint8_t> &ledColors, const int &timeout_ms = -1, const QString &origin = "API", const hyperion::Components &callerComp = hyperion::COMP_INVALID); void setColor(int priority, const std::vector<uint8_t> &ledColors, int timeout_ms = -1, const QString &origin = "API", hyperion::Components callerComp = hyperion::COMP_INVALID);
/// ///
/// @brief Set a image /// @brief Set a image
@ -72,7 +72,7 @@ protected:
/// @param callerComp The HYPERION COMPONENT that calls this function! e.g. PROT/FLATBUF /// @param callerComp The HYPERION COMPONENT that calls this function! e.g. PROT/FLATBUF
/// @return True on success /// @return True on success
/// ///
bool setImage(ImageCmdData &data, hyperion::Components comp, QString &replyMsg, const hyperion::Components &callerComp = hyperion::COMP_INVALID); bool setImage(ImageCmdData &data, hyperion::Components comp, QString &replyMsg, hyperion::Components callerComp = hyperion::COMP_INVALID);
/// ///
/// @brief Clear a priority in the Muxer, if -1 all priorities are cleared /// @brief Clear a priority in the Muxer, if -1 all priorities are cleared
@ -81,7 +81,7 @@ protected:
/// @param callerComp The HYPERION COMPONENT that calls this function! e.g. PROT/FLATBUF /// @param callerComp The HYPERION COMPONENT that calls this function! e.g. PROT/FLATBUF
/// @return True on success /// @return True on success
/// ///
bool clearPriority(const int &priority, QString &replyMsg, const hyperion::Components &callerComp = hyperion::COMP_INVALID); bool clearPriority(int priority, QString &replyMsg, hyperion::Components callerComp = hyperion::COMP_INVALID);
/// ///
/// @brief Set a new component state /// @brief Set a new component state
@ -91,21 +91,21 @@ protected:
/// @param callerComp The HYPERION COMPONENT that calls this function! e.g. PROT/FLATBUF /// @param callerComp The HYPERION COMPONENT that calls this function! e.g. PROT/FLATBUF
/// @ return True on success /// @ return True on success
/// ///
bool setComponentState(const QString &comp, bool &compState, QString &replyMsg, const hyperion::Components &callerComp = hyperion::COMP_INVALID); bool setComponentState(const QString &comp, bool &compState, QString &replyMsg, hyperion::Components callerComp = hyperion::COMP_INVALID);
/// ///
/// @brief Set a ledToImageMapping type /// @brief Set a ledToImageMapping type
/// @param type mapping type string /// @param type mapping type string
/// @param callerComp The HYPERION COMPONENT that calls this function! e.g. PROT/FLATBUF /// @param callerComp The HYPERION COMPONENT that calls this function! e.g. PROT/FLATBUF
/// ///
void setLedMappingType(const int &type, const hyperion::Components &callerComp = hyperion::COMP_INVALID); void setLedMappingType(int type, hyperion::Components callerComp = hyperion::COMP_INVALID);
/// ///
/// @brief Set the 2D/3D modes type /// @brief Set the 2D/3D modes type
/// @param mode The VideoMode /// @param mode The VideoMode
/// @param callerComp The HYPERION COMPONENT that calls this function! e.g. PROT/FLATBUF /// @param callerComp The HYPERION COMPONENT that calls this function! e.g. PROT/FLATBUF
/// ///
void setVideoMode(const VideoMode &mode, const hyperion::Components &callerComp = hyperion::COMP_INVALID); void setVideoMode(VideoMode mode, hyperion::Components callerComp = hyperion::COMP_INVALID);
/// ///
/// @brief Set an effect /// @brief Set an effect
@ -113,21 +113,21 @@ protected:
/// @param callerComp The HYPERION COMPONENT that calls this function! e.g. PROT/FLATBUF /// @param callerComp The HYPERION COMPONENT that calls this function! e.g. PROT/FLATBUF
/// REQUIRED dat fields: effectName, priority, duration, origin /// REQUIRED dat fields: effectName, priority, duration, origin
/// ///
void setEffect(const EffectCmdData &dat, const hyperion::Components &callerComp = hyperion::COMP_INVALID); void setEffect(const EffectCmdData &dat, hyperion::Components callerComp = hyperion::COMP_INVALID);
/// ///
/// @brief Set source auto select enabled or disabled /// @brief Set source auto select enabled or disabled
/// @param sate The new state /// @param sate The new state
/// @param callerComp The HYPERION COMPONENT that calls this function! e.g. PROT/FLATBUF /// @param callerComp The HYPERION COMPONENT that calls this function! e.g. PROT/FLATBUF
/// ///
void setSourceAutoSelect(const bool state, const hyperion::Components &callerComp = hyperion::COMP_INVALID); void setSourceAutoSelect(bool state, hyperion::Components callerComp = hyperion::COMP_INVALID);
/// ///
/// @brief Set the visible priority to given priority /// @brief Set the visible priority to given priority
/// @param priority The priority to set /// @param priority The priority to set
/// @param callerComp The HYPERION COMPONENT that calls this function! e.g. PROT/FLATBUF /// @param callerComp The HYPERION COMPONENT that calls this function! e.g. PROT/FLATBUF
/// ///
void setVisiblePriority(const int &priority, const hyperion::Components &callerComp = hyperion::COMP_INVALID); void setVisiblePriority(int priority, hyperion::Components callerComp = hyperion::COMP_INVALID);
/// ///
/// @brief Register a input or update the meta data of a previous register call /// @brief Register a input or update the meta data of a previous register call
@ -138,21 +138,21 @@ protected:
/// @param[in] owner Specific owner string, might be empty /// @param[in] owner Specific owner string, might be empty
/// @param[in] callerComp The component that call this (e.g. PROTO/FLAT) /// @param[in] callerComp The component that call this (e.g. PROTO/FLAT)
/// ///
void registerInput(const int &priority, const hyperion::Components &component, const QString &origin, const QString &owner, const hyperion::Components &callerComp); void registerInput(int priority, hyperion::Components component, const QString &origin, const QString &owner, hyperion::Components callerComp);
/// ///
/// @brief Revoke a registerInput() call by priority. We maintain all registered priorities in this scope /// @brief Revoke a registerInput() call by priority. We maintain all registered priorities in this scope
/// ATTENTION: This is MANDATORY if you change (priority change) or stop(clear/timeout) DURING lifetime. If this class destructs it's not needed /// ATTENTION: This is MANDATORY if you change (priority change) or stop(clear/timeout) DURING lifetime. If this class destructs it's not needed
/// @param priority The priority to unregister /// @param priority The priority to unregister
/// ///
void unregisterInput(const int &priority); void unregisterInput(int priority);
/// ///
/// @brief Handle the instance switching /// @brief Handle the instance switching
/// @param inst The requested instance /// @param inst The requested instance
/// @return True on success else false /// @return True on success else false
/// ///
bool setHyperionInstance(const quint8 &inst); bool setHyperionInstance(quint8 inst);
/// ///
/// @brief Get all contrable components and their state /// @brief Get all contrable components and their state
@ -169,19 +169,19 @@ protected:
/// @brief Get all instances data /// @brief Get all instances data
/// @return The instance data /// @return The instance data
/// ///
QVector<QVariantMap> getAllInstanceData(void); QVector<QVariantMap> getAllInstanceData();
/// ///
/// @brief Start instance /// @brief Start instance
/// @param index The instance index /// @param index The instance index
/// ///
void startInstance(const quint8 &index); void startInstance(quint8 index);
/// ///
/// @brief Stop instance /// @brief Stop instance
/// @param index The instance index /// @param index The instance index
/// ///
void stopInstance(const quint8 &index); void stopInstance(quint8 index);
////////////////////////////////// //////////////////////////////////
/// AUTH / ADMINISTRATION METHODS /// AUTH / ADMINISTRATION METHODS
@ -193,7 +193,7 @@ protected:
/// @param replyMsg The reply Msg /// @param replyMsg The reply Msg
/// @return False with reply /// @return False with reply
/// ///
bool deleteInstance(const quint8 &index, QString &replyMsg); bool deleteInstance(quint8 index, QString &replyMsg);
/// ///
/// @brief Create instance. Requires ADMIN ACCESS /// @brief Create instance. Requires ADMIN ACCESS
@ -208,7 +208,7 @@ protected:
/// @param name With given name /// @param name With given name
/// @return False with reply /// @return False with reply
/// ///
QString setInstanceName(const quint8 &index, const QString &name); QString setInstanceName(quint8 index, const QString &name);
/// ///
/// @brief Delete an effect. Requires ADMIN ACCESS /// @brief Delete an effect. Requires ADMIN ACCESS
@ -292,7 +292,7 @@ protected:
/// @param id The id fo the request /// @param id The id fo the request
/// @param accept True when it should be accepted, else false /// @param accept True when it should be accepted, else false
/// @return True on success /// @return True on success
bool handlePendingTokenRequest(const QString &id, const bool accept); bool handlePendingTokenRequest(const QString &id, bool accept);
/// ///
/// @brief Get the current List of Tokens. Requires ADMIN ACCESS /// @brief Get the current List of Tokens. Requires ADMIN ACCESS
@ -379,7 +379,7 @@ signals:
/// @param comment The comment that was part of the request /// @param comment The comment that was part of the request
/// @param id The id that was part of the request /// @param id The id that was part of the request
/// ///
void onTokenResponse(const bool &success, const QString &token, const QString &comment, const QString &id); void onTokenResponse(bool success, const QString &token, const QString &comment, const QString &id);
private slots: private slots:
/// ///
@ -396,7 +396,7 @@ private slots:
/// @param comment The comment that was part of the request /// @param comment The comment that was part of the request
/// @param id The id that was part of the request /// @param id The id that was part of the request
/// ///
void checkTokenResponse(const bool &success, QObject *caller, const QString &token, const QString &comment, const QString &id); void checkTokenResponse(bool success, QObject *caller, const QString &token, const QString &comment, const QString &id);
private: private:
void stopDataConnectionss(); void stopDataConnectionss();

View File

@ -30,7 +30,7 @@ public:
/// @param localConnection True when the sender has origin home network /// @param localConnection True when the sender has origin home network
/// @param noListener if true, this instance won't listen for hyperion push events /// @param noListener if true, this instance won't listen for hyperion push events
/// ///
JsonAPI(QString peerAddress, Logger *log, const bool &localConnection, QObject *parent, bool noListener = false); JsonAPI(QString peerAddress, Logger *log, bool localConnection, QObject *parent, bool noListener = false);
/// ///
/// Handle an incoming JSON message /// Handle an incoming JSON message
@ -42,7 +42,7 @@ public:
/// ///
/// @brief Initialization steps /// @brief Initialization steps
/// ///
void initialize(void); void initialize();
public slots: public slots:
/// ///
@ -77,7 +77,7 @@ private slots:
/// @param comment The comment that was part of the request /// @param comment The comment that was part of the request
/// @param id The id that was part of the request /// @param id The id that was part of the request
/// ///
void handleTokenResponse(const bool &success, const QString &token, const QString &comment, const QString &id); void handleTokenResponse(bool success, const QString &token, const QString &comment, const QString &id);
/// ///
/// @brief Handle whenever the state of a instance (HyperionIManager) changes according to enum instanceState /// @brief Handle whenever the state of a instance (HyperionIManager) changes according to enum instanceState
@ -85,7 +85,7 @@ private slots:
/// @param instance The index of instance /// @param instance The index of instance
/// @param name The name of the instance, just available with H_CREATED /// @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(InstanceState state, quint8 instance, const QString &name = QString());
signals: signals:
/// ///
@ -131,151 +131,151 @@ private:
/// @param forced indicate if it was a forced switch by system /// @param forced indicate if it was a forced switch by system
/// @return true on success. false if not found /// @return true on success. false if not found
/// ///
bool handleInstanceSwitch(const quint8 &instance = 0, const bool &forced = false); bool handleInstanceSwitch(quint8 instance = 0, bool forced = false);
/// ///
/// Handle an incoming JSON Color message /// Handle an incoming JSON Color message
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleColorCommand(const QJsonObject &message, const QString &command, const int tan); void handleColorCommand(const QJsonObject &message, const QString &command, int tan);
/// ///
/// Handle an incoming JSON Image message /// Handle an incoming JSON Image message
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleImageCommand(const QJsonObject &message, const QString &command, const int tan); void handleImageCommand(const QJsonObject &message, const QString &command, int tan);
/// ///
/// Handle an incoming JSON Effect message /// Handle an incoming JSON Effect message
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleEffectCommand(const QJsonObject &message, const QString &command, const int tan); void handleEffectCommand(const QJsonObject &message, const QString &command, int tan);
/// ///
/// Handle an incoming JSON Effect message (Write JSON Effect) /// Handle an incoming JSON Effect message (Write JSON Effect)
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleCreateEffectCommand(const QJsonObject &message, const QString &command, const int tan); void handleCreateEffectCommand(const QJsonObject &message, const QString &command, int tan);
/// ///
/// Handle an incoming JSON Effect message (Delete JSON Effect) /// Handle an incoming JSON Effect message (Delete JSON Effect)
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleDeleteEffectCommand(const QJsonObject &message, const QString &command, const int tan); void handleDeleteEffectCommand(const QJsonObject &message, const QString &command, int tan);
/// ///
/// Handle an incoming JSON System info message /// Handle an incoming JSON System info message
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleSysInfoCommand(const QJsonObject &message, const QString &command, const int tan); void handleSysInfoCommand(const QJsonObject &message, const QString &command, int tan);
/// ///
/// Handle an incoming JSON Server info message /// Handle an incoming JSON Server info message
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleServerInfoCommand(const QJsonObject &message, const QString &command, const int tan); void handleServerInfoCommand(const QJsonObject &message, const QString &command, int tan);
/// ///
/// Handle an incoming JSON Clear message /// Handle an incoming JSON Clear message
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleClearCommand(const QJsonObject &message, const QString &command, const int tan); void handleClearCommand(const QJsonObject &message, const QString &command, int tan);
/// ///
/// Handle an incoming JSON Clearall message /// Handle an incoming JSON Clearall message
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleClearallCommand(const QJsonObject &message, const QString &command, const int tan); void handleClearallCommand(const QJsonObject &message, const QString &command, int tan);
/// ///
/// Handle an incoming JSON Adjustment message /// Handle an incoming JSON Adjustment message
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleAdjustmentCommand(const QJsonObject &message, const QString &command, const int tan); void handleAdjustmentCommand(const QJsonObject &message, const QString &command, int tan);
/// ///
/// Handle an incoming JSON SourceSelect message /// Handle an incoming JSON SourceSelect message
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleSourceSelectCommand(const QJsonObject &message, const QString &command, const int tan); void handleSourceSelectCommand(const QJsonObject &message, const QString &command, int tan);
/// Handle an incoming JSON GetConfig message and check subcommand /// Handle an incoming JSON GetConfig message and check subcommand
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleConfigCommand(const QJsonObject &message, const QString &command, const int tan); void handleConfigCommand(const QJsonObject &message, const QString &command, int tan);
/// Handle an incoming JSON GetSchema message from handleConfigCommand() /// Handle an incoming JSON GetSchema message from handleConfigCommand()
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleSchemaGetCommand(const QJsonObject &message, const QString &command, const int tan); void handleSchemaGetCommand(const QJsonObject &message, const QString &command, int tan);
/// Handle an incoming JSON SetConfig message from handleConfigCommand() /// Handle an incoming JSON SetConfig message from handleConfigCommand()
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleConfigSetCommand(const QJsonObject &message, const QString &command, const int tan); void handleConfigSetCommand(const QJsonObject &message, const QString &command, int tan);
/// ///
/// Handle an incoming JSON Component State message /// Handle an incoming JSON Component State message
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleComponentStateCommand(const QJsonObject &message, const QString &command, const int tan); void handleComponentStateCommand(const QJsonObject &message, const QString &command, int tan);
/// Handle an incoming JSON Led Colors message /// Handle an incoming JSON Led Colors message
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleLedColorsCommand(const QJsonObject &message, const QString &command, const int tan); void handleLedColorsCommand(const QJsonObject &message, const QString &command, int tan);
/// Handle an incoming JSON Logging message /// Handle an incoming JSON Logging message
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleLoggingCommand(const QJsonObject &message, const QString &command, const int tan); void handleLoggingCommand(const QJsonObject &message, const QString &command, int tan);
/// Handle an incoming JSON Processing message /// Handle an incoming JSON Processing message
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleProcessingCommand(const QJsonObject &message, const QString &command, const int tan); void handleProcessingCommand(const QJsonObject &message, const QString &command, int tan);
/// Handle an incoming JSON VideoMode message /// Handle an incoming JSON VideoMode message
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleVideoModeCommand(const QJsonObject &message, const QString &command, const int tan); void handleVideoModeCommand(const QJsonObject &message, const QString &command, int tan);
/// Handle an incoming JSON plugin message /// Handle an incoming JSON plugin message
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleAuthorizeCommand(const QJsonObject &message, const QString &command, const int tan); void handleAuthorizeCommand(const QJsonObject &message, const QString &command, int tan);
/// Handle an incoming JSON instance message /// Handle an incoming JSON instance message
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleInstanceCommand(const QJsonObject &message, const QString &command, const int tan); void handleInstanceCommand(const QJsonObject &message, const QString &command, int tan);
/// Handle an incoming JSON Led Device message /// Handle an incoming JSON Led Device message
/// ///
/// @param message the incoming message /// @param message the incoming message
/// ///
void handleLedDeviceCommand(const QJsonObject &message, const QString &command, const int tan); void handleLedDeviceCommand(const QJsonObject &message, const QString &command, int tan);
/// ///
/// Handle an incoming JSON message of unknown type /// Handle an incoming JSON message of unknown type
@ -285,22 +285,22 @@ private:
/// ///
/// Send a standard reply indicating success /// Send a standard reply indicating success
/// ///
void sendSuccessReply(const QString &command = "", const int tan = 0); void sendSuccessReply(const QString &command = "", int tan = 0);
/// ///
/// Send a standard reply indicating success with data /// Send a standard reply indicating success with data
/// ///
void sendSuccessDataReply(const QJsonDocument &doc, const QString &command = "", const int &tan = 0); void sendSuccessDataReply(const QJsonDocument &doc, const QString &command = "", int tan = 0);
/// ///
/// Send an error message back to the client /// Send an error message back to the client
/// ///
/// @param error String describing the error /// @param error String describing the error
/// ///
void sendErrorReply(const QString &error, const QString &command = "", const int tan = 0); void sendErrorReply(const QString &error, const QString &command = "", int tan = 0);
/// ///
/// @brief Kill all signal/slot connections to stop possible data emitter /// @brief Kill all signal/slot connections to stop possible data emitter
/// ///
void stopDataConnections(void); void stopDataConnections();
}; };

View File

@ -35,7 +35,7 @@ public:
/// @param unsubscribe Revert subscription /// @param unsubscribe Revert subscription
/// @return True on success, false if not found /// @return True on success, false if not found
/// ///
bool subscribeFor(const QString& cmd, const bool & unsubscribe = false); bool subscribeFor(const QString& cmd, bool unsubscribe = false);
/// ///
/// @brief Get all possible commands to subscribe for /// @brief Get all possible commands to subscribe for
@ -52,7 +52,7 @@ public:
/// ///
/// @brief Reset subscriptions, disconnect all signals /// @brief Reset subscriptions, disconnect all signals
/// ///
void resetSubscriptions(void); void resetSubscriptions();
/// ///
/// @brief Re-apply all current subs to a new Hyperion instance, the connections to the old instance will be dropped /// @brief Re-apply all current subs to a new Hyperion instance, the connections to the old instance will be dropped
@ -70,7 +70,7 @@ private slots:
/// ///
/// @brief handle component state changes /// @brief handle component state changes
/// ///
void handleComponentState(const hyperion::Components comp, const bool state); void handleComponentState(hyperion::Components comp, bool state);
#ifdef ENABLE_AVAHI #ifdef ENABLE_AVAHI
/// ///
/// @brief handle emits from bonjour wrapper /// @brief handle emits from bonjour wrapper
@ -86,7 +86,7 @@ private slots:
/// ///
/// @brief Handle imageToLedsMapping updates /// @brief Handle imageToLedsMapping updates
/// ///
void handleImageToLedsMappingChange(const int& mappingType); void handleImageToLedsMappingChange(int mappingType);
/// ///
/// @brief Handle the adjustment update /// @brief Handle the adjustment update
@ -97,7 +97,7 @@ private slots:
/// @brief Handle video mode change /// @brief Handle video mode change
/// @param mode The new videoMode /// @param mode The new videoMode
/// ///
void handleVideoModeChange(const VideoMode& mode); void handleVideoModeChange(VideoMode mode);
/// ///
/// @brief Handle effect list change /// @brief Handle effect list change
@ -109,14 +109,14 @@ private slots:
/// @param type The settings type from enum /// @param type The settings type from enum
/// @param data The data as QJsonDocument /// @param data The data as QJsonDocument
/// ///
void handleSettingsChange(const settings::type& type, const QJsonDocument& data); void handleSettingsChange(settings::type type, const QJsonDocument& data);
/// ///
/// @brief Handle led config specific updates (required for led color streaming with positional display) /// @brief Handle led config specific updates (required for led color streaming with positional display)
/// @param type The settings type from enum /// @param type The settings type from enum
/// @param data The data as QJsonDocument /// @param data The data as QJsonDocument
/// ///
void handleLedsConfigChange(const settings::type& type, const QJsonDocument& data); void handleLedsConfigChange(settings::type type, const QJsonDocument& data);
/// ///
/// @brief Handle Hyperion instance manager change /// @brief Handle Hyperion instance manager change

View File

@ -49,7 +49,7 @@ namespace hyperion
/// It's not possible to enable bb from this method, if the user requsted a disable! /// It's not possible to enable bb from this method, if the user requsted a disable!
/// @param disable The new state /// @param disable The new state
/// ///
void setHardDisable(const bool& disable); void setHardDisable(bool disable);
/// ///
/// Processes the image. This performs detecion of black-border on the given image and /// Processes the image. This performs detecion of black-border on the given image and
@ -100,12 +100,12 @@ namespace hyperion
/// @param type settingyType from enum /// @param type settingyType from enum
/// @param config configuration object /// @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 changes, it's not possible for BB to be enabled, when a hardDisable is active /// @brief Handle component state changes, it's not possible for BB to be enabled, when a hardDisable is active
/// ///
void handleCompStateChangeRequest(const hyperion::Components component, bool enable); void handleCompStateChangeRequest(hyperion::Components component, bool enable);
private: private:
/// Hyperion instance /// Hyperion instance

View File

@ -54,14 +54,14 @@ public slots:
/// ///
void stop(); void stop();
void compStateChangeRequest(const hyperion::Components component, bool enable); void compStateChangeRequest(hyperion::Components component, bool enable);
/// ///
/// @brief Handle settings update from Hyperion Settingsmanager emit or this constructor /// @brief Handle settings update from Hyperion Settingsmanager emit or this constructor
/// @param type settingyType from enum /// @param type settingyType from enum
/// @param config configuration object /// @param config configuration object
/// ///
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config); void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
private slots: private slots:
/// ///

View File

@ -47,11 +47,11 @@ public:
BonjourServiceRegister(QObject *parent = 0); BonjourServiceRegister(QObject *parent = 0);
~BonjourServiceRegister(); ~BonjourServiceRegister();
void registerService(const QString& service, const int& port); void registerService(const QString& service, int port);
void registerService(const BonjourRecord &record, quint16 servicePort, std::vector<std::pair<std::string, std::string>> txt = std::vector<std::pair<std::string, std::string>>()); void registerService(const BonjourRecord &record, quint16 servicePort, std::vector<std::pair<std::string, std::string>> txt = std::vector<std::pair<std::string, std::string>>());
inline BonjourRecord registeredRecord() const {return finalRecord; } inline BonjourRecord registeredRecord() const {return finalRecord; }
const quint16 & getPort() { return _port; }; quint16 getPort() const { return _port; };
signals: signals:
void error(DNSServiceErrorType error); void error(DNSServiceErrorType error);

View File

@ -71,7 +71,7 @@ public:
/// @param inst The id that has been assigned /// @param inst The id that has been assigned
/// @return True on success else false /// @return True on success else false
/// ///
inline bool deleteInstance(const quint8& inst) inline bool deleteInstance(quint8 inst)
{ {
VectorPair cond; VectorPair cond;
cond.append(CPair("instance",inst)); cond.append(CPair("instance",inst));
@ -91,7 +91,7 @@ public:
/// @param name The new name of the instance /// @param name The new name of the instance
/// @return True on success else false (instance not found) /// @return True on success else false (instance not found)
/// ///
inline bool saveName(const quint8& inst, const QString& name) inline bool saveName(quint8 inst, const QString& name)
{ {
VectorPair fcond; VectorPair fcond;
fcond.append(CPair("friendly_name",name)); fcond.append(CPair("friendly_name",name));
@ -119,7 +119,7 @@ public:
/// @param justEnabled return just enabled instances if true /// @param justEnabled return just enabled instances if true
/// @return The found instances /// @return The found instances
/// ///
inline QVector<QVariantMap> getAllInstances(const bool& justEnabled = false) inline QVector<QVariantMap> getAllInstances(bool justEnabled = false)
{ {
QVector<QVariantMap> results; QVector<QVariantMap> results;
getRecords(results, QStringList(), QStringList() << "instance ASC"); getRecords(results, QStringList(), QStringList() << "instance ASC");
@ -143,7 +143,7 @@ public:
/// @param[in] user The user id /// @param[in] user The user id
/// @return true on success else false /// @return true on success else false
/// ///
inline bool instanceExist(const quint8& inst) inline bool instanceExist(quint8 inst)
{ {
VectorPair cond; VectorPair cond;
cond.append(CPair("instance",inst)); cond.append(CPair("instance",inst));
@ -155,7 +155,7 @@ public:
/// @param index The index to search for /// @param index The index to search for
/// @return The name of this index, may return NOT FOUND if not found /// @return The name of this index, may return NOT FOUND if not found
/// ///
inline const QString getNamebyIndex(const quint8 index) inline const QString getNamebyIndex(quint8 index)
{ {
QVariantMap results; QVariantMap results;
VectorPair cond; VectorPair cond;
@ -170,7 +170,7 @@ public:
/// @brief Update 'last_use' timestamp /// @brief Update 'last_use' timestamp
/// @param inst The instance to update /// @param inst The instance to update
/// ///
inline void setLastUse(const quint8& inst) inline void setLastUse(quint8 inst)
{ {
VectorPair cond; VectorPair cond;
cond.append(CPair("instance", inst)); cond.append(CPair("instance", inst));
@ -184,7 +184,7 @@ public:
/// @param inst The instance to update /// @param inst The instance to update
/// @param newState True when enabled else false /// @param newState True when enabled else false
/// ///
inline void setEnable(const quint8& inst, const bool& newState) inline void setEnable(quint8 inst, bool newState)
{ {
VectorPair cond; VectorPair cond;
cond.append(CPair("instance", inst)); cond.append(CPair("instance", inst));
@ -198,7 +198,7 @@ public:
/// @param inst The instance to get /// @param inst The instance to get
/// @return True when enabled else false /// @return True when enabled else false
/// ///
inline bool isEnabled(const quint8& inst) inline bool isEnabled(quint8 inst)
{ {
VectorPair cond; VectorPair cond;
cond.append(CPair("instance", inst)); cond.append(CPair("instance", inst));

View File

@ -15,7 +15,7 @@ class SettingsTable : public DBManager
public: public:
/// construct wrapper with settings table /// construct wrapper with settings table
SettingsTable(const quint8& instance, QObject* parent = nullptr) SettingsTable(quint8 instance, QObject* parent = nullptr)
: DBManager(parent) : DBManager(parent)
, _hyperion_inst(instance) , _hyperion_inst(instance)
{ {

View File

@ -64,8 +64,8 @@ public:
QJsonObject getArgs() const { return _args; } QJsonObject getArgs() const { return _args; }
signals: signals:
void setInput(const int priority, const std::vector<ColorRgb> &ledColors, const int timeout_ms, const bool &clearEffect); void setInput(int priority, const std::vector<ColorRgb> &ledColors, int timeout_ms, bool clearEffect);
void setInputImage(const int priority, const Image<ColorRgb> &image, const int timeout_ms, const bool &clearEffect); void setInputImage(int priority, const Image<ColorRgb> &image, int timeout_ms, bool clearEffect);
private: private:

View File

@ -47,7 +47,7 @@ public slots:
/// @param type settingyType from enum /// @param type settingyType from enum
/// @param config configuration object /// @param config configuration object
/// ///
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config); void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
signals: signals:
/// ///

View File

@ -35,7 +35,7 @@ public:
/// @param address The address of the Hyperion server (for example "192.168.0.32:19444) /// @param address The address of the Hyperion server (for example "192.168.0.32:19444)
/// @param skipReply If true skip reply /// @param skipReply If true skip reply
/// ///
FlatBufferConnection(const QString& origin, const QString & address, const int& priority, const bool& skipReply); FlatBufferConnection(const QString& origin, const QString & address, int priority, bool skipReply);
/// ///
/// @brief Destructor /// @brief Destructor
@ -43,7 +43,7 @@ public:
~FlatBufferConnection(); ~FlatBufferConnection();
/// @brief Do not read reply messages from Hyperion if set to true /// @brief Do not read reply messages from Hyperion if set to true
void setSkipReply(const bool& skip); void setSkipReply(bool skip);
/// ///
/// @brief Register a new priority with given origin /// @brief Register a new priority with given origin
@ -100,7 +100,7 @@ signals:
/// ///
/// @brief emits when a new videoMode was requested from flatbuf client /// @brief emits when a new videoMode was requested from flatbuf client
/// ///
void setVideoMode(const VideoMode videoMode); void setVideoMode(VideoMode videoMode);
private: private:

View File

@ -29,7 +29,7 @@ public slots:
/// @param type The type from enum /// @param type The type from enum
/// @param config The configuration /// @param config The configuration
/// ///
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config); void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
void initServer(); void initServer();

View File

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

View File

@ -18,7 +18,7 @@ public:
/// @param[in] grabWidth The width of the grabbed image [pixels] /// @param[in] grabWidth The width of the grabbed image [pixels]
/// @param[in] grabHeight The height of the grabbed images [pixels] /// @param[in] grabHeight The height of the grabbed images [pixels]
/// ///
AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight); AmlogicWrapper(unsigned grabWidth, unsigned grabHeight);
public slots: public slots:
/// ///

View File

@ -26,7 +26,7 @@ public:
/// @param[in] width The width of the captured screenshot /// @param[in] width The width of the captured screenshot
/// @param[in] height The heigth of the captured screenshot /// @param[in] height The heigth of the captured screenshot
/// ///
DispmanxFrameGrabber(const unsigned width, const unsigned height); DispmanxFrameGrabber(unsigned width, unsigned height);
~DispmanxFrameGrabber() override; ~DispmanxFrameGrabber() override;
@ -50,7 +50,7 @@ private:
/// ///
/// @param vc_flags The snapshot grabbing mask /// @param vc_flags The snapshot grabbing mask
/// ///
void setFlags(const int vc_flags); void setFlags(int vc_flags);
/// ///
/// @brief free _vc_resource and captureBuffer /// @brief free _vc_resource and captureBuffer

View File

@ -20,7 +20,7 @@ public:
/// @param[in] grabHeight The height of the grabbed images [pixels] /// @param[in] grabHeight The height of the grabbed images [pixels]
/// @param[in] updateRate_Hz The image grab rate [Hz] /// @param[in] updateRate_Hz The image grab rate [Hz]
/// ///
DispmanxWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz); DispmanxWrapper(unsigned grabWidth, unsigned grabHeight, unsigned updateRate_Hz);
public slots: public slots:
/// ///

View File

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

View File

@ -20,7 +20,7 @@ public:
/// @param[in] grabHeight The height of the grabbed images [pixels] /// @param[in] grabHeight The height of the grabbed images [pixels]
/// @param[in] updateRate_Hz The image grab rate [Hz] /// @param[in] updateRate_Hz The image grab rate [Hz]
/// ///
FramebufferWrapper(const QString & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz); FramebufferWrapper(const QString & device, unsigned grabWidth, unsigned grabHeight, unsigned updateRate_Hz);
public slots: public slots:
/// ///

View File

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

View File

@ -20,7 +20,7 @@ public:
/// @param[in] grabHeight The height of the grabbed images [pixels] /// @param[in] grabHeight The height of the grabbed images [pixels]
/// @param[in] updateRate_Hz The image grab rate [Hz] /// @param[in] updateRate_Hz The image grab rate [Hz]
/// ///
OsxWrapper(const unsigned display, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz); OsxWrapper(unsigned display, unsigned grabWidth, unsigned grabHeight, unsigned updateRate_Hz);
public slots: public slots:
/// ///

View File

@ -75,7 +75,7 @@ private:
/// ///
/// @brief Is called whenever we need new screen dimension calculations based on window geometry /// @brief Is called whenever we need new screen dimension calculations based on window geometry
/// ///
int updateScreenDimensions(const bool& force); int updateScreenDimensions(bool force);
/// ///
/// @brief free the _screen pointer /// @brief free the _screen pointer

View File

@ -19,7 +19,7 @@ public:
/// @param[in] pixelDecimation Decimation factor for image [pixels] /// @param[in] pixelDecimation Decimation factor for image [pixels]
/// @param[in] updateRate_Hz The image grab rate [Hz] /// @param[in] updateRate_Hz The image grab rate [Hz]
/// ///
QtWrapper(int cropLeft, int cropRight, int cropTop, int cropBottom, int pixelDecimation, int display, const unsigned updateRate_Hz); QtWrapper(int cropLeft, int cropRight, int cropTop, int cropBottom, int pixelDecimation, int display, unsigned updateRate_Hz);
public slots: public slots:
/// ///

View File

@ -32,7 +32,7 @@ public slots:
void setCecDetectionEnable(bool enable); void setCecDetectionEnable(bool enable);
void setDeviceVideoStandard(QString device, VideoStandard videoStandard); void setDeviceVideoStandard(QString device, VideoStandard videoStandard);
void handleCecEvent(CECEvent event); void handleCecEvent(CECEvent event);
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config) override; void handleSettingsUpdate(settings::type type, const QJsonDocument& config) override;
private slots: private slots:
void newFrame(const Image<ColorRgb> & image); void newFrame(const Image<ColorRgb> & image);

View File

@ -24,7 +24,7 @@ public:
/// @param[in] grabHeight The height of the grabbed images [pixels] /// @param[in] grabHeight The height of the grabbed images [pixels]
/// @param[in] updateRate_Hz The image grab rate [Hz] /// @param[in] updateRate_Hz The image grab rate [Hz]
/// ///
X11Wrapper(int cropLeft, int cropRight, int cropTop, int cropBottom, int pixelDecimation, const unsigned updateRate_Hz); X11Wrapper(int cropLeft, int cropRight, int cropTop, int cropBottom, int pixelDecimation, unsigned updateRate_Hz);
/// ///
/// Destructor of this framebuffer frame grabber. Releases any claimed resources. /// Destructor of this framebuffer frame grabber. Releases any claimed resources.

View File

@ -38,25 +38,25 @@ public:
/// @brief Get the unique id (imported from removed class 'Stats') /// @brief Get the unique id (imported from removed class 'Stats')
/// @return The unique id /// @return The unique id
/// ///
const QString &getID() { return _uuid; }; const QString &getID() const { return _uuid; };
/// ///
/// @brief Check authorization is required according to the user setting /// @brief Check authorization is required according to the user setting
/// @return True if authorization required else false /// @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 /// @brief Check if authorization is required for local network connections
/// @return True if authorization required else false /// @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 /// @brief Check if authorization is required for local network connections for admin access
/// @return True if authorization required else false /// @return True if authorization required else false
/// ///
const bool &isLocalAdminAuthRequired() { return _localAdminAuthRequired; }; bool isLocalAdminAuthRequired() const { return _localAdminAuthRequired; };
/// ///
/// @brief Reset Hyperion user /// @brief Reset Hyperion user
@ -158,7 +158,7 @@ public slots:
/// @param id The id of the request /// @param id The id of the request
/// @param accept The accept or deny 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 /// @brief Get pending requests
@ -183,7 +183,7 @@ public slots:
/// @param type settings type from enum /// @param type settings type from enum
/// @param config configuration object /// @param config configuration object
/// ///
void handleSettingsUpdate(const settings::type &type, const QJsonDocument &config); void handleSettingsUpdate(settings::type type, const QJsonDocument &config);
signals: signals:
/// ///
@ -201,7 +201,7 @@ signals:
/// @param comment The comment that was part of the request /// @param comment The comment that was part of the request
/// @param id The id 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 /// @brief Emits whenever the token list changes
@ -214,7 +214,7 @@ private:
/// @brief Increment counter for token/user auth /// @brief Increment counter for token/user auth
/// @param user If true we increment USER auth instead of token /// @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 /// Database interface for auth table
AuthTable *_authTable; AuthTable *_authTable;

View File

@ -29,7 +29,7 @@ private slots:
/// @param type settingyType from enum /// @param type settingyType from enum
/// @param config configuration object /// @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) if(type == settings::BGEFFECT)
{ {

View File

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

View File

@ -27,7 +27,7 @@ public:
/// @param comp The component from enum /// @param comp The component from enum
/// @return True if component is running else false. Not found is -1 /// @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 /// contains all components and their state
std::map<hyperion::Components, bool> getRegister() const { return _componentStates; }; std::map<hyperion::Components, bool> getRegister() const { return _componentStates; };
@ -38,7 +38,7 @@ signals:
/// @param comp The component /// @param comp The component
/// @param state The new state of 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: public slots:
/// ///
@ -46,13 +46,13 @@ public slots:
/// @param comp The component /// @param comp The component
/// @param state The new state of 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: private slots:
/// ///
/// @brief Handle COMP_ALL changes from Hyperion->compStateChangeRequest /// @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: private:
/// Hyperion instance /// Hyperion instance

View File

@ -29,7 +29,7 @@ class GrabberWrapper : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
GrabberWrapper(QString grabberName, Grabber * ggrabber, unsigned width, unsigned height, const unsigned updateRate_Hz = 0); GrabberWrapper(QString grabberName, Grabber * ggrabber, unsigned width, unsigned height, unsigned updateRate_Hz = 0);
virtual ~GrabberWrapper(); virtual ~GrabberWrapper();
@ -122,7 +122,7 @@ public slots:
/// Set the video mode (2D/3D) /// Set the video mode (2D/3D)
/// @param[in] mode The new video mode /// @param[in] mode The new video mode
/// ///
virtual void setVideoMode(const VideoMode& videoMode); virtual void setVideoMode(VideoMode videoMode);
/// ///
/// Set the crop values /// Set the crop values
@ -138,7 +138,7 @@ public slots:
/// @param type settingyType from enum /// @param type settingyType from enum
/// @param config configuration object /// @param config configuration object
/// ///
virtual void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config); virtual void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
signals: signals:
/// ///
@ -149,7 +149,7 @@ signals:
private slots: private slots:
/// @brief Handle a source request event from Hyperion. /// @brief Handle a source request event from Hyperion.
/// Will start and stop grabber based on active listeners count /// 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 /// @brief Update Update capture rate

View File

@ -120,7 +120,7 @@ public slots:
/// @param[in] owner Specific owner string, might be empty /// @param[in] owner Specific owner string, might be empty
/// @param[in] smooth_cfg The smooth id to use /// @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()) /// @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 /// @param clearEffect Should be true when NOT called from an effect
/// @return True on success, false when priority is not found /// @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()) /// @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 /// @param clearEffect Should be true when NOT called from an effect
/// @return True on success, false when priority is not found /// @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 /// Writes a single color to all the leds for the given time and priority
@ -155,14 +155,14 @@ public slots:
/// @param[in] origin The setter /// @param[in] origin The setter
/// @param clearEffect Should be true when NOT called from an effect /// @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 /// @brief Set the given priority to inactive
/// @param priority The priority /// @param priority The priority
/// @return True on success false if not found /// @return True on success false if not found
/// ///
bool setInputInactive(const quint8& priority); bool setInputInactive(quint8 priority);
/// ///
/// Returns the list with unique adjustment identifiers /// Returns the list with unique adjustment identifiers
@ -187,7 +187,7 @@ public slots:
/// @param[in] forceClearAll Force the clear /// @param[in] forceClearAll Force the clear
/// @return True on success else false (not found) /// @return True on success else false (not found)
/// ///
bool clear(const int priority, bool forceClearAll=false); bool clear(int priority, bool forceClearAll=false);
/// ############# /// #############
// EFFECTENGINE // EFFECTENGINE
@ -255,14 +255,14 @@ public slots:
/// @brief enable/disable automatic/priorized source selection /// @brief enable/disable automatic/priorized source selection
/// @param state The new state /// @param state The new state
/// ///
void setSourceAutoSelect(const bool state); void setSourceAutoSelect(bool state);
/// ///
/// @brief set current input source to visible /// @brief set current input source to visible
/// @param priority the priority channel which should be vidible /// @param priority the priority channel which should be vidible
/// @return true if success, false on error /// @return true if success, false on error
/// ///
bool setVisiblePriority(const int& priority); bool setVisiblePriority(int priority);
/// gets current state of automatic/priorized source selection /// gets current state of automatic/priorized source selection
/// @return the state /// @return the state
@ -280,7 +280,7 @@ public slots:
/// ///
/// @return bool /// @return bool
/// ///
bool isCurrentPriority(const int priority) const; bool isCurrentPriority(int priority) const;
/// ///
/// Returns a list of all registered priorities /// 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 /// @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 /// SETTINGSMANAGER
@ -305,7 +305,7 @@ public slots:
/// @param type The settingsType from enum /// @param type The settingsType from enum
/// @return Data Document /// @return Data Document
/// ///
QJsonDocument getSetting(const settings::type& type) const; QJsonDocument getSetting(settings::type type) const;
/// gets the current json config object from SettingsManager /// gets the current json config object from SettingsManager
/// @return json config /// @return json config
@ -317,7 +317,7 @@ public slots:
/// @param correct If true will correct json against schema before save /// @param correct If true will correct json against schema before save
/// @return True on success else false /// @return True on success else false
/// ///
bool saveSettings(QJsonObject config, const bool& correct = false); bool saveSettings(QJsonObject config, bool correct = false);
/// ############ /// ############
/// COMPONENTREGISTER /// COMPONENTREGISTER
@ -332,7 +332,7 @@ public slots:
/// @param[in] component The component from enum /// @param[in] component The component from enum
/// @param[in] state The state of the component [true | false] /// @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 /// @brief Get a list of all contrable components and their current state
@ -345,16 +345,16 @@ public slots:
/// @param The component to test /// @param The component to test
/// @return Component state /// @return Component state
/// ///
int isComponentEnabled(const hyperion::Components& comp); int isComponentEnabled(hyperion::Components comp);
/// sets the methode how image is maped to leds at ImageProcessor /// 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) /// Set the video mode (2D/3D)
/// @param[in] mode The new video mode /// @param[in] mode The new video mode
/// ///
void setVideoMode(const VideoMode& mode); void setVideoMode(VideoMode mode);
/// ///
/// @brief Init after thread start /// @brief Init after thread start
@ -383,13 +383,13 @@ signals:
/// @param component The component from enum /// @param component The component from enum
/// @param enabled The new state of the component /// @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 /// @brief Emits whenever the imageToLedsMapping has changed
/// @param mappingType The new mapping type /// @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() /// @brief Emits whenever the visible priority delivers a image which is applied in update()
@ -410,19 +410,19 @@ signals:
/// ///
/// @brief Is emitted from clients who request a videoMode change /// @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!) /// @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 /// @brief Emits whenever a config part changed. SIGNAL PIPE helper for SettingsManager -> HyperionDaemon
/// @param type The settings type from enum /// @param type The settings type from enum
/// @param data The data as QJsonDocument /// @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 /// @brief Emits whenever the adjustments have been updated
@ -459,19 +459,19 @@ private slots:
/// @brief Handle whenever the visible component changed /// @brief Handle whenever the visible component changed
/// @param comp The new component /// @param comp The new component
/// ///
void handleVisibleComponentChanged(const hyperion::Components& comp); void handleVisibleComponentChanged(hyperion::Components comp);
/// ///
/// @brief Apply settings updates for LEDS and COLOR /// @brief Apply settings updates for LEDS and COLOR
/// @param type The type from enum /// @param type The type from enum
/// @param config The configuration /// @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 /// @brief Apply new videoMode from Daemon to _currVideoMode
/// ///
void handleNewVideoMode(const VideoMode& mode) { _currVideoMode = mode; } void handleNewVideoMode(VideoMode mode) { _currVideoMode = mode; }
private: private:
friend class HyperionDaemon; friend class HyperionDaemon;
@ -481,7 +481,7 @@ private:
/// @brief Constructs the Hyperion instance, just accessible for HyperionIManager /// @brief Constructs the Hyperion instance, just accessible for HyperionIManager
/// @param instance The instance index /// @param instance The instance index
/// ///
Hyperion(const quint8& instance); Hyperion(quint8 instance);
/// instance index /// instance index
const quint8 _instIndex; const quint8 _instIndex;

View File

@ -38,14 +38,14 @@ public slots:
/// @param inst The instance to check /// @param inst The instance to check
/// @return True when running else false /// @return True when running else false
/// ///
bool IsInstanceRunning(const quint8& inst) { return _runningInstances.contains(inst); } bool IsInstanceRunning(quint8 inst) { return _runningInstances.contains(inst); }
/// ///
/// @brief Get a Hyperion instance by index /// @brief Get a Hyperion instance by index
/// @param intance the index /// @param intance the index
/// @return Hyperion instance, if index is not found returns instance 0 /// @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 /// @brief Get instance data of all instaces in db + running state
@ -58,20 +58,20 @@ public slots:
/// @param block If true return when thread has been started /// @param block If true return when thread has been started
/// @return Return true on success, false if not found in db /// @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 /// @brief Stop a Hyperion instance
/// @param instance Instance index /// @param instance Instance index
/// @return Return true on success, false if not found in db /// @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 /// @brief Toggle the state of all Hyperion instances
/// @param pause If true all instances toggle to pause, else to resume /// @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 /// @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) /// @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 /// @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 /// @brief Delete Hyperion instance entry in db. Cleanup also all associated table data for this instance
/// @param inst The instance index /// @param inst The instance index
/// @return Return true on success, false if not found or not allowed /// @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 /// @brief Assign a new name to the given instance
@ -94,7 +94,7 @@ public slots:
/// @param name The instance name index /// @param name The instance name index
/// @return Return true on success, false if not found /// @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: signals:
/// ///
@ -103,7 +103,7 @@ signals:
/// @param instance The index of instance /// @param instance The index of instance
/// @param name The name of the instance, just available with H_CREATED /// @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 /// @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 /// @brief PIPE videoMode back to Hyperion
/// ///
void newVideoMode(const VideoMode& mode); void newVideoMode(VideoMode mode);
/////////////////////////////////////// ///////////////////////////////////////
/// FROM HYPERION TO HYPERIONDAEMON /// /// FROM HYPERION TO HYPERIONDAEMON ///
@ -127,17 +127,17 @@ signals:
/// ///
/// @brief PIPE settings events from Hyperion /// @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 /// @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 /// @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: private slots:
/// ///
@ -172,7 +172,7 @@ private:
/// @brief check if a instance is allowed for management. Instance 0 represents the root instance /// @brief check if a instance is allowed for management. Instance 0 represents the root instance
/// @apram inst The instance to check /// @apram inst The instance to check
/// ///
bool isInstAllowed(const quint8& inst) { return (inst > 0); } bool isInstAllowed(quint8 inst) { return (inst > 0); }
private: private:
Logger* _log; Logger* _log;

View File

@ -46,7 +46,7 @@ public:
/// @param[in] width The new width of the buffer-image /// @param[in] width The new width of the buffer-image
/// @param[in] height The new height 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) /// @brief Update the led string (eg on settings change)
@ -57,10 +57,10 @@ public:
bool blackBorderDetectorEnabled(); bool blackBorderDetectorEnabled();
/// Returns the current _userMappingType, this may not be the current applied type! /// Returns the current _userMappingType, this may not be the current applied type!
const int & getUserLedMappingType() { return _userMappingType; }; int getUserLedMappingType() { return _userMappingType; };
/// Returns the current _mappingType /// Returns the current _mappingType
const int & ledMappingType() { return _mappingType; }; int ledMappingType() { return _mappingType; };
static int mappingTypeToInt(QString mappingType); static int mappingTypeToInt(QString mappingType);
static QString mappingTypeToStr(int mappingType); static QString mappingTypeToStr(int mappingType);
@ -215,7 +215,7 @@ private:
} }
private slots: private slots:
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config); void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
private: private:
Logger * _log; Logger * _log;

View File

@ -45,20 +45,20 @@ private slots:
/// @param type settingyType from enum /// @param type settingyType from enum
/// @param config configuration object /// @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 /// @brief Handle component state change MessageForwarder
/// @param component The component from enum /// @param component The component from enum
/// @param enable The new state /// @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 /// @brief Handle priority updates from Priority Muxer
/// @param priority The new visible priority /// @param priority The new visible priority
/// ///
void handlePriorityChanges(const quint8 &priority); void handlePriorityChanges(quint8 priority);
/// ///
/// @brief Forward message to all json slaves /// @brief Forward message to all json slaves

View File

@ -16,7 +16,7 @@
class MultiColorAdjustment class MultiColorAdjustment
{ {
public: public:
MultiColorAdjustment(const unsigned ledCnt); MultiColorAdjustment(unsigned ledCnt);
~MultiColorAdjustment(); ~MultiColorAdjustment();
/** /**

View File

@ -74,14 +74,14 @@ public:
/// @brief Start/Stop the PriorityMuxer update timer; On disabled no priority and timeout updates will be performend /// @brief Start/Stop the PriorityMuxer update timer; On disabled no priority and timeout updates will be performend
/// @param enable The new state /// @param enable The new state
/// ///
void setEnable(const bool& enable); void setEnable(bool enable);
/// @brief Enable or disable auto source selection /// @brief Enable or disable auto source selection
/// @param enable True if it should be enabled else false /// @param enable True if it should be enabled else false
/// @param update True to update _currentPriority - INTERNAL usage. /// @param update True to update _currentPriority - INTERNAL usage.
/// @return True if changed has been applied, false if the state is unchanged /// @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 /// @brief Get the state of source auto selection
@ -94,13 +94,13 @@ public:
/// @param priority The /// @param priority The
/// @return True on success, false if priority not found /// @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 /// @brief Update all ledColos with min length of >= 1 to fit the new led length
/// @param[in] ledCount The count of leds /// @param[in] ledCount The count of leds
/// ///
void updateLedColorsLength(const int& ledCount); void updateLedColorsLength(int ledCount);
/// ///
/// Returns the current priority /// Returns the current priority
@ -114,7 +114,7 @@ public:
/// @param priority The priority channel /// @param priority The priority channel
/// @return True if the priority channel exists else false /// @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 /// Returns the number of active priorities
@ -131,7 +131,7 @@ public:
/// ///
/// @return The information for the specified priority channel /// @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() /// @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] owner Speicifc owner string, might be empty
/// @param[in] smooth_cfg The smooth id to use /// @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()) /// @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) /// @param timeout_ms The new timeout (defaults to -1 endless)
/// @return True on success, false when priority is not found /// @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()) /// @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) /// @param timeout_ms The new timeout (defaults to -1 endless)
/// @return True on success, false when priority is not found /// @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 /// @brief Set the given priority to inactive
/// @param priority The priority /// @param priority The priority
/// @return True on success false if not found /// @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 /// 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 /// @param[in] priority The priority of the channel to clear
/// @return True if priority has been cleared else false (not found) /// @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 /// 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) /// @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: signals:
/// ///
@ -198,38 +198,38 @@ signals:
/// @param priority The priority which has changed /// @param priority The priority which has changed
/// @param state If true it was added else it was removed! /// @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 /// @brief Emits whenever the visible priority has changed
/// @param priority The new visible priority /// @param priority The new visible priority
/// ///
void visiblePriorityChanged(const quint8& priority); void visiblePriorityChanged(quint8 priority);
/// ///
/// @brief Emits whenever the current visible component changed /// @brief Emits whenever the current visible component changed
/// @param comp The new component /// @param comp The new component
/// ///
void visibleComponentChanged(const hyperion::Components& comp); void visibleComponentChanged(hyperion::Components comp);
/// ///
/// @brief Emits whenever a priority changes active state /// @brief Emits whenever a priority changes active state
/// @param priority The priority who changed the active state /// @param priority The priority who changed the active state
/// @param state The new state, state true = active else false /// @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 /// @brief Emits whenever the auto selection state has been changed
/// @param state The new state of auto selection; True enabled else false /// @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 /// @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 /// 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 /// 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 /// Updates the current time. Channels with a configured time out will be checked and cleared if
/// required. /// required.
/// ///
void setCurrentTime(void); void setCurrentTime();
private: private:
/// ///
/// @brief Get the component of the given priority /// @brief Get the component of the given priority
/// @return The component /// @return The component
/// ///
hyperion::Components getComponentOfPriority(const int& priority); hyperion::Components getComponentOfPriority(int priority);
/// Logger instance /// Logger instance
Logger* _log; Logger* _log;

View File

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

View File

@ -46,7 +46,7 @@ private slots:
/// ///
/// Slot which is called when a client closes a connection /// Slot which is called when a client closes a connection
/// ///
void closedConnection(void); void closedConnection();
public slots: public slots:
/// ///
@ -54,7 +54,7 @@ public slots:
/// @param type settings type from enum /// @param type settings type from enum
/// @param config configuration object /// @param config configuration object
/// ///
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config); void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
private: private:
/// The TCP server object /// The TCP server object

View File

@ -78,7 +78,7 @@ public slots:
/// @param component The comp from enum /// @param component The comp from enum
/// @param state The new state /// @param state The new state
/// ///
void handleComponentState(const hyperion::Components component, const bool state); void handleComponentState(hyperion::Components component, bool state);
signals: signals:
/// ///

View File

@ -30,7 +30,7 @@ public slots:
/// @param type The type from enum /// @param type The type from enum
/// @param config The configuration /// @param config The configuration
/// ///
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config); void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
void initServer(); void initServer();

View File

@ -58,7 +58,7 @@ public:
/// @param timeout_ms The timeout in ms /// @param timeout_ms The timeout in ms
/// @return The address+port of web-server or empty if timed out /// @return The address+port of web-server or empty if timed out
/// ///
const QString getFirstService(const searchType &type = searchType::STY_WEBSERVER,const QString &st = "urn:hyperion-project.org:device:basic:1", const int &timeout_ms = 3000); const QString getFirstService(const searchType &type = searchType::STY_WEBSERVER,const QString &st = "urn:hyperion-project.org:device:basic:1", int timeout_ms = 3000);
/// ///
/// @brief Discover services via ssdp. /// @brief Discover services via ssdp.

View File

@ -19,7 +19,7 @@ class QNetworkConfigurationManager;
class SSDPHandler : public SSDPServer{ class SSDPHandler : public SSDPServer{
Q_OBJECT Q_OBJECT
public: public:
SSDPHandler(WebServer* webserver, const quint16& flatBufPort, const quint16& jsonServerPort, const QString &name, QObject * parent = nullptr); SSDPHandler(WebServer* webserver, quint16 flatBufPort, quint16 jsonServerPort, const QString &name, QObject * parent = nullptr);
~SSDPHandler(); ~SSDPHandler();
/// ///
@ -37,14 +37,14 @@ public slots:
/// @brief get state changes from webserver /// @brief get state changes from webserver
/// @param newState true for started and false for stopped /// @param newState true for started and false for stopped
/// ///
void handleWebServerStateChange(const bool newState); void handleWebServerStateChange(bool newState);
/// ///
/// @brief Handle settings update from Hyperion Settingsmanager emit /// @brief Handle settings update from Hyperion Settingsmanager emit
/// @param type settingyType from enum /// @param type settingyType from enum
/// @param config configuration object /// @param config configuration object
/// ///
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config); void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
private: private:
/// ///
@ -72,7 +72,7 @@ private:
/// @brief Send alive/byebye message based on _deviceList /// @brief Send alive/byebye message based on _deviceList
/// @param alive When true send alive, else byebye /// @param alive When true send alive, else byebye
/// ///
void sendAnnounceList(const bool alive); void sendAnnounceList(bool alive);
private slots: private slots:
/// ///
@ -82,7 +82,7 @@ private slots:
/// @param address The ip of the caller /// @param address The ip of the caller
/// @param port The port of the caller /// @param port The port of the caller
/// ///
void handleMSearchRequest(const QString& target, const QString& mx, const QString address, const quint16 & port); void handleMSearchRequest(const QString& target, const QString& mx, const QString address, quint16 port);
/// ///
/// @brief Handle changes in the network configuration /// @brief Handle changes in the network configuration

View File

@ -41,7 +41,7 @@ public:
/// @param senderIp Ip address of the sender /// @param senderIp Ip address of the sender
/// @param senderPort The port of the sender /// @param senderPort The port of the sender
/// ///
void sendMSearchResponse(const QString& st, const QString& senderIp, const quint16& senderPort); void sendMSearchResponse(const QString& st, const QString& senderIp, quint16 senderPort);
/// ///
/// @brief Send ByeBye notification (on SSDP stop) (repeated 3 times) /// @brief Send ByeBye notification (on SSDP stop) (repeated 3 times)
@ -76,7 +76,7 @@ public:
/// ///
/// @brief set new flatbuffer server port /// @brief set new flatbuffer server port
/// ///
void setFlatBufPort(const quint16& port) { _fbsPort = QString::number(port); }; void setFlatBufPort(quint16 port) { _fbsPort = QString::number(port); };
/// ///
/// @brief Get current flatbuffer server port /// @brief Get current flatbuffer server port
@ -86,7 +86,7 @@ public:
/// ///
/// @brief set new jsonserver server port /// @brief set new jsonserver server port
/// ///
void setJsonServerPort(const quint16& port) { _jssPort = QString::number(port); }; void setJsonServerPort(quint16 port) { _jssPort = QString::number(port); };
/// ///
/// @brief get new jsonserver server port /// @brief get new jsonserver server port
@ -112,7 +112,7 @@ signals:
/// @param address The ip of the caller /// @param address The ip of the caller
/// @param port The port of the caller /// @param port The port of the caller
/// ///
void msearchRequestReceived(const QString& target, const QString& mx, const QString address, const quint16 & port); void msearchRequestReceived(const QString& target, const QString& mx, const QString address, quint16 port);
private: private:
Logger* _log; Logger* _log;

View File

@ -54,7 +54,7 @@ signals:
/// @param[in] owner Specific owner string, might be empty /// @param[in] owner Specific owner string, might be empty
/// @param[in] smooth_cfg The smooth id to use /// @param[in] smooth_cfg The smooth id to use
/// ///
void registerGlobalInput(const int priority, const hyperion::Components& component, const QString& origin = "External", const QString& owner = "", unsigned smooth_cfg = 0); void registerGlobalInput(int priority, hyperion::Components component, const QString& origin = "External", const QString& owner = "", unsigned smooth_cfg = 0);
/// ///
/// @brief PIPE the clear command for the global priority channel over HyperionDaemon to Hyperion class /// @brief PIPE the clear command for the global priority channel over HyperionDaemon to Hyperion class
@ -70,7 +70,7 @@ signals:
/// @param[in] timeout_ms The timeout in milliseconds /// @param[in] timeout_ms The timeout in milliseconds
/// @param clearEffect Should be true when NOT called from an effect /// @param clearEffect Should be true when NOT called from an effect
/// ///
void setGlobalImage(const int priority, const Image<ColorRgb>& image, const int timeout_ms, const bool& clearEffect = true); void setGlobalImage(int priority, const Image<ColorRgb>& image, int timeout_ms, bool clearEffect = true);
/// ///
/// @brief PIPE external color message over HyperionDaemon to Hyperion class /// @brief PIPE external color message over HyperionDaemon to Hyperion class
@ -80,7 +80,7 @@ signals:
/// @param[in] origin The setter /// @param[in] origin The setter
/// @param clearEffect Should be true when NOT called from an effect /// @param clearEffect Should be true when NOT called from an effect
/// ///
void setGlobalColor(const int priority, const std::vector<ColorRgb> &ledColor, const int timeout_ms, const QString& origin = "External" ,bool clearEffects = true); void setGlobalColor(int priority, const std::vector<ColorRgb> &ledColor, int timeout_ms, const QString& origin = "External" ,bool clearEffects = true);
/////////////////////////////////////// ///////////////////////////////////////
//////////// FROM HYPERION //////////// //////////// FROM HYPERION ////////////
@ -98,6 +98,6 @@ signals:
/// @param hyperionInd The Hyperion instance index as identifier /// @param hyperionInd The Hyperion instance index as identifier
/// @param listen True when listening, else false /// @param listen True when listening, else false
/// ///
void requestSource(const hyperion::Components& component, const int hyperionInd, const bool listen); void requestSource(hyperion::Components component, int hyperionInd, bool listen);
}; };

View File

@ -15,7 +15,7 @@ public:
{ {
} }
Image(const unsigned width, const unsigned height) : Image(unsigned width, unsigned height) :
Image(width, height, Pixel_T()) Image(width, height, Pixel_T())
{ {
@ -28,7 +28,7 @@ public:
/// @param height The height of the image /// @param height The height of the image
/// @param background The color of the image /// @param background The color of the image
/// ///
Image(const unsigned width, const unsigned height, const Pixel_T background) : Image(unsigned width, unsigned height, const Pixel_T background) :
_d_ptr(new ImageData<Pixel_T>(width, height, background)) _d_ptr(new ImageData<Pixel_T>(width, height, background))
{ {
} }
@ -93,12 +93,12 @@ public:
return _d_ptr->height(); return _d_ptr->height();
} }
uint8_t red(const unsigned pixel) const uint8_t red(unsigned pixel) const
{ {
return _d_ptr->red(pixel); return _d_ptr->red(pixel);
} }
uint8_t green(const unsigned pixel) const uint8_t green(unsigned pixel) const
{ {
return _d_ptr->green(pixel); return _d_ptr->green(pixel);
} }
@ -111,7 +111,7 @@ public:
/// ///
/// @return const reference to specified pixel /// @return const reference to specified pixel
/// ///
uint8_t blue(const unsigned pixel) const uint8_t blue(unsigned pixel) const
{ {
return _d_ptr->blue(pixel); return _d_ptr->blue(pixel);
} }
@ -121,7 +121,7 @@ public:
/// ///
/// @param x The x index /// @param x The x index
/// @param y The y index /// @param y The y index
const Pixel_T& operator()(const unsigned x, const unsigned y) const const Pixel_T& operator()(unsigned x, unsigned y) const
{ {
return _d_ptr->operator()(x, y); return _d_ptr->operator()(x, y);
} }
@ -129,7 +129,7 @@ public:
/// ///
/// @return reference to specified pixel /// @return reference to specified pixel
/// ///
Pixel_T& operator()(const unsigned x, const unsigned y) Pixel_T& operator()(unsigned x, unsigned y)
{ {
return _d_ptr->operator()(x, y); return _d_ptr->operator()(x, y);
} }
@ -137,7 +137,7 @@ public:
/// Resize the image /// Resize the image
/// @param width The width of the image /// @param width The width of the image
/// @param height The height of the image /// @param height The height of the image
void resize(const unsigned width, const unsigned height) void resize(unsigned width, unsigned height)
{ {
_d_ptr->resize(width, height); _d_ptr->resize(width, height);
} }
@ -198,7 +198,7 @@ private:
/// ///
/// @return The index into the underlying data-vector /// @return The index into the underlying data-vector
/// ///
inline unsigned toIndex(const unsigned x, const unsigned y) const inline unsigned toIndex(unsigned x, unsigned y) const
{ {
return _d_ptr->toIndex(x, y); return _d_ptr->toIndex(x, y);
} }

View File

@ -24,7 +24,7 @@ class ImageData : public QSharedData
public: public:
typedef Pixel_T pixel_type; typedef Pixel_T pixel_type;
ImageData(const unsigned width, const unsigned height, const Pixel_T background) : ImageData(unsigned width, unsigned height, const Pixel_T background) :
_width(width), _width(width),
_height(height), _height(height),
_pixels(new Pixel_T[width * height + 1]) _pixels(new Pixel_T[width * height + 1])
@ -84,32 +84,32 @@ public:
return _height; return _height;
} }
uint8_t red(const unsigned pixel) const uint8_t red(unsigned pixel) const
{ {
return (_pixels + pixel)->red; return (_pixels + pixel)->red;
} }
uint8_t green(const unsigned pixel) const uint8_t green(unsigned pixel) const
{ {
return (_pixels + pixel)->green; return (_pixels + pixel)->green;
} }
uint8_t blue(const unsigned pixel) const uint8_t blue(unsigned pixel) const
{ {
return (_pixels + pixel)->blue; return (_pixels + pixel)->blue;
} }
const Pixel_T& operator()(const unsigned x, const unsigned y) const const Pixel_T& operator()(unsigned x, unsigned y) const
{ {
return _pixels[toIndex(x,y)]; return _pixels[toIndex(x,y)];
} }
Pixel_T& operator()(const unsigned x, const unsigned y) Pixel_T& operator()(unsigned x, unsigned y)
{ {
return _pixels[toIndex(x,y)]; return _pixels[toIndex(x,y)];
} }
void resize(const unsigned width, const unsigned height) void resize(unsigned width, unsigned height)
{ {
if (width == _width && height == _height) if (width == _width && height == _height)
return; return;
@ -167,7 +167,7 @@ public:
} }
private: private:
inline unsigned toIndex(const unsigned x, const unsigned y) const inline unsigned toIndex(unsigned x, unsigned y) const
{ {
return y * _width + x; return y * _width + x;
} }

View File

@ -42,7 +42,7 @@ private slots:
/// @param type settingyType from enum /// @param type settingyType from enum
/// @param config configuration object /// @param config configuration object
/// ///
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config); void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
private: private:
Logger* _log; Logger* _log;

View File

@ -71,7 +71,7 @@ namespace hyperion {
return RgbTransform(gammaR, gammaG, gammaB, backlightThreshold, backlightColored, brightness, brightnessComp); return RgbTransform(gammaR, gammaG, gammaB, backlightThreshold, backlightColored, brightness, brightnessComp);
} }
RgbChannelAdjustment createRgbChannelAdjustment(const QJsonObject& colorConfig, const QString& channelName, const int defaultR, const int defaultG, const int defaultB) RgbChannelAdjustment createRgbChannelAdjustment(const QJsonObject& colorConfig, const QString& channelName, int defaultR, int defaultG, int defaultB)
{ {
const QJsonArray& channelConfig = colorConfig[channelName].toArray(); const QJsonArray& channelConfig = colorConfig[channelName].toArray();
return RgbChannelAdjustment( return RgbChannelAdjustment(
@ -101,7 +101,7 @@ namespace hyperion {
return adjustment; return adjustment;
} }
MultiColorAdjustment * createLedColorsAdjustment(const unsigned ledCnt, const QJsonObject & colorConfig) MultiColorAdjustment * createLedColorsAdjustment(unsigned ledCnt, const QJsonObject & colorConfig)
{ {
// Create the result, the transforms are added to this // Create the result, the transforms are added to this
MultiColorAdjustment * adjustment = new MultiColorAdjustment(ledCnt); MultiColorAdjustment * adjustment = new MultiColorAdjustment(ledCnt);

View File

@ -32,7 +32,7 @@ class WebServer : public QObject {
Q_OBJECT Q_OBJECT
public: public:
WebServer (const QJsonDocument& config, const bool& useSsl, QObject * parent = 0); WebServer (const QJsonDocument& config, bool useSsl, QObject * parent = 0);
~WebServer () override; ~WebServer () override;
@ -44,12 +44,12 @@ signals:
/// @emits whenever server is started or stopped (to sync with SSDPHandler) /// @emits whenever server is started or stopped (to sync with SSDPHandler)
/// @param newState True when started, false when stopped /// @param newState True when started, false when stopped
/// ///
void stateChange(const bool newState); void stateChange(bool newState);
/// ///
/// @brief Emits whenever the port changes (doesn't compare prev <> now) /// @brief Emits whenever the port changes (doesn't compare prev <> now)
/// ///
void portChanged(const quint16& port); void portChanged(quint16 port);
public slots: public slots:
/// ///
@ -57,7 +57,7 @@ public slots:
/// ///
void initServer(); void initServer();
void onServerStopped (void); void onServerStopped ();
void onServerStarted (quint16 port); void onServerStarted (quint16 port);
void onServerError (QString msg); void onServerError (QString msg);
@ -66,7 +66,7 @@ public slots:
/// @param type settingyType from enum /// @param type settingyType from enum
/// @param config configuration object /// @param config configuration object
/// ///
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config); void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
/// ///
/// @brief Set a new description, if empty the description is NotFound for clients /// @brief Set a new description, if empty the description is NotFound for clients

View File

@ -33,7 +33,7 @@
using namespace hyperion; using namespace hyperion;
API::API(Logger *log, const bool &localConnection, QObject *parent) API::API(Logger *log, bool localConnection, QObject *parent)
: QObject(parent) : QObject(parent)
{ {
qRegisterMetaType<int64_t>("int64_t"); qRegisterMetaType<int64_t>("int64_t");
@ -59,7 +59,7 @@ API::API(Logger *log, const bool &localConnection, QObject *parent)
connect(_authManager, &AuthManager::tokenResponse, this, &API::checkTokenResponse); connect(_authManager, &AuthManager::tokenResponse, this, &API::checkTokenResponse);
} }
void API::init(void) void API::init()
{ {
bool apiAuthRequired = _authManager->isAuthRequired(); bool apiAuthRequired = _authManager->isAuthRequired();
@ -82,7 +82,7 @@ void API::init(void)
} }
} }
void API::setColor(const int &priority, const std::vector<uint8_t> &ledColors, const int &timeout_ms, const QString &origin, const hyperion::Components &callerComp) void API::setColor(int priority, const std::vector<uint8_t> &ledColors, int timeout_ms, const QString &origin, hyperion::Components callerComp)
{ {
std::vector<ColorRgb> fledColors; std::vector<ColorRgb> fledColors;
if (ledColors.size() % 3 == 0) if (ledColors.size() % 3 == 0)
@ -95,7 +95,7 @@ void API::setColor(const int &priority, const std::vector<uint8_t> &ledColors, c
} }
} }
bool API::setImage(ImageCmdData &data, hyperion::Components comp, QString &replyMsg, const hyperion::Components &callerComp) bool API::setImage(ImageCmdData &data, hyperion::Components comp, QString &replyMsg, hyperion::Components callerComp)
{ {
// truncate name length // truncate name length
data.imgName.truncate(16); data.imgName.truncate(16);
@ -174,7 +174,7 @@ bool API::setImage(ImageCmdData &data, hyperion::Components comp, QString &reply
return true; return true;
} }
bool API::clearPriority(const int &priority, QString &replyMsg, const hyperion::Components &callerComp) bool API::clearPriority(int priority, QString &replyMsg, hyperion::Components callerComp)
{ {
if (priority < 0 || (priority > 0 && priority < 254)) if (priority < 0 || (priority > 0 && priority < 254))
{ {
@ -188,7 +188,7 @@ bool API::clearPriority(const int &priority, QString &replyMsg, const hyperion::
return true; return true;
} }
bool API::setComponentState(const QString &comp, bool &compState, QString &replyMsg, const hyperion::Components &callerComp) bool API::setComponentState(const QString &comp, bool &compState, QString &replyMsg, hyperion::Components callerComp)
{ {
Components component = stringToComponent(comp); Components component = stringToComponent(comp);
@ -201,17 +201,17 @@ bool API::setComponentState(const QString &comp, bool &compState, QString &reply
return false; return false;
} }
void API::setLedMappingType(const int &type, const hyperion::Components &callerComp) void API::setLedMappingType(int type, hyperion::Components callerComp)
{ {
QMetaObject::invokeMethod(_hyperion, "setLedMappingType", Qt::QueuedConnection, Q_ARG(int, type)); QMetaObject::invokeMethod(_hyperion, "setLedMappingType", Qt::QueuedConnection, Q_ARG(int, type));
} }
void API::setVideoMode(const VideoMode &mode, const hyperion::Components &callerComp) void API::setVideoMode(VideoMode mode, hyperion::Components callerComp)
{ {
QMetaObject::invokeMethod(_hyperion, "setVideoMode", Qt::QueuedConnection, Q_ARG(VideoMode, mode)); QMetaObject::invokeMethod(_hyperion, "setVideoMode", Qt::QueuedConnection, Q_ARG(VideoMode, mode));
} }
void API::setEffect(const EffectCmdData &dat, const hyperion::Components &callerComp) void API::setEffect(const EffectCmdData &dat, hyperion::Components callerComp)
{ {
if (!dat.args.isEmpty()) if (!dat.args.isEmpty())
{ {
@ -223,17 +223,17 @@ void API::setEffect(const EffectCmdData &dat, const hyperion::Components &caller
} }
} }
void API::setSourceAutoSelect(const bool state, const hyperion::Components &callerComp) void API::setSourceAutoSelect(bool state, hyperion::Components callerComp)
{ {
QMetaObject::invokeMethod(_hyperion, "setSourceAutoSelect", Qt::QueuedConnection, Q_ARG(bool, state)); QMetaObject::invokeMethod(_hyperion, "setSourceAutoSelect", Qt::QueuedConnection, Q_ARG(bool, state));
} }
void API::setVisiblePriority(const int &priority, const hyperion::Components &callerComp) void API::setVisiblePriority(int priority, hyperion::Components callerComp)
{ {
QMetaObject::invokeMethod(_hyperion, "setVisiblePriority", Qt::QueuedConnection, Q_ARG(int, priority)); QMetaObject::invokeMethod(_hyperion, "setVisiblePriority", Qt::QueuedConnection, Q_ARG(int, priority));
} }
void API::registerInput(const int &priority, const hyperion::Components &component, const QString &origin, const QString &owner, const hyperion::Components &callerComp) void API::registerInput(int priority, hyperion::Components component, const QString &origin, const QString &owner, hyperion::Components callerComp)
{ {
if (_activeRegisters.count(priority)) if (_activeRegisters.count(priority))
_activeRegisters.erase(priority); _activeRegisters.erase(priority);
@ -243,13 +243,13 @@ void API::registerInput(const int &priority, const hyperion::Components &compone
QMetaObject::invokeMethod(_hyperion, "registerInput", Qt::QueuedConnection, Q_ARG(int, priority), Q_ARG(hyperion::Components, component), Q_ARG(QString, origin), Q_ARG(QString, owner)); QMetaObject::invokeMethod(_hyperion, "registerInput", Qt::QueuedConnection, Q_ARG(int, priority), Q_ARG(hyperion::Components, component), Q_ARG(QString, origin), Q_ARG(QString, owner));
} }
void API::unregisterInput(const int &priority) void API::unregisterInput(int priority)
{ {
if (_activeRegisters.count(priority)) if (_activeRegisters.count(priority))
_activeRegisters.erase(priority); _activeRegisters.erase(priority);
} }
bool API::setHyperionInstance(const quint8 &inst) bool API::setHyperionInstance(quint8 inst)
{ {
if (_currInstanceIndex == inst) if (_currInstanceIndex == inst)
return true; return true;
@ -278,19 +278,19 @@ bool API::isHyperionEnabled()
return res > 0; return res > 0;
} }
QVector<QVariantMap> API::getAllInstanceData(void) QVector<QVariantMap> API::getAllInstanceData()
{ {
QVector<QVariantMap> vec; QVector<QVariantMap> vec;
QMetaObject::invokeMethod(_instanceManager, "getInstanceData", Qt::DirectConnection, Q_RETURN_ARG(QVector<QVariantMap>, vec)); QMetaObject::invokeMethod(_instanceManager, "getInstanceData", Qt::DirectConnection, Q_RETURN_ARG(QVector<QVariantMap>, vec));
return vec; return vec;
} }
void API::startInstance(const quint8 &index) void API::startInstance(quint8 index)
{ {
QMetaObject::invokeMethod(_instanceManager, "startInstance", Qt::QueuedConnection, Q_ARG(quint8, index)); QMetaObject::invokeMethod(_instanceManager, "startInstance", Qt::QueuedConnection, Q_ARG(quint8, index));
} }
void API::stopInstance(const quint8 &index) void API::stopInstance(quint8 index)
{ {
QMetaObject::invokeMethod(_instanceManager, "stopInstance", Qt::QueuedConnection, Q_ARG(quint8, index)); QMetaObject::invokeMethod(_instanceManager, "stopInstance", Qt::QueuedConnection, Q_ARG(quint8, index));
} }
@ -302,7 +302,7 @@ void API::requestActiveRegister(QObject *callerInstance)
// QMetaObject::invokeMethod(ApiSync::getInstance(), "answerActiveRegister", Qt::QueuedConnection, Q_ARG(QObject *, callerInstance), Q_ARG(MapRegister, _activeRegisters)); // QMetaObject::invokeMethod(ApiSync::getInstance(), "answerActiveRegister", Qt::QueuedConnection, Q_ARG(QObject *, callerInstance), Q_ARG(MapRegister, _activeRegisters));
} }
bool API::deleteInstance(const quint8 &index, QString &replyMsg) bool API::deleteInstance(quint8 index, QString &replyMsg)
{ {
if (_adminAuthorized) if (_adminAuthorized)
{ {
@ -327,7 +327,7 @@ QString API::createInstance(const QString &name)
return NO_AUTH; return NO_AUTH;
} }
QString API::setInstanceName(const quint8 &index, const QString &name) QString API::setInstanceName(quint8 index, const QString &name)
{ {
if (_adminAuthorized) if (_adminAuthorized)
{ {
@ -417,7 +417,7 @@ void API::cancelNewTokenRequest(const QString &comment, const QString &id)
QMetaObject::invokeMethod(_authManager, "cancelNewTokenRequest", Qt::QueuedConnection, Q_ARG(QObject *, this), Q_ARG(QString, comment), Q_ARG(QString, id)); QMetaObject::invokeMethod(_authManager, "cancelNewTokenRequest", Qt::QueuedConnection, Q_ARG(QObject *, this), Q_ARG(QString, comment), Q_ARG(QString, id));
} }
bool API::handlePendingTokenRequest(const QString &id, const bool accept) bool API::handlePendingTokenRequest(const QString &id, bool accept)
{ {
if (!_adminAuthorized) if (!_adminAuthorized)
return false; return false;
@ -503,7 +503,7 @@ void API::logout()
stopDataConnectionss(); stopDataConnectionss();
} }
void API::checkTokenResponse(const bool &success, QObject *caller, const QString &token, const QString &comment, const QString &id) void API::checkTokenResponse(bool success, QObject *caller, const QString &token, const QString &comment, const QString &id)
{ {
if (this == caller) if (this == caller)
emit onTokenResponse(success, token, comment, id); emit onTokenResponse(success, token, comment, id);

View File

@ -47,7 +47,7 @@
using namespace hyperion; using namespace hyperion;
JsonAPI::JsonAPI(QString peerAddress, Logger *log, const bool &localConnection, QObject *parent, bool noListener) JsonAPI::JsonAPI(QString peerAddress, Logger *log, bool localConnection, QObject *parent, bool noListener)
: API(log, localConnection, parent) : API(log, localConnection, parent)
/* , _authManager(AuthManager::getInstance()) // moved to API /* , _authManager(AuthManager::getInstance()) // moved to API
, _authorized(false) , _authorized(false)
@ -79,7 +79,7 @@ JsonAPI::JsonAPI(QString peerAddress, Logger *log, const bool &localConnection,
Q_INIT_RESOURCE(JSONRPC_schemas); Q_INIT_RESOURCE(JSONRPC_schemas);
} }
void JsonAPI::initialize(void) void JsonAPI::initialize()
{ {
// init API, REQUIRED! // init API, REQUIRED!
API::init(); API::init();
@ -100,7 +100,7 @@ void JsonAPI::initialize(void)
connect(this, &JsonAPI::forwardJsonMessage, _hyperion, &Hyperion::forwardJsonMessage); connect(this, &JsonAPI::forwardJsonMessage, _hyperion, &Hyperion::forwardJsonMessage);
} }
bool JsonAPI::handleInstanceSwitch(const quint8 &inst, const bool &forced) bool JsonAPI::handleInstanceSwitch(quint8 inst, bool forced)
{ {
if (API::setHyperionInstance(inst)) if (API::setHyperionInstance(inst))
{ {
@ -211,7 +211,7 @@ proceed:
handleNotImplemented(); handleNotImplemented();
} }
void JsonAPI::handleColorCommand(const QJsonObject &message, const QString &command, const int tan) void JsonAPI::handleColorCommand(const QJsonObject &message, const QString &command, int tan)
{ {
emit forwardJsonMessage(message); emit forwardJsonMessage(message);
int priority = message["priority"].toInt(); int priority = message["priority"].toInt();
@ -230,7 +230,7 @@ void JsonAPI::handleColorCommand(const QJsonObject &message, const QString &comm
sendSuccessReply(command, tan); sendSuccessReply(command, tan);
} }
void JsonAPI::handleImageCommand(const QJsonObject &message, const QString &command, const int tan) void JsonAPI::handleImageCommand(const QJsonObject &message, const QString &command, int tan)
{ {
emit forwardJsonMessage(message); emit forwardJsonMessage(message);
@ -254,7 +254,7 @@ void JsonAPI::handleImageCommand(const QJsonObject &message, const QString &comm
sendSuccessReply(command, tan); sendSuccessReply(command, tan);
} }
void JsonAPI::handleEffectCommand(const QJsonObject &message, const QString &command, const int tan) void JsonAPI::handleEffectCommand(const QJsonObject &message, const QString &command, int tan)
{ {
emit forwardJsonMessage(message); emit forwardJsonMessage(message);
@ -272,19 +272,19 @@ void JsonAPI::handleEffectCommand(const QJsonObject &message, const QString &com
sendSuccessReply(command, tan); sendSuccessReply(command, tan);
} }
void JsonAPI::handleCreateEffectCommand(const QJsonObject &message, const QString &command, const int tan) void JsonAPI::handleCreateEffectCommand(const QJsonObject &message, const QString &command, int tan)
{ {
const QString resultMsg = API::saveEffect(message); const QString resultMsg = API::saveEffect(message);
resultMsg.isEmpty() ? sendSuccessReply(command, tan) : sendErrorReply(resultMsg, command, tan); resultMsg.isEmpty() ? sendSuccessReply(command, tan) : sendErrorReply(resultMsg, command, tan);
} }
void JsonAPI::handleDeleteEffectCommand(const QJsonObject &message, const QString &command, const int tan) void JsonAPI::handleDeleteEffectCommand(const QJsonObject &message, const QString &command, int tan)
{ {
const QString res = API::deleteEffect(message["name"].toString()); const QString res = API::deleteEffect(message["name"].toString());
res.isEmpty() ? sendSuccessReply(command, tan) : sendErrorReply(res, command, tan); res.isEmpty() ? sendSuccessReply(command, tan) : sendErrorReply(res, command, tan);
} }
void JsonAPI::handleSysInfoCommand(const QJsonObject &, const QString &command, const int tan) void JsonAPI::handleSysInfoCommand(const QJsonObject &, const QString &command, int tan)
{ {
// create result // create result
QJsonObject result; QJsonObject result;
@ -319,7 +319,7 @@ void JsonAPI::handleSysInfoCommand(const QJsonObject &, const QString &command,
emit callbackMessage(result); emit callbackMessage(result);
} }
void JsonAPI::handleServerInfoCommand(const QJsonObject &message, const QString &command, const int tan) void JsonAPI::handleServerInfoCommand(const QJsonObject &message, const QString &command, int tan)
{ {
QJsonObject info; QJsonObject info;
@ -714,7 +714,7 @@ void JsonAPI::handleServerInfoCommand(const QJsonObject &message, const QString
} }
} }
void JsonAPI::handleClearCommand(const QJsonObject &message, const QString &command, const int tan) void JsonAPI::handleClearCommand(const QJsonObject &message, const QString &command, int tan)
{ {
emit forwardJsonMessage(message); emit forwardJsonMessage(message);
int priority = message["priority"].toInt(); int priority = message["priority"].toInt();
@ -728,7 +728,7 @@ void JsonAPI::handleClearCommand(const QJsonObject &message, const QString &comm
sendSuccessReply(command, tan); sendSuccessReply(command, tan);
} }
void JsonAPI::handleClearallCommand(const QJsonObject &message, const QString &command, const int tan) void JsonAPI::handleClearallCommand(const QJsonObject &message, const QString &command, int tan)
{ {
emit forwardJsonMessage(message); emit forwardJsonMessage(message);
QString replyMsg; QString replyMsg;
@ -736,7 +736,7 @@ void JsonAPI::handleClearallCommand(const QJsonObject &message, const QString &c
sendSuccessReply(command, tan); sendSuccessReply(command, tan);
} }
void JsonAPI::handleAdjustmentCommand(const QJsonObject &message, const QString &command, const int tan) void JsonAPI::handleAdjustmentCommand(const QJsonObject &message, const QString &command, int tan)
{ {
const QJsonObject &adjustment = message["adjustment"].toObject(); const QJsonObject &adjustment = message["adjustment"].toObject();
@ -822,7 +822,7 @@ void JsonAPI::handleAdjustmentCommand(const QJsonObject &message, const QString
sendSuccessReply(command, tan); sendSuccessReply(command, tan);
} }
void JsonAPI::handleSourceSelectCommand(const QJsonObject &message, const QString &command, const int tan) void JsonAPI::handleSourceSelectCommand(const QJsonObject &message, const QString &command, int tan)
{ {
if (message.contains("auto")) if (message.contains("auto"))
{ {
@ -840,7 +840,7 @@ void JsonAPI::handleSourceSelectCommand(const QJsonObject &message, const QStrin
sendSuccessReply(command, tan); sendSuccessReply(command, tan);
} }
void JsonAPI::handleConfigCommand(const QJsonObject &message, const QString &command, const int tan) void JsonAPI::handleConfigCommand(const QJsonObject &message, const QString &command, int tan)
{ {
QString subcommand = message["subcommand"].toString(""); QString subcommand = message["subcommand"].toString("");
QString full_command = command + "-" + subcommand; QString full_command = command + "-" + subcommand;
@ -884,7 +884,7 @@ void JsonAPI::handleConfigCommand(const QJsonObject &message, const QString &com
} }
} }
void JsonAPI::handleConfigSetCommand(const QJsonObject &message, const QString &command, const int tan) void JsonAPI::handleConfigSetCommand(const QJsonObject &message, const QString &command, int tan)
{ {
if (message.contains("config")) if (message.contains("config"))
{ {
@ -899,7 +899,7 @@ void JsonAPI::handleConfigSetCommand(const QJsonObject &message, const QString &
} }
} }
void JsonAPI::handleSchemaGetCommand(const QJsonObject &message, const QString &command, const int tan) void JsonAPI::handleSchemaGetCommand(const QJsonObject &message, const QString &command, int tan)
{ {
// create result // create result
QJsonObject schemaJson, alldevices, properties; QJsonObject schemaJson, alldevices, properties;
@ -962,7 +962,7 @@ void JsonAPI::handleSchemaGetCommand(const QJsonObject &message, const QString &
sendSuccessDataReply(QJsonDocument(schemaJson), command, tan); sendSuccessDataReply(QJsonDocument(schemaJson), command, tan);
} }
void JsonAPI::handleComponentStateCommand(const QJsonObject &message, const QString &command, const int tan) void JsonAPI::handleComponentStateCommand(const QJsonObject &message, const QString &command, int tan)
{ {
const QJsonObject &componentState = message["componentstate"].toObject(); const QJsonObject &componentState = message["componentstate"].toObject();
QString comp = componentState["component"].toString("invalid"); QString comp = componentState["component"].toString("invalid");
@ -977,7 +977,7 @@ void JsonAPI::handleComponentStateCommand(const QJsonObject &message, const QStr
sendSuccessReply(command, tan); sendSuccessReply(command, tan);
} }
void JsonAPI::handleLedColorsCommand(const QJsonObject &message, const QString &command, const int tan) void JsonAPI::handleLedColorsCommand(const QJsonObject &message, const QString &command, int tan)
{ {
// create result // create result
QString subcommand = message["subcommand"].toString(""); QString subcommand = message["subcommand"].toString("");
@ -1036,7 +1036,7 @@ void JsonAPI::handleLedColorsCommand(const QJsonObject &message, const QString &
sendSuccessReply(command + "-" + subcommand, tan); sendSuccessReply(command + "-" + subcommand, tan);
} }
void JsonAPI::handleLoggingCommand(const QJsonObject &message, const QString &command, const int tan) void JsonAPI::handleLoggingCommand(const QJsonObject &message, const QString &command, int tan)
{ {
// create result // create result
QString subcommand = message["subcommand"].toString(""); QString subcommand = message["subcommand"].toString("");
@ -1078,19 +1078,19 @@ void JsonAPI::handleLoggingCommand(const QJsonObject &message, const QString &co
} }
} }
void JsonAPI::handleProcessingCommand(const QJsonObject &message, const QString &command, const int tan) void JsonAPI::handleProcessingCommand(const QJsonObject &message, const QString &command, int tan)
{ {
API::setLedMappingType(ImageProcessor::mappingTypeToInt(message["mappingType"].toString("multicolor_mean"))); API::setLedMappingType(ImageProcessor::mappingTypeToInt(message["mappingType"].toString("multicolor_mean")));
sendSuccessReply(command, tan); sendSuccessReply(command, tan);
} }
void JsonAPI::handleVideoModeCommand(const QJsonObject &message, const QString &command, const int tan) void JsonAPI::handleVideoModeCommand(const QJsonObject &message, const QString &command, int tan)
{ {
API::setVideoMode(parse3DMode(message["videoMode"].toString("2D"))); API::setVideoMode(parse3DMode(message["videoMode"].toString("2D")));
sendSuccessReply(command, tan); sendSuccessReply(command, tan);
} }
void JsonAPI::handleAuthorizeCommand(const QJsonObject &message, const QString &command, const int tan) void JsonAPI::handleAuthorizeCommand(const QJsonObject &message, const QString &command, int tan)
{ {
const QString &subc = message["subcommand"].toString().trimmed(); const QString &subc = message["subcommand"].toString().trimmed();
const QString &id = message["id"].toString().trimmed(); const QString &id = message["id"].toString().trimmed();
@ -1326,7 +1326,7 @@ void JsonAPI::handleAuthorizeCommand(const QJsonObject &message, const QString &
} }
} }
void JsonAPI::handleInstanceCommand(const QJsonObject &message, const QString &command, const int tan) void JsonAPI::handleInstanceCommand(const QJsonObject &message, const QString &command, int tan)
{ {
const QString &subc = message["subcommand"].toString(); const QString &subc = message["subcommand"].toString();
const quint8 &inst = message["instance"].toInt(); const quint8 &inst = message["instance"].toInt();
@ -1396,7 +1396,7 @@ void JsonAPI::handleInstanceCommand(const QJsonObject &message, const QString &c
} }
} }
void JsonAPI::handleLedDeviceCommand(const QJsonObject &message, const QString &command, const int tan) void JsonAPI::handleLedDeviceCommand(const QJsonObject &message, const QString &command, int tan)
{ {
Debug(_log, "message: [%s]", QString(QJsonDocument(message).toJson(QJsonDocument::Compact)).toUtf8().constData() ); Debug(_log, "message: [%s]", QString(QJsonDocument(message).toJson(QJsonDocument::Compact)).toUtf8().constData() );
@ -1457,7 +1457,7 @@ void JsonAPI::handleNotImplemented()
sendErrorReply("Command not implemented"); sendErrorReply("Command not implemented");
} }
void JsonAPI::sendSuccessReply(const QString &command, const int tan) void JsonAPI::sendSuccessReply(const QString &command, int tan)
{ {
// create reply // create reply
QJsonObject reply; QJsonObject reply;
@ -1469,7 +1469,7 @@ void JsonAPI::sendSuccessReply(const QString &command, const int tan)
emit callbackMessage(reply); emit callbackMessage(reply);
} }
void JsonAPI::sendSuccessDataReply(const QJsonDocument &doc, const QString &command, const int &tan) void JsonAPI::sendSuccessDataReply(const QJsonDocument &doc, const QString &command, int tan)
{ {
QJsonObject reply; QJsonObject reply;
reply["success"] = true; reply["success"] = true;
@ -1483,7 +1483,7 @@ void JsonAPI::sendSuccessDataReply(const QJsonDocument &doc, const QString &comm
emit callbackMessage(reply); emit callbackMessage(reply);
} }
void JsonAPI::sendErrorReply(const QString &error, const QString &command, const int tan) void JsonAPI::sendErrorReply(const QString &error, const QString &command, int tan)
{ {
// create reply // create reply
QJsonObject reply; QJsonObject reply;
@ -1581,7 +1581,7 @@ void JsonAPI::newPendingTokenRequest(const QString &id, const QString &comment)
sendSuccessDataReply(QJsonDocument(obj), "authorize-tokenRequest", 1); sendSuccessDataReply(QJsonDocument(obj), "authorize-tokenRequest", 1);
} }
void JsonAPI::handleTokenResponse(const bool &success, const QString &token, const QString &comment, const QString &id) void JsonAPI::handleTokenResponse(bool success, const QString &token, const QString &comment, const QString &id)
{ {
const QString cmd = "authorize-requestToken"; const QString cmd = "authorize-requestToken";
QJsonObject result; QJsonObject result;
@ -1595,7 +1595,7 @@ void JsonAPI::handleTokenResponse(const bool &success, const QString &token, con
sendErrorReply("Token request timeout or denied", cmd, 5); sendErrorReply("Token request timeout or denied", cmd, 5);
} }
void JsonAPI::handleInstanceStateChange(const InstanceState &state, const quint8 &instance, const QString &name) void JsonAPI::handleInstanceStateChange(InstanceState state, quint8 instance, const QString &name)
{ {
switch (state) switch (state)
{ {
@ -1610,7 +1610,7 @@ void JsonAPI::handleInstanceStateChange(const InstanceState &state, const quint8
} }
} }
void JsonAPI::stopDataConnections(void) void JsonAPI::stopDataConnections()
{ {
LoggerManager::getInstance()->disconnect(); LoggerManager::getInstance()->disconnect();
_streaming_logging_activated = false; _streaming_logging_activated = false;

View File

@ -42,7 +42,7 @@ JsonCB::JsonCB(QObject* parent)
<< "adjustment-update" << "videomode-update" << "effects-update" << "settings-update" << "leds-update" << "instance-update" << "token-update"; << "adjustment-update" << "videomode-update" << "effects-update" << "settings-update" << "leds-update" << "instance-update" << "token-update";
} }
bool JsonCB::subscribeFor(const QString& type, const bool & unsubscribe) bool JsonCB::subscribeFor(const QString& type, bool unsubscribe)
{ {
if(!_availableCommands.contains(type)) if(!_availableCommands.contains(type))
return false; return false;
@ -189,7 +189,7 @@ void JsonCB::doCallback(const QString& cmd, const QVariant& data)
emit newCallback(obj); emit newCallback(obj);
} }
void JsonCB::handleComponentState(const hyperion::Components comp, const bool state) void JsonCB::handleComponentState(hyperion::Components comp, bool state)
{ {
QJsonObject data; QJsonObject data;
data["name"] = componentToIdString(comp); data["name"] = componentToIdString(comp);
@ -279,7 +279,7 @@ void JsonCB::handlePriorityUpdate()
doCallback("priorities-update", QVariant(data)); doCallback("priorities-update", QVariant(data));
} }
void JsonCB::handleImageToLedsMappingChange(const int& mappingType) void JsonCB::handleImageToLedsMappingChange(int mappingType)
{ {
QJsonObject data; QJsonObject data;
data["imageToLedMappingType"] = ImageProcessor::mappingTypeToStr(mappingType); data["imageToLedMappingType"] = ImageProcessor::mappingTypeToStr(mappingType);
@ -357,7 +357,7 @@ void JsonCB::handleAdjustmentChange()
doCallback("adjustment-update", QVariant(adjustmentArray)); doCallback("adjustment-update", QVariant(adjustmentArray));
} }
void JsonCB::handleVideoModeChange(const VideoMode& mode) void JsonCB::handleVideoModeChange(VideoMode mode)
{ {
QJsonObject data; QJsonObject data;
data["videomode"] = QString(videoMode2String(mode)); data["videomode"] = QString(videoMode2String(mode));
@ -382,7 +382,7 @@ void JsonCB::handleEffectListChange()
doCallback("effects-update", QVariant(effects)); doCallback("effects-update", QVariant(effects));
} }
void JsonCB::handleSettingsChange(const settings::type& type, const QJsonDocument& data) void JsonCB::handleSettingsChange(settings::type type, const QJsonDocument& data)
{ {
QJsonObject dat; QJsonObject dat;
if(data.isObject()) if(data.isObject())
@ -393,7 +393,7 @@ void JsonCB::handleSettingsChange(const settings::type& type, const QJsonDocumen
doCallback("settings-update", QVariant(dat)); doCallback("settings-update", QVariant(dat));
} }
void JsonCB::handleLedsConfigChange(const settings::type& type, const QJsonDocument& data) void JsonCB::handleLedsConfigChange(settings::type type, const QJsonDocument& data)
{ {
if(type == settings::LEDS) if(type == settings::LEDS)
{ {

View File

@ -40,7 +40,7 @@ BlackBorderProcessor::~BlackBorderProcessor()
delete _detector; delete _detector;
} }
void BlackBorderProcessor::handleSettingsUpdate(const settings::type& type, const QJsonDocument& config) void BlackBorderProcessor::handleSettingsUpdate(settings::type type, const QJsonDocument& config)
{ {
if(type == settings::BLACKBORDER) if(type == settings::BLACKBORDER)
{ {
@ -69,7 +69,7 @@ void BlackBorderProcessor::handleSettingsUpdate(const settings::type& type, cons
} }
} }
void BlackBorderProcessor::handleCompStateChangeRequest(const hyperion::Components component, bool enable) void BlackBorderProcessor::handleCompStateChangeRequest(hyperion::Components component, bool enable)
{ {
if(component == hyperion::COMP_BLACKBORDER) if(component == hyperion::COMP_BLACKBORDER)
{ {
@ -89,7 +89,7 @@ void BlackBorderProcessor::handleCompStateChangeRequest(const hyperion::Componen
} }
} }
void BlackBorderProcessor::setHardDisable(const bool& disable) { void BlackBorderProcessor::setHardDisable(bool disable) {
if (disable) if (disable)
{ {

View File

@ -23,7 +23,7 @@
// project includes // project includes
#include "BoblightClientConnection.h" #include "BoblightClientConnection.h"
BoblightClientConnection::BoblightClientConnection(Hyperion* hyperion, QTcpSocket *socket, const int priority) BoblightClientConnection::BoblightClientConnection(Hyperion* hyperion, QTcpSocket *socket, int priority)
: QObject() : QObject()
, _locale(QLocale::C) , _locale(QLocale::C)
, _socket(socket) , _socket(socket)

View File

@ -25,7 +25,7 @@ public:
/// @param socket The Socket object for this connection /// @param socket The Socket object for this connection
/// @param hyperion The Hyperion server /// @param hyperion The Hyperion server
/// ///
BoblightClientConnection(Hyperion* hyperion, QTcpSocket * socket, const int priority); BoblightClientConnection(Hyperion* hyperion, QTcpSocket * socket, int priority);
/// ///
/// Destructor /// Destructor

View File

@ -72,7 +72,7 @@ bool BoblightServer::active()
return _server->isListening(); return _server->isListening();
} }
void BoblightServer::compStateChangeRequest(const hyperion::Components component, bool enable) void BoblightServer::compStateChangeRequest(hyperion::Components component, bool enable)
{ {
if (component == COMP_BOBLIGHTSERVER) if (component == COMP_BOBLIGHTSERVER)
{ {
@ -114,7 +114,7 @@ void BoblightServer::closedConnection(BoblightClientConnection *connection)
connection->deleteLater(); connection->deleteLater();
} }
void BoblightServer::handleSettingsUpdate(const settings::type& type, const QJsonDocument& config) void BoblightServer::handleSettingsUpdate(settings::type type, const QJsonDocument& config)
{ {
if(type == settings::BOBLSERVER) if(type == settings::BOBLSERVER)
{ {

View File

@ -51,7 +51,7 @@ BonjourServiceRegister::~BonjourServiceRegister()
} }
} }
void BonjourServiceRegister::registerService(const QString& service, const int& port) void BonjourServiceRegister::registerService(const QString& service, int port)
{ {
_port = port; _port = port;
// zeroconf $configname@$hostname:port // zeroconf $configname@$hostname:port

View File

@ -48,7 +48,7 @@ EffectFileHandler::EffectFileHandler(const QString& rootPath, const QJsonDocumen
handleSettingsUpdate(settings::EFFECTS, effectConfig); handleSettingsUpdate(settings::EFFECTS, effectConfig);
} }
void EffectFileHandler::handleSettingsUpdate(const settings::type& type, const QJsonDocument& config) void EffectFileHandler::handleSettingsUpdate(settings::type type, const QJsonDocument& config)
{ {
if(type == settings::EFFECTS) if(type == settings::EFFECTS)
{ {

View File

@ -6,7 +6,7 @@
#include <QTimer> #include <QTimer>
#include <QRgb> #include <QRgb>
FlatBufferClient::FlatBufferClient(QTcpSocket* socket, const int &timeout, QObject *parent) FlatBufferClient::FlatBufferClient(QTcpSocket* socket, int timeout, QObject *parent)
: QObject(parent) : QObject(parent)
, _log(Logger::getInstance("FLATBUFSERVER")) , _log(Logger::getInstance("FLATBUFSERVER"))
, _socket(socket) , _socket(socket)
@ -104,7 +104,7 @@ void FlatBufferClient::handleColorCommand(const hyperionnet::Color *colorReq)
sendSuccessReply(); sendSuccessReply();
} }
void FlatBufferClient::registationRequired(const int priority) void FlatBufferClient::registationRequired(int priority)
{ {
if (_priority == priority) if (_priority == priority)
{ {

View File

@ -30,28 +30,28 @@ public:
/// @param timeout The timeout when a client is automatically disconnected and the priority unregistered /// @param timeout The timeout when a client is automatically disconnected and the priority unregistered
/// @param parent The parent /// @param parent The parent
/// ///
explicit FlatBufferClient(QTcpSocket* socket, const int &timeout, QObject *parent = nullptr); explicit FlatBufferClient(QTcpSocket* socket, int timeout, QObject *parent = nullptr);
signals: signals:
/// ///
/// @brief forward register data to HyperionDaemon /// @brief forward register data to HyperionDaemon
/// ///
void registerGlobalInput(const int priority, const hyperion::Components& component, const QString& origin = "FlatBuffer", const QString& owner = "", unsigned smooth_cfg = 0); void registerGlobalInput(int priority, hyperion::Components component, const QString& origin = "FlatBuffer", const QString& owner = "", unsigned smooth_cfg = 0);
/// ///
/// @brief Forward clear command to HyperionDaemon /// @brief Forward clear command to HyperionDaemon
/// ///
void clearGlobalInput(const int priority, bool forceClearAll=false); void clearGlobalInput(int priority, bool forceClearAll=false);
/// ///
/// @brief forward prepared image to HyperionDaemon /// @brief forward prepared image to HyperionDaemon
/// ///
const bool setGlobalInputImage(const int priority, const Image<ColorRgb>& image, const int timeout_ms, const bool& clearEffect = false); bool setGlobalInputImage(int priority, const Image<ColorRgb>& image, int timeout_ms, bool clearEffect = false);
/// ///
/// @brief Forward requested color /// @brief Forward requested color
/// ///
void setGlobalInputColor(const int priority, const std::vector<ColorRgb> &ledColor, const int timeout_ms, const QString& origin = "FlatBuffer" ,bool clearEffects = true); void setGlobalInputColor(int priority, const std::vector<ColorRgb> &ledColor, int timeout_ms, const QString& origin = "FlatBuffer" ,bool clearEffects = true);
/// ///
/// @brief Emits whenever the client disconnected /// @brief Emits whenever the client disconnected
@ -62,7 +62,7 @@ public slots:
/// ///
/// @brief Requests a registration from the client /// @brief Requests a registration from the client
/// ///
void registationRequired(const int priority); void registationRequired(int priority);
/// ///
/// @brief close the socket and call disconnected() /// @brief close the socket and call disconnected()

View File

@ -11,7 +11,7 @@
#include "hyperion_reply_generated.h" #include "hyperion_reply_generated.h"
#include "hyperion_request_generated.h" #include "hyperion_request_generated.h"
FlatBufferConnection::FlatBufferConnection(const QString& origin, const QString & address, const int& priority, const bool& skipReply) FlatBufferConnection::FlatBufferConnection(const QString& origin, const QString & address, int priority, bool skipReply)
: _socket() : _socket()
, _origin(origin) , _origin(origin)
, _priority(priority) , _priority(priority)
@ -85,7 +85,7 @@ void FlatBufferConnection::readData()
} }
} }
void FlatBufferConnection::setSkipReply(const bool& skip) void FlatBufferConnection::setSkipReply(bool skip)
{ {
if(skip) if(skip)
disconnect(&_socket, &QTcpSocket::readyRead, 0, 0); disconnect(&_socket, &QTcpSocket::readyRead, 0, 0);

View File

@ -35,7 +35,7 @@ void FlatBufferServer::initServer()
handleSettingsUpdate(settings::FLATBUFSERVER, _config); handleSettingsUpdate(settings::FLATBUFSERVER, _config);
} }
void FlatBufferServer::handleSettingsUpdate(const settings::type& type, const QJsonDocument& config) void FlatBufferServer::handleSettingsUpdate(settings::type type, const QJsonDocument& config)
{ {
if(type == settings::FLATBUFSERVER) if(type == settings::FLATBUFSERVER)
{ {

View File

@ -20,7 +20,7 @@
#define VIDEO_DEVICE "/dev/amvideo" #define VIDEO_DEVICE "/dev/amvideo"
#define CAPTURE_DEVICE "/dev/amvideocap0" #define CAPTURE_DEVICE "/dev/amvideocap0"
AmlogicGrabber::AmlogicGrabber(const unsigned width, const unsigned height) AmlogicGrabber::AmlogicGrabber(unsigned width, unsigned height)
: Grabber("AMLOGICGRABBER", qMax(160u, width), qMax(160u, height)) // Minimum required width or height is 160 : Grabber("AMLOGICGRABBER", qMax(160u, width), qMax(160u, height)) // Minimum required width or height is 160
, _captureDev(-1) , _captureDev(-1)
, _videoDev(-1) , _videoDev(-1)

View File

@ -1,6 +1,6 @@
#include <grabber/AmlogicWrapper.h> #include <grabber/AmlogicWrapper.h>
AmlogicWrapper::AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight) AmlogicWrapper::AmlogicWrapper(unsigned grabWidth, unsigned grabHeight)
: GrabberWrapper("AmLogic", &_grabber, grabWidth, grabHeight) : GrabberWrapper("AmLogic", &_grabber, grabWidth, grabHeight)
, _grabber(grabWidth, grabHeight) , _grabber(grabWidth, grabHeight)
{} {}

View File

@ -6,7 +6,7 @@
// Local includes // Local includes
#include "grabber/DispmanxFrameGrabber.h" #include "grabber/DispmanxFrameGrabber.h"
DispmanxFrameGrabber::DispmanxFrameGrabber(const unsigned width, const unsigned height) DispmanxFrameGrabber::DispmanxFrameGrabber(unsigned width, unsigned height)
: Grabber("DISPMANXGRABBER", 0, 0) : Grabber("DISPMANXGRABBER", 0, 0)
, _vc_display(0) , _vc_display(0)
, _vc_resource(0) , _vc_resource(0)
@ -84,7 +84,7 @@ bool DispmanxFrameGrabber::setWidthHeight(int width, int height)
return false; return false;
} }
void DispmanxFrameGrabber::setFlags(const int vc_flags) void DispmanxFrameGrabber::setFlags(int vc_flags)
{ {
_vc_flags = vc_flags; _vc_flags = vc_flags;
} }

View File

@ -1,6 +1,6 @@
#include <grabber/DispmanxWrapper.h> #include <grabber/DispmanxWrapper.h>
DispmanxWrapper::DispmanxWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz) DispmanxWrapper::DispmanxWrapper(unsigned grabWidth, unsigned grabHeight, unsigned updateRate_Hz)
: GrabberWrapper("Dispmanx", &_grabber, grabWidth, grabHeight, updateRate_Hz) : GrabberWrapper("Dispmanx", &_grabber, grabWidth, grabHeight, updateRate_Hz)
, _grabber(grabWidth, grabHeight) , _grabber(grabWidth, grabHeight)
{ {

View File

@ -13,7 +13,7 @@
// Local includes // Local includes
#include <grabber/FramebufferFrameGrabber.h> #include <grabber/FramebufferFrameGrabber.h>
FramebufferFrameGrabber::FramebufferFrameGrabber(const QString & device, const unsigned width, const unsigned height) FramebufferFrameGrabber::FramebufferFrameGrabber(const QString & device, unsigned width, unsigned height)
: Grabber("FRAMEBUFFERGRABBER", width, height) : Grabber("FRAMEBUFFERGRABBER", width, height)
, _fbDevice() , _fbDevice()
{ {

View File

@ -1,6 +1,6 @@
#include <grabber/FramebufferWrapper.h> #include <grabber/FramebufferWrapper.h>
FramebufferWrapper::FramebufferWrapper(const QString & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz) FramebufferWrapper::FramebufferWrapper(const QString & device, unsigned grabWidth, unsigned grabHeight, unsigned updateRate_Hz)
: GrabberWrapper("FrameBuffer", &_grabber, grabWidth, grabHeight, updateRate_Hz) : GrabberWrapper("FrameBuffer", &_grabber, grabWidth, grabHeight, updateRate_Hz)
, _grabber(device, grabWidth, grabHeight) , _grabber(device, grabWidth, grabHeight)
{} {}

View File

@ -5,7 +5,7 @@
// Local includes // Local includes
#include <grabber/OsxFrameGrabber.h> #include <grabber/OsxFrameGrabber.h>
OsxFrameGrabber::OsxFrameGrabber(const unsigned display, const unsigned width, const unsigned height) OsxFrameGrabber::OsxFrameGrabber(unsigned display, unsigned width, unsigned height)
: Grabber("OSXGRABBER", width, height) : Grabber("OSXGRABBER", width, height)
, _screenIndex(100) , _screenIndex(100)
{ {

View File

@ -1,6 +1,6 @@
#include <grabber/OsxWrapper.h> #include <grabber/OsxWrapper.h>
OsxWrapper::OsxWrapper(const unsigned display, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz) OsxWrapper::OsxWrapper(unsigned display, unsigned grabWidth, unsigned grabHeight, unsigned updateRate_Hz)
: GrabberWrapper("OSX FrameGrabber", &_grabber, grabWidth, grabHeight, updateRate_Hz) : GrabberWrapper("OSX FrameGrabber", &_grabber, grabWidth, grabHeight, updateRate_Hz)
, _grabber(display, grabWidth, grabHeight) , _grabber(display, grabWidth, grabHeight)
{} {}

View File

@ -116,7 +116,7 @@ int QtGrabber::grabFrame(Image<ColorRgb> & image)
return 0; return 0;
} }
int QtGrabber::updateScreenDimensions(const bool& force) int QtGrabber::updateScreenDimensions(bool force)
{ {
if(!_screen) if(!_screen)
return -1; return -1;

View File

@ -1,6 +1,6 @@
#include <grabber/QtWrapper.h> #include <grabber/QtWrapper.h>
QtWrapper::QtWrapper(int cropLeft, int cropRight, int cropTop, int cropBottom, int pixelDecimation, int display, const unsigned updateRate_Hz) QtWrapper::QtWrapper(int cropLeft, int cropRight, int cropTop, int cropBottom, int pixelDecimation, int display, unsigned updateRate_Hz)
: GrabberWrapper("Qt", &_grabber, 0, 0, updateRate_Hz) : GrabberWrapper("Qt", &_grabber, 0, 0, updateRate_Hz)
, _grabber(cropLeft, cropRight, cropTop, cropBottom, pixelDecimation, display) , _grabber(cropLeft, cropRight, cropTop, cropBottom, pixelDecimation, display)
{} {}

View File

@ -110,7 +110,7 @@ void V4L2Wrapper::handleCecEvent(CECEvent event)
_grabber.handleCecEvent(event); _grabber.handleCecEvent(event);
} }
void V4L2Wrapper::handleSettingsUpdate(const settings::type& type, const QJsonDocument& config) void V4L2Wrapper::handleSettingsUpdate(settings::type type, const QJsonDocument& config)
{ {
if(type == settings::V4L2 && _grabberName.startsWith("V4L")) if(type == settings::V4L2 && _grabberName.startsWith("V4L"))
{ {

View File

@ -1,6 +1,6 @@
#include <grabber/X11Wrapper.h> #include <grabber/X11Wrapper.h>
X11Wrapper::X11Wrapper(int cropLeft, int cropRight, int cropTop, int cropBottom, int pixelDecimation, const unsigned updateRate_Hz) X11Wrapper::X11Wrapper(int cropLeft, int cropRight, int cropTop, int cropBottom, int pixelDecimation, unsigned updateRate_Hz)
: GrabberWrapper("X11", &_grabber, 0, 0, updateRate_Hz) : GrabberWrapper("X11", &_grabber, 0, 0, updateRate_Hz)
, _grabber(cropLeft, cropRight, cropTop, cropBottom, pixelDecimation) , _grabber(cropLeft, cropRight, cropTop, cropBottom, pixelDecimation)
, _init(false) , _init(false)

View File

@ -85,7 +85,7 @@ const QString AuthManager::getUserToken(const QString &usr)
return QString(_authTable->getUserToken(usr)); return QString(_authTable->getUserToken(usr));
} }
void AuthManager::setAuthBlock(const bool &user) void AuthManager::setAuthBlock(bool user)
{ {
// current timestamp +10 minutes // current timestamp +10 minutes
if (user) if (user)
@ -172,7 +172,7 @@ void AuthManager::cancelNewTokenRequest(QObject *caller, const QString &comment,
} }
} }
void AuthManager::handlePendingTokenRequest(const QString &id, const bool &accept) void AuthManager::handlePendingTokenRequest(const QString &id, bool accept)
{ {
if (_pendingRequests.contains(id)) if (_pendingRequests.contains(id))
{ {
@ -226,7 +226,7 @@ bool AuthManager::deleteToken(const QString &id)
return false; return false;
} }
void AuthManager::handleSettingsUpdate(const settings::type &type, const QJsonDocument &config) void AuthManager::handleSettingsUpdate(settings::type type, const QJsonDocument &config)
{ {
if (type == settings::NETWORK) if (type == settings::NETWORK)
{ {

View File

@ -63,7 +63,7 @@ void CaptureCont::handleSystemImage(const QString& name, const Image<ColorRgb>&
_hyperion->setInputImage(_systemCaptPrio, image); _hyperion->setInputImage(_systemCaptPrio, image);
} }
void CaptureCont::setSystemCaptureEnable(const bool& enable) void CaptureCont::setSystemCaptureEnable(bool enable)
{ {
if(_systemCaptEnabled != enable) if(_systemCaptEnabled != enable)
{ {
@ -86,7 +86,7 @@ void CaptureCont::setSystemCaptureEnable(const bool& enable)
} }
} }
void CaptureCont::setV4LCaptureEnable(const bool& enable) void CaptureCont::setV4LCaptureEnable(bool enable)
{ {
if(_v4lCaptEnabled != enable) if(_v4lCaptEnabled != enable)
{ {
@ -109,7 +109,7 @@ void CaptureCont::setV4LCaptureEnable(const bool& enable)
} }
} }
void CaptureCont::handleSettingsUpdate(const settings::type& type, const QJsonDocument& config) void CaptureCont::handleSettingsUpdate(settings::type type, const QJsonDocument& config)
{ {
if(type == settings::INSTCAPTURE) if(type == settings::INSTCAPTURE)
{ {
@ -130,7 +130,7 @@ void CaptureCont::handleSettingsUpdate(const settings::type& type, const QJsonDo
} }
} }
void CaptureCont::handleCompStateChangeRequest(const hyperion::Components component, bool enable) void CaptureCont::handleCompStateChangeRequest(hyperion::Components component, bool enable)
{ {
if(component == hyperion::COMP_GRABBER) if(component == hyperion::COMP_GRABBER)
{ {

View File

@ -24,12 +24,12 @@ ComponentRegister::~ComponentRegister()
{ {
} }
int ComponentRegister::isComponentEnabled(const hyperion::Components& comp) const int ComponentRegister::isComponentEnabled(hyperion::Components comp) const
{ {
return (_componentStates.count(comp)) ? _componentStates.at(comp) : -1; return (_componentStates.count(comp)) ? _componentStates.at(comp) : -1;
} }
void ComponentRegister::setNewComponentState(const hyperion::Components comp, const bool activated) void ComponentRegister::setNewComponentState(hyperion::Components comp, bool activated)
{ {
if(_componentStates[comp] != activated) if(_componentStates[comp] != activated)
{ {
@ -40,7 +40,7 @@ void ComponentRegister::setNewComponentState(const hyperion::Components comp, co
} }
} }
void ComponentRegister::handleCompStateChangeRequest(const hyperion::Components comps, const bool activated) void ComponentRegister::handleCompStateChangeRequest(hyperion::Components comps, bool activated)
{ {
if(comps == COMP_ALL && !_inProgress) if(comps == COMP_ALL && !_inProgress)
{ {

View File

@ -11,7 +11,7 @@
GrabberWrapper* GrabberWrapper::instance = nullptr; GrabberWrapper* GrabberWrapper::instance = nullptr;
GrabberWrapper::GrabberWrapper(QString grabberName, Grabber * ggrabber, unsigned width, unsigned height, const unsigned updateRate_Hz) GrabberWrapper::GrabberWrapper(QString grabberName, Grabber * ggrabber, unsigned width, unsigned height, unsigned updateRate_Hz)
: _grabberName(grabberName) : _grabberName(grabberName)
, _timer(new QTimer(this)) , _timer(new QTimer(this))
, _updateInterval_ms(1000/updateRate_Hz) , _updateInterval_ms(1000/updateRate_Hz)
@ -104,7 +104,7 @@ QStringList GrabberWrapper::availableGrabbers()
return grabbers; return grabbers;
} }
void GrabberWrapper::setVideoMode(const VideoMode& mode) void GrabberWrapper::setVideoMode(VideoMode mode)
{ {
if (_ggrabber != nullptr) if (_ggrabber != nullptr)
{ {
@ -133,7 +133,7 @@ void GrabberWrapper::updateTimer(int interval)
} }
} }
void GrabberWrapper::handleSettingsUpdate(const settings::type& type, const QJsonDocument& config) void GrabberWrapper::handleSettingsUpdate(settings::type type, const QJsonDocument& config)
{ {
if(type == settings::SYSTEMCAPTURE && !_grabberName.startsWith("V4L")) if(type == settings::SYSTEMCAPTURE && !_grabberName.startsWith("V4L"))
{ {
@ -164,7 +164,7 @@ void GrabberWrapper::handleSettingsUpdate(const settings::type& type, const QJso
} }
} }
void GrabberWrapper::handleSourceRequest(const hyperion::Components& component, const int hyperionInd, const bool listen) void GrabberWrapper::handleSourceRequest(hyperion::Components component, int hyperionInd, bool listen)
{ {
if(component == hyperion::Components::COMP_GRABBER && !_grabberName.startsWith("V4L")) if(component == hyperion::Components::COMP_GRABBER && !_grabberName.startsWith("V4L"))
{ {

View File

@ -39,7 +39,7 @@
// Boblight // Boblight
#include <boblightserver/BoblightServer.h> #include <boblightserver/BoblightServer.h>
Hyperion::Hyperion(const quint8& instance) Hyperion::Hyperion(quint8 instance)
: QObject() : QObject()
, _instIndex(instance) , _instIndex(instance)
, _settingsManager(new SettingsManager(instance, this)) , _settingsManager(new SettingsManager(instance, this))
@ -166,7 +166,7 @@ void Hyperion::freeObjects()
delete _ledDeviceWrapper; delete _ledDeviceWrapper;
} }
void Hyperion::handleSettingsUpdate(const settings::type& type, const QJsonDocument& config) void Hyperion::handleSettingsUpdate(settings::type type, const QJsonDocument& config)
{ {
// std::cout << "Hyperion::handleSettingsUpdate" << std::endl; // std::cout << "Hyperion::handleSettingsUpdate" << std::endl;
// std::cout << config.toJson().toStdString() << std::endl; // std::cout << config.toJson().toStdString() << std::endl;
@ -250,12 +250,12 @@ void Hyperion::handleSettingsUpdate(const settings::type& type, const QJsonDocum
update(); update();
} }
QJsonDocument Hyperion::getSetting(const settings::type& type) const QJsonDocument Hyperion::getSetting(settings::type type) const
{ {
return _settingsManager->getSetting(type); return _settingsManager->getSetting(type);
} }
bool Hyperion::saveSettings(QJsonObject config, const bool& correct) bool Hyperion::saveSettings(QJsonObject config, bool correct)
{ {
return _settingsManager->saveSettings(config, correct); return _settingsManager->saveSettings(config, correct);
} }
@ -280,12 +280,12 @@ unsigned Hyperion::getLedCount() const
return _ledString.leds().size(); return _ledString.leds().size();
} }
void Hyperion::setSourceAutoSelect(const bool state) void Hyperion::setSourceAutoSelect(bool state)
{ {
_muxer.setSourceAutoSelectEnabled(state); _muxer.setSourceAutoSelectEnabled(state);
} }
bool Hyperion::setVisiblePriority(const int& priority) bool Hyperion::setVisiblePriority(int priority)
{ {
return _muxer.setPriority(priority); return _muxer.setPriority(priority);
} }
@ -295,7 +295,7 @@ bool Hyperion::sourceAutoSelectEnabled()
return _muxer.isSourceAutoSelectEnabled(); return _muxer.isSourceAutoSelectEnabled();
} }
void Hyperion::setNewComponentState(const hyperion::Components& component, const bool& state) void Hyperion::setNewComponentState(hyperion::Components component, bool state)
{ {
_componentRegister.setNewComponentState(component, state); _componentRegister.setNewComponentState(component, state);
} }
@ -305,17 +305,17 @@ std::map<hyperion::Components, bool> Hyperion::getAllComponents() const
return _componentRegister.getRegister(); return _componentRegister.getRegister();
} }
int Hyperion::isComponentEnabled(const hyperion::Components &comp) int Hyperion::isComponentEnabled(hyperion::Components comp)
{ {
return _componentRegister.isComponentEnabled(comp); return _componentRegister.isComponentEnabled(comp);
} }
void Hyperion::registerInput(const int priority, const hyperion::Components& component, const QString& origin, const QString& owner, unsigned smooth_cfg) void Hyperion::registerInput(int priority, hyperion::Components component, const QString& origin, const QString& owner, unsigned smooth_cfg)
{ {
_muxer.registerInput(priority, component, origin, owner, smooth_cfg); _muxer.registerInput(priority, component, origin, owner, smooth_cfg);
} }
bool Hyperion::setInput(const int priority, const std::vector<ColorRgb>& ledColors, int timeout_ms, const bool& clearEffect) bool Hyperion::setInput(int priority, const std::vector<ColorRgb>& ledColors, int timeout_ms, bool clearEffect)
{ {
if(_muxer.setInput(priority, ledColors, timeout_ms)) if(_muxer.setInput(priority, ledColors, timeout_ms))
{ {
@ -334,7 +334,7 @@ bool Hyperion::setInput(const int priority, const std::vector<ColorRgb>& ledColo
return false; return false;
} }
bool Hyperion::setInputImage(const int priority, const Image<ColorRgb>& image, int64_t timeout_ms, const bool& clearEffect) bool Hyperion::setInputImage(int priority, const Image<ColorRgb>& image, int64_t timeout_ms, bool clearEffect)
{ {
if (!_muxer.hasPriority(priority)) if (!_muxer.hasPriority(priority))
{ {
@ -359,12 +359,12 @@ bool Hyperion::setInputImage(const int priority, const Image<ColorRgb>& image, i
return false; return false;
} }
bool Hyperion::setInputInactive(const quint8& priority) bool Hyperion::setInputInactive(quint8 priority)
{ {
return _muxer.setInputInactive(priority); return _muxer.setInputInactive(priority);
} }
void Hyperion::setColor(const int priority, const std::vector<ColorRgb> &ledColors, const int timeout_ms, const QString &origin, bool clearEffects) void Hyperion::setColor(int priority, const std::vector<ColorRgb> &ledColors, int timeout_ms, const QString &origin, bool clearEffects)
{ {
// clear effect if this call does not come from an effect // clear effect if this call does not come from an effect
if (clearEffects) if (clearEffects)
@ -412,7 +412,7 @@ void Hyperion::adjustmentsUpdated()
update(); update();
} }
bool Hyperion::clear(const int priority, bool forceClearAll) bool Hyperion::clear(int priority, bool forceClearAll)
{ {
if (priority < 0) if (priority < 0)
{ {
@ -439,7 +439,7 @@ int Hyperion::getCurrentPriority() const
return _muxer.getCurrentPriority(); return _muxer.getCurrentPriority();
} }
bool Hyperion::isCurrentPriority(const int priority) const bool Hyperion::isCurrentPriority(int priority) const
{ {
return getCurrentPriority() == priority; return getCurrentPriority() == priority;
} }
@ -449,7 +449,7 @@ QList<int> Hyperion::getActivePriorities() const
return _muxer.getPriorities(); return _muxer.getPriorities();
} }
Hyperion::InputInfo Hyperion::getPriorityInfo(const int priority) const Hyperion::InputInfo Hyperion::getPriorityInfo(int priority) const
{ {
return _muxer.getInputInfo(priority); return _muxer.getInputInfo(priority);
} }
@ -494,7 +494,7 @@ int Hyperion::setEffect(const QString &effectName, const QJsonObject &args, int
return _effectEngine->runEffect(effectName, args, priority, timeout, pythonScript, origin, 0, imageData); return _effectEngine->runEffect(effectName, args, priority, timeout, pythonScript, origin, 0, imageData);
} }
void Hyperion::setLedMappingType(const int& mappingType) void Hyperion::setLedMappingType(int mappingType)
{ {
if(mappingType != _imageProcessor->getUserLedMappingType()) if(mappingType != _imageProcessor->getUserLedMappingType())
{ {
@ -508,7 +508,7 @@ int Hyperion::getLedMappingType() const
return _imageProcessor->getUserLedMappingType(); return _imageProcessor->getUserLedMappingType();
} }
void Hyperion::setVideoMode(const VideoMode& mode) void Hyperion::setVideoMode(VideoMode mode)
{ {
emit videoMode(mode); emit videoMode(mode);
} }
@ -523,7 +523,7 @@ QString Hyperion::getActiveDeviceType() const
return _ledDeviceWrapper->getActiveDeviceType(); return _ledDeviceWrapper->getActiveDeviceType();
} }
void Hyperion::handleVisibleComponentChanged(const hyperion::Components &comp) void Hyperion::handleVisibleComponentChanged(hyperion::Components comp)
{ {
_imageProcessor->setBlackbarDetectDisable((comp == hyperion::COMP_EFFECT)); _imageProcessor->setBlackbarDetectDisable((comp == hyperion::COMP_EFFECT));
_imageProcessor->setHardLedMappingType((comp == hyperion::COMP_EFFECT) ? 0 : -1); _imageProcessor->setHardLedMappingType((comp == hyperion::COMP_EFFECT) ? 0 : -1);

View File

@ -19,7 +19,7 @@ HyperionIManager::HyperionIManager(const QString& rootPath, QObject* parent)
qRegisterMetaType<InstanceState>("InstanceState"); qRegisterMetaType<InstanceState>("InstanceState");
} }
Hyperion* HyperionIManager::getHyperionInstance(const quint8& instance) Hyperion* HyperionIManager::getHyperionInstance(quint8 instance)
{ {
if(_runningInstances.contains(instance)) if(_runningInstances.contains(instance))
return _runningInstances.value(instance); return _runningInstances.value(instance);
@ -57,7 +57,7 @@ void HyperionIManager::stopAll()
} }
} }
void HyperionIManager::toggleStateAllInstances(const bool& pause) void HyperionIManager::toggleStateAllInstances(bool pause)
{ {
// copy the instances due to loop corruption, even with .erase() return next iter // copy the instances due to loop corruption, even with .erase() return next iter
QMap<quint8, Hyperion*> instCopy = _runningInstances; QMap<quint8, Hyperion*> instCopy = _runningInstances;
@ -67,7 +67,7 @@ void HyperionIManager::toggleStateAllInstances(const bool& pause)
} }
} }
bool HyperionIManager::startInstance(const quint8& inst, const bool& block) bool HyperionIManager::startInstance(quint8 inst, bool block)
{ {
if(_instanceTable->instanceExist(inst)) if(_instanceTable->instanceExist(inst))
{ {
@ -113,7 +113,7 @@ bool HyperionIManager::startInstance(const quint8& inst, const bool& block)
return false; return false;
} }
bool HyperionIManager::stopInstance(const quint8& inst) bool HyperionIManager::stopInstance(quint8 inst)
{ {
// inst 0 can't be stopped // inst 0 can't be stopped
if(!isInstAllowed(inst)) if(!isInstAllowed(inst))
@ -140,7 +140,7 @@ bool HyperionIManager::stopInstance(const quint8& inst)
return false; return false;
} }
bool HyperionIManager::createInstance(const QString& name, const bool& start) bool HyperionIManager::createInstance(const QString& name, bool start)
{ {
quint8 inst; quint8 inst;
if(_instanceTable->createInstance(name, inst)) if(_instanceTable->createInstance(name, inst))
@ -156,7 +156,7 @@ bool HyperionIManager::createInstance(const QString& name, const bool& start)
return false; return false;
} }
bool HyperionIManager::deleteInstance(const quint8& inst) bool HyperionIManager::deleteInstance(quint8 inst)
{ {
// inst 0 can't be deleted // inst 0 can't be deleted
if(!isInstAllowed(inst)) if(!isInstAllowed(inst))
@ -176,7 +176,7 @@ bool HyperionIManager::deleteInstance(const quint8& inst)
return false; return false;
} }
bool HyperionIManager::saveName(const quint8& inst, const QString& name) bool HyperionIManager::saveName(quint8 inst, const QString& name)
{ {
if(_instanceTable->saveName(inst, name)) if(_instanceTable->saveName(inst, name))
{ {
@ -189,7 +189,7 @@ bool HyperionIManager::saveName(const quint8& inst, const QString& name)
void HyperionIManager::handleFinished() void HyperionIManager::handleFinished()
{ {
Hyperion* hyperion = qobject_cast<Hyperion*>(sender()); Hyperion* hyperion = qobject_cast<Hyperion*>(sender());
const quint8 & instance = hyperion->getInstanceIndex(); quint8 instance = hyperion->getInstanceIndex();
Info(_log,"Hyperion instance '%s' has been stopped", QSTRING_CSTR(_instanceTable->getNamebyIndex(instance))); Info(_log,"Hyperion instance '%s' has been stopped", QSTRING_CSTR(_instanceTable->getNamebyIndex(instance)));
@ -203,7 +203,7 @@ void HyperionIManager::handleFinished()
void HyperionIManager::handleStarted() void HyperionIManager::handleStarted()
{ {
Hyperion* hyperion = qobject_cast<Hyperion*>(sender()); Hyperion* hyperion = qobject_cast<Hyperion*>(sender());
const quint8 & instance = hyperion->getInstanceIndex(); quint8 instance = hyperion->getInstanceIndex();
Info(_log,"Hyperion instance '%s' has been started", QSTRING_CSTR(_instanceTable->getNamebyIndex(instance))); Info(_log,"Hyperion instance '%s' has been started", QSTRING_CSTR(_instanceTable->getNamebyIndex(instance)));

View File

@ -48,7 +48,7 @@ ImageProcessor::~ImageProcessor()
delete _imageToLeds; delete _imageToLeds;
} }
void ImageProcessor::handleSettingsUpdate(const settings::type& type, const QJsonDocument& config) void ImageProcessor::handleSettingsUpdate(settings::type type, const QJsonDocument& config)
{ {
if(type == settings::COLOR) if(type == settings::COLOR)
{ {
@ -61,7 +61,7 @@ void ImageProcessor::handleSettingsUpdate(const settings::type& type, const QJso
} }
} }
void ImageProcessor::setSize(const unsigned width, const unsigned height) void ImageProcessor::setSize(unsigned width, unsigned height)
{ {
// Check if the existing buffer-image is already the correct dimensions // Check if the existing buffer-image is already the correct dimensions
if (_imageToLeds && _imageToLeds->width() == width && _imageToLeds->height() == height) if (_imageToLeds && _imageToLeds->width() == width && _imageToLeds->height() == height)

View File

@ -3,10 +3,10 @@
using namespace hyperion; using namespace hyperion;
ImageToLedsMap::ImageToLedsMap( ImageToLedsMap::ImageToLedsMap(
const unsigned width, unsigned width,
const unsigned height, unsigned height,
const unsigned horizontalBorder, unsigned horizontalBorder,
const unsigned verticalBorder, unsigned verticalBorder,
const std::vector<Led>& leds) const std::vector<Led>& leds)
: _width(width) : _width(width)
, _height(height) , _height(height)

View File

@ -43,7 +43,7 @@ LinearColorSmoothing::LinearColorSmoothing(const QJsonDocument& config, Hyperion
connect(_timer, &QTimer::timeout, this, &LinearColorSmoothing::updateLeds); connect(_timer, &QTimer::timeout, this, &LinearColorSmoothing::updateLeds);
} }
void LinearColorSmoothing::handleSettingsUpdate(const settings::type& type, const QJsonDocument& config) void LinearColorSmoothing::handleSettingsUpdate(settings::type type, const QJsonDocument& config)
{ {
if(type == settings::SMOOTHING) if(type == settings::SMOOTHING)
{ {
@ -198,7 +198,7 @@ void LinearColorSmoothing::clearQueuedColors()
_targetValues.clear(); _targetValues.clear();
} }
void LinearColorSmoothing::componentStateChange(const hyperion::Components component, const bool state) void LinearColorSmoothing::componentStateChange(hyperion::Components component, bool state)
{ {
_writeToLedsEnable = state; _writeToLedsEnable = state;
if(component == hyperion::COMP_LEDDEVICE) if(component == hyperion::COMP_LEDDEVICE)
@ -254,7 +254,7 @@ unsigned LinearColorSmoothing::updateConfig(unsigned cfgID, int settlingTime_ms,
return updatedCfgID; return updatedCfgID;
} }
bool LinearColorSmoothing::selectConfig(unsigned cfg, const bool& force) bool LinearColorSmoothing::selectConfig(unsigned cfg, bool force)
{ {
if (_currentConfigId == cfg && !force) if (_currentConfigId == cfg && !force)
{ {

View File

@ -74,7 +74,7 @@ public:
/// ///
/// @return On success return else false (and falls back to cfg 0) /// @return On success return else false (and falls back to cfg 0)
/// ///
bool selectConfig(unsigned cfg, const bool& force = false); bool selectConfig(unsigned cfg, bool force = false);
public slots: public slots:
/// ///
@ -82,7 +82,7 @@ public slots:
/// @param type settingyType from enum /// @param type settingyType from enum
/// @param config configuration object /// @param config configuration object
/// ///
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config); void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
private slots: private slots:
/// Timer callback which writes updated led values to the led device /// Timer callback which writes updated led values to the led device
@ -93,7 +93,7 @@ private slots:
/// @param component The component /// @param component The component
/// @param state The requested state /// @param state The requested state
/// ///
void componentStateChange(const hyperion::Components component, const bool state); void componentStateChange(hyperion::Components component, bool state);
private: private:

View File

@ -43,7 +43,7 @@ MessageForwarder::~MessageForwarder()
delete _forwardClients.takeFirst(); delete _forwardClients.takeFirst();
} }
void MessageForwarder::handleSettingsUpdate(const settings::type &type, const QJsonDocument &config) void MessageForwarder::handleSettingsUpdate(settings::type type, const QJsonDocument &config)
{ {
if(type == settings::NETFORWARD) if(type == settings::NETFORWARD)
{ {
@ -95,7 +95,7 @@ void MessageForwarder::handleSettingsUpdate(const settings::type &type, const QJ
} }
} }
void MessageForwarder::handleCompStateChangeRequest(const hyperion::Components component, bool enable) void MessageForwarder::handleCompStateChangeRequest(hyperion::Components component, bool enable)
{ {
if (component == hyperion::COMP_FORWARDER && _forwarder_enabled != enable) if (component == hyperion::COMP_FORWARDER && _forwarder_enabled != enable)
{ {
@ -106,7 +106,7 @@ void MessageForwarder::handleCompStateChangeRequest(const hyperion::Components c
} }
} }
void MessageForwarder::handlePriorityChanges(const quint8 &priority) void MessageForwarder::handlePriorityChanges(quint8 priority)
{ {
const QJsonObject obj = _hyperion->getSetting(settings::NETFORWARD).object(); const QJsonObject obj = _hyperion->getSetting(settings::NETFORWARD).object();
if (priority != 0 && _forwarder_enabled && obj["enable"].toBool()) if (priority != 0 && _forwarder_enabled && obj["enable"].toBool())

View File

@ -2,7 +2,7 @@
#include <utils/Logger.h> #include <utils/Logger.h>
#include <hyperion/MultiColorAdjustment.h> #include <hyperion/MultiColorAdjustment.h>
MultiColorAdjustment::MultiColorAdjustment(const unsigned ledCnt) MultiColorAdjustment::MultiColorAdjustment(unsigned ledCnt)
: _ledAdjustments(ledCnt, nullptr) : _ledAdjustments(ledCnt, nullptr)
, _log(Logger::getInstance("ADJUSTMENT")) , _log(Logger::getInstance("ADJUSTMENT"))
{ {
@ -25,7 +25,7 @@ void MultiColorAdjustment::addAdjustment(ColorAdjustment * adjustment)
_adjustment.push_back(adjustment); _adjustment.push_back(adjustment);
} }
void MultiColorAdjustment::setAdjustmentForLed(const QString& id, const unsigned startLed, unsigned endLed) void MultiColorAdjustment::setAdjustmentForLed(const QString& id, unsigned startLed, unsigned endLed)
{ {
// abort // abort
if(startLed > endLed) if(startLed > endLed)

View File

@ -55,12 +55,12 @@ PriorityMuxer::~PriorityMuxer()
{ {
} }
void PriorityMuxer::setEnable(const bool& enable) void PriorityMuxer::setEnable(bool enable)
{ {
enable ? _updateTimer->start() : _updateTimer->stop(); enable ? _updateTimer->start() : _updateTimer->stop();
} }
bool PriorityMuxer::setSourceAutoSelectEnabled(const bool& enable, const bool& update) bool PriorityMuxer::setSourceAutoSelectEnabled(bool enable, bool update)
{ {
if(_sourceAutoSelectEnabled != enable) if(_sourceAutoSelectEnabled != enable)
{ {
@ -84,7 +84,7 @@ bool PriorityMuxer::setSourceAutoSelectEnabled(const bool& enable, const bool& u
return false; return false;
} }
bool PriorityMuxer::setPriority(const uint8_t priority) bool PriorityMuxer::setPriority(uint8_t priority)
{ {
if(_activeInputs.contains(priority)) if(_activeInputs.contains(priority))
{ {
@ -96,7 +96,7 @@ bool PriorityMuxer::setPriority(const uint8_t priority)
return false; return false;
} }
void PriorityMuxer::updateLedColorsLength(const int& ledCount) void PriorityMuxer::updateLedColorsLength(int ledCount)
{ {
for (auto infoIt = _activeInputs.begin(); infoIt != _activeInputs.end();) for (auto infoIt = _activeInputs.begin(); infoIt != _activeInputs.end();)
{ {
@ -113,12 +113,12 @@ QList<int> PriorityMuxer::getPriorities() const
return _activeInputs.keys(); return _activeInputs.keys();
} }
bool PriorityMuxer::hasPriority(const int priority) const bool PriorityMuxer::hasPriority(int priority) const
{ {
return (priority == PriorityMuxer::LOWEST_PRIORITY) ? true : _activeInputs.contains(priority); return (priority == PriorityMuxer::LOWEST_PRIORITY) ? true : _activeInputs.contains(priority);
} }
const PriorityMuxer::InputInfo PriorityMuxer::getInputInfo(const int priority) const PriorityMuxer::InputInfo PriorityMuxer::getInputInfo(int priority) const
{ {
auto elemIt = _activeInputs.find(priority); auto elemIt = _activeInputs.find(priority);
if (elemIt == _activeInputs.end()) if (elemIt == _activeInputs.end())
@ -133,12 +133,12 @@ const PriorityMuxer::InputInfo PriorityMuxer::getInputInfo(const int priority) c
return elemIt.value(); return elemIt.value();
} }
hyperion::Components PriorityMuxer::getComponentOfPriority(const int &priority) hyperion::Components PriorityMuxer::getComponentOfPriority(int priority)
{ {
return _activeInputs[priority].componentId; return _activeInputs[priority].componentId;
} }
void PriorityMuxer::registerInput(const int priority, const hyperion::Components& component, const QString& origin, const QString& owner, unsigned smooth_cfg) void PriorityMuxer::registerInput(int priority, hyperion::Components component, const QString& origin, const QString& owner, unsigned smooth_cfg)
{ {
// detect new registers // detect new registers
bool newInput = false; bool newInput = false;
@ -162,7 +162,7 @@ void PriorityMuxer::registerInput(const int priority, const hyperion::Components
} }
} }
bool PriorityMuxer::setInput(const int priority, const std::vector<ColorRgb>& ledColors, int64_t timeout_ms) bool PriorityMuxer::setInput(int priority, const std::vector<ColorRgb>& ledColors, int64_t timeout_ms)
{ {
if(!_activeInputs.contains(priority)) if(!_activeInputs.contains(priority))
{ {
@ -202,7 +202,7 @@ bool PriorityMuxer::setInput(const int priority, const std::vector<ColorRgb>& le
return true; return true;
} }
bool PriorityMuxer::setInputImage(const int priority, const Image<ColorRgb>& image, int64_t timeout_ms) bool PriorityMuxer::setInputImage(int priority, const Image<ColorRgb>& image, int64_t timeout_ms)
{ {
if(!_activeInputs.contains(priority)) if(!_activeInputs.contains(priority))
{ {
@ -242,13 +242,13 @@ bool PriorityMuxer::setInputImage(const int priority, const Image<ColorRgb>& ima
return true; return true;
} }
bool PriorityMuxer::setInputInactive(const quint8& priority) bool PriorityMuxer::setInputInactive(quint8 priority)
{ {
Image<ColorRgb> image; Image<ColorRgb> image;
return setInputImage(priority, image, -100); return setInputImage(priority, image, -100);
} }
bool PriorityMuxer::clearInput(const uint8_t priority) bool PriorityMuxer::clearInput(uint8_t priority)
{ {
if (priority < PriorityMuxer::LOWEST_PRIORITY && _activeInputs.remove(priority)) if (priority < PriorityMuxer::LOWEST_PRIORITY && _activeInputs.remove(priority))
{ {
@ -283,7 +283,7 @@ void PriorityMuxer::clearAll(bool forceClearAll)
} }
} }
void PriorityMuxer::setCurrentTime(void) void PriorityMuxer::setCurrentTime()
{ {
const int64_t now = QDateTime::currentMSecsSinceEpoch(); const int64_t now = QDateTime::currentMSecsSinceEpoch();
int newPriority; int newPriority;

View File

@ -14,7 +14,7 @@
QJsonObject SettingsManager::schemaJson; QJsonObject SettingsManager::schemaJson;
SettingsManager::SettingsManager(const quint8& instance, QObject* parent) SettingsManager::SettingsManager(quint8 instance, QObject* parent)
: QObject(parent) : QObject(parent)
, _log(Logger::getInstance("SETTINGSMGR")) , _log(Logger::getInstance("SETTINGSMGR"))
, _sTable(new SettingsTable(instance, this)) , _sTable(new SettingsTable(instance, this))
@ -107,12 +107,12 @@ SettingsManager::SettingsManager(const quint8& instance, QObject* parent)
Debug(_log,"Settings database initialized"); Debug(_log,"Settings database initialized");
} }
const QJsonDocument SettingsManager::getSetting(const settings::type& type) QJsonDocument SettingsManager::getSetting(settings::type type) const
{ {
return _sTable->getSettingsRecord(settings::typeToString(type)); return _sTable->getSettingsRecord(settings::typeToString(type));
} }
bool SettingsManager::saveSettings(QJsonObject config, const bool& correct) bool SettingsManager::saveSettings(QJsonObject config, bool correct)
{ {
// optional data upgrades e.g. imported legacy/older configs // optional data upgrades e.g. imported legacy/older configs
// handleConfigUpgrade(config); // handleConfigUpgrade(config);

View File

@ -6,7 +6,7 @@
#include <QTcpSocket> #include <QTcpSocket>
#include <QHostAddress> #include <QHostAddress>
JsonClientConnection::JsonClientConnection(QTcpSocket *socket, const bool& localConnection) JsonClientConnection::JsonClientConnection(QTcpSocket *socket, bool localConnection)
: QObject() : QObject()
, _socket(socket) , _socket(socket)
, _receiveBuffer() , _receiveBuffer()
@ -53,7 +53,7 @@ qint64 JsonClientConnection::sendMessage(QJsonObject message)
return _socket->write(data.data(), data.size()); return _socket->write(data.data(), data.size());
} }
void JsonClientConnection::disconnected(void) void JsonClientConnection::disconnected()
{ {
emit connectionClosed(); emit connectionClosed();
} }

View File

@ -23,7 +23,7 @@ public:
/// Constructor /// Constructor
/// @param socket The Socket object for this connection /// @param socket The Socket object for this connection
/// ///
JsonClientConnection(QTcpSocket * socket, const bool& localConnection); JsonClientConnection(QTcpSocket * socket, bool localConnection);
signals: signals:
void connectionClosed(); void connectionClosed();

View File

@ -73,7 +73,7 @@ void JsonServer::stop()
Info(_log, "Stopped"); Info(_log, "Stopped");
} }
void JsonServer::handleSettingsUpdate(const settings::type& type, const QJsonDocument& config) void JsonServer::handleSettingsUpdate(settings::type type, const QJsonDocument& config)
{ {
if(type == settings::JSONSERVER) if(type == settings::JSONSERVER)
{ {
@ -113,7 +113,7 @@ void JsonServer::newConnection()
} }
} }
void JsonServer::closedConnection(void) void JsonServer::closedConnection()
{ {
JsonClientConnection* connection = qobject_cast<JsonClientConnection*>(sender()); JsonClientConnection* connection = qobject_cast<JsonClientConnection*>(sender());
Debug(_log, "Connection closed"); Debug(_log, "Connection closed");

View File

@ -151,7 +151,7 @@ bool LedDeviceWrapper::enabled()
return _enabled; return _enabled;
} }
void LedDeviceWrapper::handleComponentState(const hyperion::Components component, const bool state) void LedDeviceWrapper::handleComponentState(hyperion::Components component, bool state)
{ {
if(component == hyperion::COMP_LEDDEVICE) if(component == hyperion::COMP_LEDDEVICE)
{ {

View File

@ -122,7 +122,7 @@ int ProviderHID::close()
return retval; return retval;
} }
int ProviderHID::writeBytes(const unsigned size, const uint8_t * data) int ProviderHID::writeBytes(unsigned size, const uint8_t * data)
{ {
if (_blockedForDelay) { if (_blockedForDelay) {
return 0; return 0;

View File

@ -66,7 +66,7 @@ protected:
/// @param[in] data The data /// @param[in] data The data
/// @return Zero on success, else negative /// @return Zero on success, else negative
/// ///
int writeBytes(const unsigned size, const uint8_t *data); int writeBytes(unsigned size, const uint8_t *data);
// HID VID and PID // HID VID and PID
unsigned short _VendorId; unsigned short _VendorId;

View File

@ -342,7 +342,7 @@ bool LedDeviceNanoleaf::initLedsConfiguration()
return isInitOK; return isInitOK;
} }
bool LedDeviceNanoleaf::initRestAPI(const QString &hostname, const int port, const QString &token ) bool LedDeviceNanoleaf::initRestAPI(const QString &hostname, int port, const QString &token )
{ {
bool isInitOK = false; bool isInitOK = false;

View File

@ -135,7 +135,7 @@ private:
/// ///
/// @return True, if success /// @return True, if success
/// ///
bool initRestAPI(const QString &hostname, const int port, const QString &token ); bool initRestAPI(const QString &hostname, int port, const QString &token );
/// ///
/// @brief Get Nanoleaf device details and configuration /// @brief Get Nanoleaf device details and configuration

View File

@ -347,7 +347,7 @@ bool LedDevicePhilipsHueBridge::init(const QJsonObject &deviceConfig)
return isInitOK; return isInitOK;
} }
bool LedDevicePhilipsHueBridge::initRestAPI(const QString &hostname, const int port, const QString &token ) bool LedDevicePhilipsHueBridge::initRestAPI(const QString &hostname, int port, const QString &token )
{ {
bool isInitOK = false; bool isInitOK = false;
@ -544,12 +544,12 @@ void LedDevicePhilipsHueBridge::setGroupMap(const QJsonDocument &doc)
} }
} }
const QMap<quint16,QJsonObject>& LedDevicePhilipsHueBridge::getLightMap(void) const QMap<quint16,QJsonObject>& LedDevicePhilipsHueBridge::getLightMap()
{ {
return _lightsMap; return _lightsMap;
} }
const QMap<quint16,QJsonObject>& LedDevicePhilipsHueBridge::getGroupMap(void) const QMap<quint16,QJsonObject>& LedDevicePhilipsHueBridge::getGroupMap()
{ {
return _groupsMap; return _groupsMap;
} }
@ -642,13 +642,13 @@ QJsonDocument LedDevicePhilipsHueBridge::post(const QString& route, const QStrin
return response.getBody(); return response.getBody();
} }
void LedDevicePhilipsHueBridge::setLightState(const unsigned int lightId, const QString &state) void LedDevicePhilipsHueBridge::setLightState(unsigned int lightId, const QString &state)
{ {
DebugIf( verbose, _log, "SetLightState [%u]: %s", lightId, QSTRING_CSTR(state) ); DebugIf( verbose, _log, "SetLightState [%u]: %s", lightId, QSTRING_CSTR(state) );
post( QString("%1/%2/%3").arg( API_LIGHTS ).arg( lightId ).arg( API_STATE ), state ); post( QString("%1/%2/%3").arg( API_LIGHTS ).arg( lightId ).arg( API_STATE ), state );
} }
QJsonDocument LedDevicePhilipsHueBridge::getGroupState(const unsigned int groupId) QJsonDocument LedDevicePhilipsHueBridge::getGroupState(unsigned int groupId)
{ {
_restApi->setPath( QString("%1/%2").arg( API_GROUPS ).arg( groupId ) ); _restApi->setPath( QString("%1/%2").arg( API_GROUPS ).arg( groupId ) );
httpResponse response = _restApi->get(); httpResponse response = _restApi->get();
@ -656,7 +656,7 @@ QJsonDocument LedDevicePhilipsHueBridge::getGroupState(const unsigned int groupI
return response.getBody(); return response.getBody();
} }
QJsonDocument LedDevicePhilipsHueBridge::setGroupState(const unsigned int groupId, bool state) QJsonDocument LedDevicePhilipsHueBridge::setGroupState(unsigned int groupId, bool state)
{ {
QString active = state ? API_STREAM_ACTIVE_VALUE_TRUE : API_STREAM_ACTIVE_VALUE_FALSE; QString active = state ? API_STREAM_ACTIVE_VALUE_TRUE : API_STREAM_ACTIVE_VALUE_FALSE;
return post( QString("%1/%2").arg( API_GROUPS ).arg( groupId ), QString("{\"%1\":{\"%2\":%3}}").arg( API_STREAM, API_STREAM_ACTIVE, active ) ); return post( QString("%1/%2").arg( API_GROUPS ).arg( groupId ), QString("{\"%1\":{\"%2\":%3}}").arg( API_STREAM, API_STREAM_ACTIVE, active ) );

View File

@ -197,7 +197,7 @@ public:
/// ///
/// @return True, if success /// @return True, if success
/// ///
bool initRestAPI(const QString &hostname, const int port, const QString &token ); bool initRestAPI(const QString &hostname, int port, const QString &token );
/// ///
/// @param route the route of the POST request. /// @param route the route of the POST request.
@ -233,7 +233,7 @@ protected:
/// ///
/// @return Zero on success (i.e. device is ready), else negative /// @return Zero on success (i.e. device is ready), else negative
/// ///
virtual int open(void) override; virtual int open() override;
/// ///
/// @brief Closes the Hue-Bridge device and its SSL-connection /// @brief Closes the Hue-Bridge device and its SSL-connection

View File

@ -44,7 +44,7 @@ bool LedDeviceUdpArtNet::init(const QJsonObject &deviceConfig)
} }
// populates the headers // populates the headers
void LedDeviceUdpArtNet::prepare(const unsigned this_universe, const unsigned this_sequence, unsigned this_dmxChannelCount) void LedDeviceUdpArtNet::prepare(unsigned this_universe, unsigned this_sequence, unsigned this_dmxChannelCount)
{ {
// WTF? why do the specs say: // WTF? why do the specs say:
// "This value should be an even number in the range 2 512. " // "This value should be an even number in the range 2 512. "

View File

@ -80,7 +80,7 @@ private:
/// ///
/// @brief Generate Art-Net communication header /// @brief Generate Art-Net communication header
/// ///
void prepare(const unsigned this_universe, const unsigned this_sequence, const unsigned this_dmxChannelCount); void prepare(unsigned this_universe, unsigned this_sequence, unsigned this_dmxChannelCount);
artnet_packet_t artnet_packet; artnet_packet_t artnet_packet;
uint8_t _artnet_seq = 1; uint8_t _artnet_seq = 1;

View File

@ -75,7 +75,7 @@ bool LedDeviceUdpE131::init(const QJsonObject &deviceConfig)
} }
// populates the headers // populates the headers
void LedDeviceUdpE131::prepare(const unsigned this_universe, const unsigned this_dmxChannelCount) void LedDeviceUdpE131::prepare(unsigned this_universe, unsigned this_dmxChannelCount)
{ {
memset(e131_packet.raw, 0, sizeof(e131_packet.raw)); memset(e131_packet.raw, 0, sizeof(e131_packet.raw));

Some files were not shown because too many files have changed in this diff Show More