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
146 changed files with 505 additions and 505 deletions

View File

@@ -33,7 +33,7 @@
using namespace hyperion;
API::API(Logger *log, const bool &localConnection, QObject *parent)
API::API(Logger *log, bool localConnection, QObject *parent)
: QObject(parent)
{
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);
}
void API::init(void)
void API::init()
{
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;
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
data.imgName.truncate(16);
@@ -174,7 +174,7 @@ bool API::setImage(ImageCmdData &data, hyperion::Components comp, QString &reply
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))
{
@@ -188,7 +188,7 @@ bool API::clearPriority(const int &priority, QString &replyMsg, const hyperion::
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);
@@ -201,17 +201,17 @@ bool API::setComponentState(const QString &comp, bool &compState, QString &reply
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));
}
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));
}
void API::setEffect(const EffectCmdData &dat, const hyperion::Components &callerComp)
void API::setEffect(const EffectCmdData &dat, hyperion::Components callerComp)
{
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));
}
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));
}
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))
_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));
}
void API::unregisterInput(const int &priority)
void API::unregisterInput(int priority)
{
if (_activeRegisters.count(priority))
_activeRegisters.erase(priority);
}
bool API::setHyperionInstance(const quint8 &inst)
bool API::setHyperionInstance(quint8 inst)
{
if (_currInstanceIndex == inst)
return true;
@@ -278,19 +278,19 @@ bool API::isHyperionEnabled()
return res > 0;
}
QVector<QVariantMap> API::getAllInstanceData(void)
QVector<QVariantMap> API::getAllInstanceData()
{
QVector<QVariantMap> vec;
QMetaObject::invokeMethod(_instanceManager, "getInstanceData", Qt::DirectConnection, Q_RETURN_ARG(QVector<QVariantMap>, vec));
return vec;
}
void API::startInstance(const quint8 &index)
void API::startInstance(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));
}
@@ -302,7 +302,7 @@ void API::requestActiveRegister(QObject *callerInstance)
// 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)
{
@@ -327,7 +327,7 @@ QString API::createInstance(const QString &name)
return NO_AUTH;
}
QString API::setInstanceName(const quint8 &index, const QString &name)
QString API::setInstanceName(quint8 index, const QString &name)
{
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));
}
bool API::handlePendingTokenRequest(const QString &id, const bool accept)
bool API::handlePendingTokenRequest(const QString &id, bool accept)
{
if (!_adminAuthorized)
return false;
@@ -503,7 +503,7 @@ void API::logout()
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)
emit onTokenResponse(success, token, comment, id);

View File

@@ -47,7 +47,7 @@
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)
/* , _authManager(AuthManager::getInstance()) // moved to API
, _authorized(false)
@@ -79,7 +79,7 @@ JsonAPI::JsonAPI(QString peerAddress, Logger *log, const bool &localConnection,
Q_INIT_RESOURCE(JSONRPC_schemas);
}
void JsonAPI::initialize(void)
void JsonAPI::initialize()
{
// init API, REQUIRED!
API::init();
@@ -100,7 +100,7 @@ void JsonAPI::initialize(void)
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))
{
@@ -211,7 +211,7 @@ proceed:
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);
int priority = message["priority"].toInt();
@@ -230,7 +230,7 @@ void JsonAPI::handleColorCommand(const QJsonObject &message, const QString &comm
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);
@@ -254,7 +254,7 @@ void JsonAPI::handleImageCommand(const QJsonObject &message, const QString &comm
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);
@@ -272,19 +272,19 @@ void JsonAPI::handleEffectCommand(const QJsonObject &message, const QString &com
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);
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());
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
QJsonObject result;
@@ -319,7 +319,7 @@ void JsonAPI::handleSysInfoCommand(const QJsonObject &, const QString &command,
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;
@@ -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);
int priority = message["priority"].toInt();
@@ -728,7 +728,7 @@ void JsonAPI::handleClearCommand(const QJsonObject &message, const QString &comm
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);
QString replyMsg;
@@ -736,7 +736,7 @@ void JsonAPI::handleClearallCommand(const QJsonObject &message, const QString &c
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();
@@ -822,7 +822,7 @@ void JsonAPI::handleAdjustmentCommand(const QJsonObject &message, const QString
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"))
{
@@ -840,7 +840,7 @@ void JsonAPI::handleSourceSelectCommand(const QJsonObject &message, const QStrin
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 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"))
{
@@ -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
QJsonObject schemaJson, alldevices, properties;
@@ -962,7 +962,7 @@ void JsonAPI::handleSchemaGetCommand(const QJsonObject &message, const QString &
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();
QString comp = componentState["component"].toString("invalid");
@@ -977,7 +977,7 @@ void JsonAPI::handleComponentStateCommand(const QJsonObject &message, const QStr
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
QString subcommand = message["subcommand"].toString("");
@@ -1036,7 +1036,7 @@ void JsonAPI::handleLedColorsCommand(const QJsonObject &message, const QString &
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
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")));
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")));
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 &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 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() );
@@ -1457,7 +1457,7 @@ void JsonAPI::handleNotImplemented()
sendErrorReply("Command not implemented");
}
void JsonAPI::sendSuccessReply(const QString &command, const int tan)
void JsonAPI::sendSuccessReply(const QString &command, int tan)
{
// create reply
QJsonObject reply;
@@ -1469,7 +1469,7 @@ void JsonAPI::sendSuccessReply(const QString &command, const int tan)
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;
reply["success"] = true;
@@ -1483,7 +1483,7 @@ void JsonAPI::sendSuccessDataReply(const QJsonDocument &doc, const QString &comm
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
QJsonObject reply;
@@ -1581,7 +1581,7 @@ void JsonAPI::newPendingTokenRequest(const QString &id, const QString &comment)
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";
QJsonObject result;
@@ -1595,7 +1595,7 @@ void JsonAPI::handleTokenResponse(const bool &success, const QString &token, con
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)
{
@@ -1610,7 +1610,7 @@ void JsonAPI::handleInstanceStateChange(const InstanceState &state, const quint8
}
}
void JsonAPI::stopDataConnections(void)
void JsonAPI::stopDataConnections()
{
LoggerManager::getInstance()->disconnect();
_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";
}
bool JsonCB::subscribeFor(const QString& type, const bool & unsubscribe)
bool JsonCB::subscribeFor(const QString& type, bool unsubscribe)
{
if(!_availableCommands.contains(type))
return false;
@@ -189,7 +189,7 @@ void JsonCB::doCallback(const QString& cmd, const QVariant& data)
emit newCallback(obj);
}
void JsonCB::handleComponentState(const hyperion::Components comp, const bool state)
void JsonCB::handleComponentState(hyperion::Components comp, bool state)
{
QJsonObject data;
data["name"] = componentToIdString(comp);
@@ -279,7 +279,7 @@ void JsonCB::handlePriorityUpdate()
doCallback("priorities-update", QVariant(data));
}
void JsonCB::handleImageToLedsMappingChange(const int& mappingType)
void JsonCB::handleImageToLedsMappingChange(int mappingType)
{
QJsonObject data;
data["imageToLedMappingType"] = ImageProcessor::mappingTypeToStr(mappingType);
@@ -357,7 +357,7 @@ void JsonCB::handleAdjustmentChange()
doCallback("adjustment-update", QVariant(adjustmentArray));
}
void JsonCB::handleVideoModeChange(const VideoMode& mode)
void JsonCB::handleVideoModeChange(VideoMode mode)
{
QJsonObject data;
data["videomode"] = QString(videoMode2String(mode));
@@ -382,7 +382,7 @@ void JsonCB::handleEffectListChange()
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;
if(data.isObject())
@@ -393,7 +393,7 @@ void JsonCB::handleSettingsChange(const settings::type& type, const QJsonDocumen
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)
{

View File

@@ -40,7 +40,7 @@ BlackBorderProcessor::~BlackBorderProcessor()
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)
{
@@ -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)
{
@@ -89,7 +89,7 @@ void BlackBorderProcessor::handleCompStateChangeRequest(const hyperion::Componen
}
}
void BlackBorderProcessor::setHardDisable(const bool& disable) {
void BlackBorderProcessor::setHardDisable(bool disable) {
if (disable)
{

View File

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

View File

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

View File

@@ -72,7 +72,7 @@ bool BoblightServer::active()
return _server->isListening();
}
void BoblightServer::compStateChangeRequest(const hyperion::Components component, bool enable)
void BoblightServer::compStateChangeRequest(hyperion::Components component, bool enable)
{
if (component == COMP_BOBLIGHTSERVER)
{
@@ -114,7 +114,7 @@ void BoblightServer::closedConnection(BoblightClientConnection *connection)
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)
{

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;
// zeroconf $configname@$hostname:port

View File

@@ -48,7 +48,7 @@ EffectFileHandler::EffectFileHandler(const QString& rootPath, const QJsonDocumen
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)
{

View File

@@ -6,7 +6,7 @@
#include <QTimer>
#include <QRgb>
FlatBufferClient::FlatBufferClient(QTcpSocket* socket, const int &timeout, QObject *parent)
FlatBufferClient::FlatBufferClient(QTcpSocket* socket, int timeout, QObject *parent)
: QObject(parent)
, _log(Logger::getInstance("FLATBUFSERVER"))
, _socket(socket)
@@ -104,7 +104,7 @@ void FlatBufferClient::handleColorCommand(const hyperionnet::Color *colorReq)
sendSuccessReply();
}
void FlatBufferClient::registationRequired(const int priority)
void FlatBufferClient::registationRequired(int 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 parent The parent
///
explicit FlatBufferClient(QTcpSocket* socket, const int &timeout, QObject *parent = nullptr);
explicit FlatBufferClient(QTcpSocket* socket, int timeout, QObject *parent = nullptr);
signals:
///
/// @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
///
void clearGlobalInput(const int priority, bool forceClearAll=false);
void clearGlobalInput(int priority, bool forceClearAll=false);
///
/// @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
///
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
@@ -62,7 +62,7 @@ public slots:
///
/// @brief Requests a registration from the client
///
void registationRequired(const int priority);
void registationRequired(int priority);
///
/// @brief close the socket and call disconnected()

View File

@@ -11,7 +11,7 @@
#include "hyperion_reply_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()
, _origin(origin)
, _priority(priority)
@@ -85,7 +85,7 @@ void FlatBufferConnection::readData()
}
}
void FlatBufferConnection::setSkipReply(const bool& skip)
void FlatBufferConnection::setSkipReply(bool skip)
{
if(skip)
disconnect(&_socket, &QTcpSocket::readyRead, 0, 0);

View File

@@ -35,7 +35,7 @@ void FlatBufferServer::initServer()
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)
{

View File

@@ -20,7 +20,7 @@
#define VIDEO_DEVICE "/dev/amvideo"
#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
, _captureDev(-1)
, _videoDev(-1)

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
#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)
, _grabber(grabWidth, grabHeight)
{

View File

@@ -13,7 +13,7 @@
// Local includes
#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)
, _fbDevice()
{

View File

@@ -1,6 +1,6 @@
#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)
, _grabber(device, grabWidth, grabHeight)
{}

View File

@@ -5,7 +5,7 @@
// Local includes
#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)
, _screenIndex(100)
{

View File

@@ -1,6 +1,6 @@
#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)
, _grabber(display, grabWidth, grabHeight)
{}

View File

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

View File

@@ -1,6 +1,6 @@
#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)
, _grabber(cropLeft, cropRight, cropTop, cropBottom, pixelDecimation, display)
{}

View File

@@ -110,7 +110,7 @@ void V4L2Wrapper::handleCecEvent(CECEvent 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"))
{

View File

@@ -1,6 +1,6 @@
#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)
, _grabber(cropLeft, cropRight, cropTop, cropBottom, pixelDecimation)
, _init(false)

View File

@@ -85,7 +85,7 @@ const QString AuthManager::getUserToken(const QString &usr)
return QString(_authTable->getUserToken(usr));
}
void AuthManager::setAuthBlock(const bool &user)
void AuthManager::setAuthBlock(bool user)
{
// current timestamp +10 minutes
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))
{
@@ -226,7 +226,7 @@ bool AuthManager::deleteToken(const QString &id)
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)
{

View File

@@ -63,7 +63,7 @@ void CaptureCont::handleSystemImage(const QString& name, const Image<ColorRgb>&
_hyperion->setInputImage(_systemCaptPrio, image);
}
void CaptureCont::setSystemCaptureEnable(const bool& enable)
void CaptureCont::setSystemCaptureEnable(bool 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)
{
@@ -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)
{
@@ -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)
{

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;
}
void ComponentRegister::setNewComponentState(const hyperion::Components comp, const bool activated)
void ComponentRegister::setNewComponentState(hyperion::Components comp, bool 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)
{

View File

@@ -11,7 +11,7 @@
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)
, _timer(new QTimer(this))
, _updateInterval_ms(1000/updateRate_Hz)
@@ -104,7 +104,7 @@ QStringList GrabberWrapper::availableGrabbers()
return grabbers;
}
void GrabberWrapper::setVideoMode(const VideoMode& mode)
void GrabberWrapper::setVideoMode(VideoMode mode)
{
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"))
{
@@ -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"))
{

View File

@@ -39,7 +39,7 @@
// Boblight
#include <boblightserver/BoblightServer.h>
Hyperion::Hyperion(const quint8& instance)
Hyperion::Hyperion(quint8 instance)
: QObject()
, _instIndex(instance)
, _settingsManager(new SettingsManager(instance, this))
@@ -166,7 +166,7 @@ void Hyperion::freeObjects()
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 << config.toJson().toStdString() << std::endl;
@@ -250,12 +250,12 @@ void Hyperion::handleSettingsUpdate(const settings::type& type, const QJsonDocum
update();
}
QJsonDocument Hyperion::getSetting(const settings::type& type) const
QJsonDocument Hyperion::getSetting(settings::type type) const
{
return _settingsManager->getSetting(type);
}
bool Hyperion::saveSettings(QJsonObject config, const bool& correct)
bool Hyperion::saveSettings(QJsonObject config, bool correct)
{
return _settingsManager->saveSettings(config, correct);
}
@@ -280,12 +280,12 @@ unsigned Hyperion::getLedCount() const
return _ledString.leds().size();
}
void Hyperion::setSourceAutoSelect(const bool state)
void Hyperion::setSourceAutoSelect(bool state)
{
_muxer.setSourceAutoSelectEnabled(state);
}
bool Hyperion::setVisiblePriority(const int& priority)
bool Hyperion::setVisiblePriority(int priority)
{
return _muxer.setPriority(priority);
}
@@ -295,7 +295,7 @@ bool Hyperion::sourceAutoSelectEnabled()
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);
}
@@ -305,17 +305,17 @@ std::map<hyperion::Components, bool> Hyperion::getAllComponents() const
return _componentRegister.getRegister();
}
int Hyperion::isComponentEnabled(const hyperion::Components &comp)
int Hyperion::isComponentEnabled(hyperion::Components 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);
}
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))
{
@@ -334,7 +334,7 @@ bool Hyperion::setInput(const int priority, const std::vector<ColorRgb>& ledColo
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))
{
@@ -359,12 +359,12 @@ bool Hyperion::setInputImage(const int priority, const Image<ColorRgb>& image, i
return false;
}
bool Hyperion::setInputInactive(const quint8& priority)
bool Hyperion::setInputInactive(quint8 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
if (clearEffects)
@@ -412,7 +412,7 @@ void Hyperion::adjustmentsUpdated()
update();
}
bool Hyperion::clear(const int priority, bool forceClearAll)
bool Hyperion::clear(int priority, bool forceClearAll)
{
if (priority < 0)
{
@@ -439,7 +439,7 @@ int Hyperion::getCurrentPriority() const
return _muxer.getCurrentPriority();
}
bool Hyperion::isCurrentPriority(const int priority) const
bool Hyperion::isCurrentPriority(int priority) const
{
return getCurrentPriority() == priority;
}
@@ -449,7 +449,7 @@ QList<int> Hyperion::getActivePriorities() const
return _muxer.getPriorities();
}
Hyperion::InputInfo Hyperion::getPriorityInfo(const int priority) const
Hyperion::InputInfo Hyperion::getPriorityInfo(int priority) const
{
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);
}
void Hyperion::setLedMappingType(const int& mappingType)
void Hyperion::setLedMappingType(int mappingType)
{
if(mappingType != _imageProcessor->getUserLedMappingType())
{
@@ -508,7 +508,7 @@ int Hyperion::getLedMappingType() const
return _imageProcessor->getUserLedMappingType();
}
void Hyperion::setVideoMode(const VideoMode& mode)
void Hyperion::setVideoMode(VideoMode mode)
{
emit videoMode(mode);
}
@@ -523,7 +523,7 @@ QString Hyperion::getActiveDeviceType() const
return _ledDeviceWrapper->getActiveDeviceType();
}
void Hyperion::handleVisibleComponentChanged(const hyperion::Components &comp)
void Hyperion::handleVisibleComponentChanged(hyperion::Components comp)
{
_imageProcessor->setBlackbarDetectDisable((comp == hyperion::COMP_EFFECT));
_imageProcessor->setHardLedMappingType((comp == hyperion::COMP_EFFECT) ? 0 : -1);

View File

@@ -19,7 +19,7 @@ HyperionIManager::HyperionIManager(const QString& rootPath, QObject* parent)
qRegisterMetaType<InstanceState>("InstanceState");
}
Hyperion* HyperionIManager::getHyperionInstance(const quint8& instance)
Hyperion* HyperionIManager::getHyperionInstance(quint8 instance)
{
if(_runningInstances.contains(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
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))
{
@@ -113,7 +113,7 @@ bool HyperionIManager::startInstance(const quint8& inst, const bool& block)
return false;
}
bool HyperionIManager::stopInstance(const quint8& inst)
bool HyperionIManager::stopInstance(quint8 inst)
{
// inst 0 can't be stopped
if(!isInstAllowed(inst))
@@ -140,7 +140,7 @@ bool HyperionIManager::stopInstance(const quint8& inst)
return false;
}
bool HyperionIManager::createInstance(const QString& name, const bool& start)
bool HyperionIManager::createInstance(const QString& name, bool start)
{
quint8 inst;
if(_instanceTable->createInstance(name, inst))
@@ -156,7 +156,7 @@ bool HyperionIManager::createInstance(const QString& name, const bool& start)
return false;
}
bool HyperionIManager::deleteInstance(const quint8& inst)
bool HyperionIManager::deleteInstance(quint8 inst)
{
// inst 0 can't be deleted
if(!isInstAllowed(inst))
@@ -176,7 +176,7 @@ bool HyperionIManager::deleteInstance(const quint8& inst)
return false;
}
bool HyperionIManager::saveName(const quint8& inst, const QString& name)
bool HyperionIManager::saveName(quint8 inst, const QString& name)
{
if(_instanceTable->saveName(inst, name))
{
@@ -189,7 +189,7 @@ bool HyperionIManager::saveName(const quint8& inst, const QString& name)
void HyperionIManager::handleFinished()
{
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)));
@@ -203,7 +203,7 @@ void HyperionIManager::handleFinished()
void HyperionIManager::handleStarted()
{
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)));

View File

@@ -48,7 +48,7 @@ ImageProcessor::~ImageProcessor()
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)
{
@@ -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
if (_imageToLeds && _imageToLeds->width() == width && _imageToLeds->height() == height)

View File

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

View File

@@ -43,7 +43,7 @@ LinearColorSmoothing::LinearColorSmoothing(const QJsonDocument& config, Hyperion
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)
{
@@ -198,7 +198,7 @@ void LinearColorSmoothing::clearQueuedColors()
_targetValues.clear();
}
void LinearColorSmoothing::componentStateChange(const hyperion::Components component, const bool state)
void LinearColorSmoothing::componentStateChange(hyperion::Components component, bool state)
{
_writeToLedsEnable = state;
if(component == hyperion::COMP_LEDDEVICE)
@@ -254,7 +254,7 @@ unsigned LinearColorSmoothing::updateConfig(unsigned cfgID, int settlingTime_ms,
return updatedCfgID;
}
bool LinearColorSmoothing::selectConfig(unsigned cfg, const bool& force)
bool LinearColorSmoothing::selectConfig(unsigned cfg, bool force)
{
if (_currentConfigId == cfg && !force)
{

View File

@@ -74,7 +74,7 @@ public:
///
/// @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:
///
@@ -82,7 +82,7 @@ public slots:
/// @param type settingyType from enum
/// @param config configuration object
///
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config);
void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
private slots:
/// Timer callback which writes updated led values to the led device
@@ -93,7 +93,7 @@ private slots:
/// @param component The component
/// @param state The requested state
///
void componentStateChange(const hyperion::Components component, const bool state);
void componentStateChange(hyperion::Components component, bool state);
private:

View File

@@ -43,7 +43,7 @@ MessageForwarder::~MessageForwarder()
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)
{
@@ -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)
{
@@ -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();
if (priority != 0 && _forwarder_enabled && obj["enable"].toBool())

View File

@@ -2,7 +2,7 @@
#include <utils/Logger.h>
#include <hyperion/MultiColorAdjustment.h>
MultiColorAdjustment::MultiColorAdjustment(const unsigned ledCnt)
MultiColorAdjustment::MultiColorAdjustment(unsigned ledCnt)
: _ledAdjustments(ledCnt, nullptr)
, _log(Logger::getInstance("ADJUSTMENT"))
{
@@ -25,7 +25,7 @@ void MultiColorAdjustment::addAdjustment(ColorAdjustment * 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
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();
}
bool PriorityMuxer::setSourceAutoSelectEnabled(const bool& enable, const bool& update)
bool PriorityMuxer::setSourceAutoSelectEnabled(bool enable, bool update)
{
if(_sourceAutoSelectEnabled != enable)
{
@@ -84,7 +84,7 @@ bool PriorityMuxer::setSourceAutoSelectEnabled(const bool& enable, const bool& u
return false;
}
bool PriorityMuxer::setPriority(const uint8_t priority)
bool PriorityMuxer::setPriority(uint8_t priority)
{
if(_activeInputs.contains(priority))
{
@@ -96,7 +96,7 @@ bool PriorityMuxer::setPriority(const uint8_t priority)
return false;
}
void PriorityMuxer::updateLedColorsLength(const int& ledCount)
void PriorityMuxer::updateLedColorsLength(int ledCount)
{
for (auto infoIt = _activeInputs.begin(); infoIt != _activeInputs.end();)
{
@@ -113,12 +113,12 @@ QList<int> PriorityMuxer::getPriorities() const
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);
}
const PriorityMuxer::InputInfo PriorityMuxer::getInputInfo(const int priority) const
PriorityMuxer::InputInfo PriorityMuxer::getInputInfo(int priority) const
{
auto elemIt = _activeInputs.find(priority);
if (elemIt == _activeInputs.end())
@@ -133,12 +133,12 @@ const PriorityMuxer::InputInfo PriorityMuxer::getInputInfo(const int priority) c
return elemIt.value();
}
hyperion::Components PriorityMuxer::getComponentOfPriority(const int &priority)
hyperion::Components PriorityMuxer::getComponentOfPriority(int priority)
{
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
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))
{
@@ -202,7 +202,7 @@ bool PriorityMuxer::setInput(const int priority, const std::vector<ColorRgb>& le
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))
{
@@ -242,13 +242,13 @@ bool PriorityMuxer::setInputImage(const int priority, const Image<ColorRgb>& ima
return true;
}
bool PriorityMuxer::setInputInactive(const quint8& priority)
bool PriorityMuxer::setInputInactive(quint8 priority)
{
Image<ColorRgb> image;
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))
{
@@ -283,7 +283,7 @@ void PriorityMuxer::clearAll(bool forceClearAll)
}
}
void PriorityMuxer::setCurrentTime(void)
void PriorityMuxer::setCurrentTime()
{
const int64_t now = QDateTime::currentMSecsSinceEpoch();
int newPriority;

View File

@@ -14,7 +14,7 @@
QJsonObject SettingsManager::schemaJson;
SettingsManager::SettingsManager(const quint8& instance, QObject* parent)
SettingsManager::SettingsManager(quint8 instance, QObject* parent)
: QObject(parent)
, _log(Logger::getInstance("SETTINGSMGR"))
, _sTable(new SettingsTable(instance, this))
@@ -107,12 +107,12 @@ SettingsManager::SettingsManager(const quint8& instance, QObject* parent)
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));
}
bool SettingsManager::saveSettings(QJsonObject config, const bool& correct)
bool SettingsManager::saveSettings(QJsonObject config, bool correct)
{
// optional data upgrades e.g. imported legacy/older configs
// handleConfigUpgrade(config);

View File

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

View File

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

View File

@@ -73,7 +73,7 @@ void JsonServer::stop()
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)
{
@@ -113,7 +113,7 @@ void JsonServer::newConnection()
}
}
void JsonServer::closedConnection(void)
void JsonServer::closedConnection()
{
JsonClientConnection* connection = qobject_cast<JsonClientConnection*>(sender());
Debug(_log, "Connection closed");

View File

@@ -151,7 +151,7 @@ bool LedDeviceWrapper::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)
{

View File

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

View File

@@ -66,7 +66,7 @@ protected:
/// @param[in] data The data
/// @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
unsigned short _VendorId;

View File

@@ -342,7 +342,7 @@ bool LedDeviceNanoleaf::initLedsConfiguration()
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;

View File

@@ -135,7 +135,7 @@ private:
///
/// @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

View File

@@ -347,7 +347,7 @@ bool LedDevicePhilipsHueBridge::init(const QJsonObject &deviceConfig)
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;
@@ -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;
}
const QMap<quint16,QJsonObject>& LedDevicePhilipsHueBridge::getGroupMap(void)
const QMap<quint16,QJsonObject>& LedDevicePhilipsHueBridge::getGroupMap()
{
return _groupsMap;
}
@@ -642,13 +642,13 @@ QJsonDocument LedDevicePhilipsHueBridge::post(const QString& route, const QStrin
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) );
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 ) );
httpResponse response = _restApi->get();
@@ -656,7 +656,7 @@ QJsonDocument LedDevicePhilipsHueBridge::getGroupState(const unsigned int groupI
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;
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
///
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.
@@ -233,7 +233,7 @@ protected:
///
/// @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

View File

@@ -44,7 +44,7 @@ bool LedDeviceUdpArtNet::init(const QJsonObject &deviceConfig)
}
// 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:
// "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
///
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;
uint8_t _artnet_seq = 1;

View File

@@ -75,7 +75,7 @@ bool LedDeviceUdpE131::init(const QJsonObject &deviceConfig)
}
// 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));

View File

@@ -125,7 +125,7 @@ private:
///
/// @brief Generate E1.31 communication header
///
void prepare(const unsigned this_universe, const unsigned this_dmxChannelCount);
void prepare(unsigned this_universe, unsigned this_dmxChannelCount);
e131_packet_t e131_packet;
uint8_t _e131_seq = 0;

View File

@@ -111,7 +111,7 @@ bool LedDeviceWled::init(const QJsonObject &deviceConfig)
return isInitOK;
}
bool LedDeviceWled::initRestAPI(const QString &hostname, const int port )
bool LedDeviceWled::initRestAPI(const QString &hostname, int port )
{
Debug(_log, "");
bool isInitOK = false;

View File

@@ -112,7 +112,7 @@ private:
/// @param[in] port
/// @return True, if success
///
bool initRestAPI(const QString &hostname, const int port );
bool initRestAPI(const QString &hostname, int port );
///
/// @brief Get command to power WLED-device on or off

View File

@@ -947,7 +947,7 @@ bool YeelightLight::setMusicMode(bool on, const QHostAddress &hostAddress, int p
return rc;
}
void YeelightLight::log(const int logLevel, const char* msg, const char* type, ...)
void YeelightLight::log(int logLevel, const char* msg, const char* type, ...)
{
if ( logLevel <= _debugLevel)
{

View File

@@ -51,14 +51,14 @@ public:
explicit YeelightResponse() {}
API_REPLY error() { return _error;}
API_REPLY error() const { return _error;}
void setError(const YeelightResponse::API_REPLY replyType) { _error = replyType; }
QJsonArray getResult() const { return _resultArray; }
void setResult(const QJsonArray &result) { _resultArray = result; }
int getErrorCode() const { return _errorCode; }
void setErrorCode(const int &errorCode) { _errorCode = errorCode; _error = API_ERROR;}
void setErrorCode(int errorCode) { _errorCode = errorCode; _error = API_ERROR;}
QString getErrorReason() const { return _errorReason; }
void setErrorReason(const QString &errorReason) { _errorReason = errorReason; }
@@ -353,7 +353,7 @@ private:
/// @param[in] type log message text
/// @param[in] ... variable input to log message text
/// ///
void log(const int logLevel,const char* msg, const char* type, ...);
void log(int logLevel,const char* msg, const char* type, ...);
Logger* _log;
int _debugLevel;

View File

@@ -16,7 +16,7 @@ const QChar ONE_SLASH = '/';
} //End of constants
ProviderRestApi::ProviderRestApi(const QString &host, const int &port, const QString &basePath)
ProviderRestApi::ProviderRestApi(const QString &host, int port, const QString &basePath)
:_log(Logger::getInstance("LEDDEVICE"))
,_networkManager(nullptr)
,_scheme("http")
@@ -31,7 +31,7 @@ ProviderRestApi::ProviderRestApi(const QString &host, const int &port, const QSt
_basePath = basePath;
}
ProviderRestApi::ProviderRestApi(const QString &host, const int &port)
ProviderRestApi::ProviderRestApi(const QString &host, int port)
: ProviderRestApi(host, port, "") {}
ProviderRestApi::ProviderRestApi()

View File

@@ -19,8 +19,8 @@ public:
explicit httpResponse() {}
bool error() { return _hasError;}
void setError(const bool hasError) { _hasError = hasError; }
bool error() const { return _hasError;}
void setError(bool hasError) { _hasError = hasError; }
QJsonDocument getBody() const { return _responseBody; }
void setBody(const QJsonDocument &body) { _responseBody = body; }
@@ -29,7 +29,7 @@ public:
void setErrorReason(const QString &errorReason) { _errorReason = errorReason; }
int getHttpStatusCode() const { return _httpStatusCode; }
void setHttpStatusCode(const int httpStatusCode) { _httpStatusCode = httpStatusCode; }
void setHttpStatusCode(int httpStatusCode) { _httpStatusCode = httpStatusCode; }
QNetworkReply::NetworkError getNetworkReplyError() const { return _networkReplyError; }
void setNetworkReplyError (const QNetworkReply::NetworkError networkReplyError) { _networkReplyError = networkReplyError; }
@@ -78,7 +78,7 @@ public:
/// @param[in] host
/// @param[in] port
///
explicit ProviderRestApi(const QString &host, const int &port);
explicit ProviderRestApi(const QString &host, int port);
///
/// @brief Constructor of the REST-API wrapper
@@ -87,7 +87,7 @@ public:
/// @param[in] port
/// @param[in] API base-path
///
explicit ProviderRestApi(const QString &host, const int &port, const QString &basePath);
explicit ProviderRestApi(const QString &host, int port, const QString &basePath);
///
/// @brief Destructor of the REST-API wrapper

View File

@@ -129,7 +129,7 @@ int ProviderUdp::close()
return retval;
}
int ProviderUdp::writeBytes(const unsigned size, const uint8_t * data)
int ProviderUdp::writeBytes(unsigned size, const uint8_t * data)
{
qint64 retVal = _udpSocket->writeDatagram((const char *)data,size,_address,_port);

View File

@@ -61,7 +61,7 @@ protected:
///
/// @return Zero on success, else negative
///
int writeBytes(const unsigned size, const uint8_t *data);
int writeBytes(unsigned size, const uint8_t *data);
///
QUdpSocket * _udpSocket;

View File

@@ -457,7 +457,7 @@ void ProviderUdpSSL::freeSSLConnection()
}
}
void ProviderUdpSSL::writeBytes(const unsigned size, const unsigned char * data)
void ProviderUdpSSL::writeBytes(unsigned size, const unsigned char * data)
{
if( _stopConnection ) return;

View File

@@ -106,7 +106,7 @@ protected:
/// @param[in] size The length of the data
/// @param[in] data The data
///
void writeBytes(const unsigned size, const uint8_t *data);
void writeBytes(unsigned size, const uint8_t *data);
///
/// get ciphersuites list from mbedtls_ssl_list_ciphersuites

View File

@@ -109,7 +109,7 @@ bool ProviderRs232::powerOff()
return rc;
}
bool ProviderRs232::tryOpen(const int delayAfterConnect_ms)
bool ProviderRs232::tryOpen(int delayAfterConnect_ms)
{
if (_deviceName.isEmpty() || _rs232Port.portName().isEmpty())
{

View File

@@ -125,7 +125,7 @@ int ProviderSpi::close()
return retval;
}
int ProviderSpi::writeBytes(const unsigned size, const uint8_t * data)
int ProviderSpi::writeBytes(unsigned size, const uint8_t * data)
{
if (_fid < 0)
{

View File

@@ -53,7 +53,7 @@ protected:
///
/// @return Zero on success, else negative
///
int writeBytes(const unsigned size, const uint8_t *data);
int writeBytes(unsigned size, const uint8_t *data);
/// The name of the output device
QString _deviceName;

View File

@@ -9,7 +9,7 @@
// TODO Remove this class if third-party apps have been migrated (eg. Hyperion Android Grabber, Windows Screen grabber etc.)
ProtoClientConnection::ProtoClientConnection(QTcpSocket* socket, const int &timeout, QObject *parent)
ProtoClientConnection::ProtoClientConnection(QTcpSocket* socket, int timeout, QObject *parent)
: QObject(parent)
, _log(Logger::getInstance("PROTOSERVER"))
, _socket(socket)

View File

@@ -30,28 +30,28 @@ public:
/// @param timeout The timeout when a client is automatically disconnected and the priority unregistered
/// @param parent The parent
///
explicit ProtoClientConnection(QTcpSocket* socket, const int &timeout, QObject *parent);
explicit ProtoClientConnection(QTcpSocket* socket, int timeout, QObject *parent);
signals:
///
/// @brief forward register data to HyperionDaemon
///
void registerGlobalInput(const int priority, const hyperion::Components& component, const QString& origin = "ProtoBuffer", const QString& owner = "", unsigned smooth_cfg = 0);
void registerGlobalInput(int priority, hyperion::Components component, const QString& origin = "ProtoBuffer", const QString& owner = "", unsigned smooth_cfg = 0);
///
/// @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
///
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
///
void setGlobalInputColor(const int priority, const std::vector<ColorRgb> &ledColor, const int timeout_ms, const QString& origin = "ProtoBuffer" ,bool clearEffects = true);
void setGlobalInputColor(int priority, const std::vector<ColorRgb> &ledColor, int timeout_ms, const QString& origin = "ProtoBuffer" ,bool clearEffects = true);
///
/// @brief Emits whenever the client disconnected
@@ -62,7 +62,7 @@ public slots:
///
/// @brief Requests a registration from the client
///
void registationRequired(const int priority) { if (_priority == priority) _priority = -1; };
void registationRequired(int priority) { if (_priority == priority) _priority = -1; };
///
/// @brief close the socket and call disconnected()

View File

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

View File

@@ -49,7 +49,7 @@ void SSDPDiscover::searchForService(const QString& st)
sendSearch(st);
}
const QString SSDPDiscover::getFirstService(const searchType& type, const QString& st, const int& timeout_ms)
const QString SSDPDiscover::getFirstService(const searchType& type, const QString& st, int timeout_ms)
{
_searchTarget = st;
_services.clear();

View File

@@ -15,7 +15,7 @@
static const QString SSDP_HYPERION_ST("urn:hyperion-project.org:device:basic:1");
SSDPHandler::SSDPHandler(WebServer* webserver, const quint16& flatBufPort, const quint16& jsonServerPort, const QString& name, QObject * parent)
SSDPHandler::SSDPHandler(WebServer* webserver, quint16 flatBufPort, quint16 jsonServerPort, const QString& name, QObject * parent)
: SSDPServer(parent)
, _webserver(webserver)
, _localAddress()
@@ -73,7 +73,7 @@ void SSDPHandler::stopServer()
SSDPServer::stop();
}
void SSDPHandler::handleSettingsUpdate(const settings::type& type, const QJsonDocument& config)
void SSDPHandler::handleSettingsUpdate(settings::type type, const QJsonDocument& config)
{
const QJsonObject& obj = config.object();
@@ -102,7 +102,7 @@ void SSDPHandler::handleSettingsUpdate(const settings::type& type, const QJsonDo
}
}
void SSDPHandler::handleWebServerStateChange(const bool newState)
void SSDPHandler::handleWebServerStateChange(bool newState)
{
if(newState)
{
@@ -151,7 +151,7 @@ QString SSDPHandler::getLocalAddress() const
return QString();
}
void SSDPHandler::handleMSearchRequest(const QString& target, const QString& mx, const QString address, const quint16 & port)
void SSDPHandler::handleMSearchRequest(const QString& target, const QString& mx, const QString address, quint16 port)
{
const auto respond = [=] () {
// when searched for all devices / root devices / basic device
@@ -202,7 +202,7 @@ QString SSDPHandler::buildDesc() const
return SSDP_DESCRIPTION.arg(getBaseAddress(), QString("Hyperion (%1)").arg(_localAddress), QString(HYPERION_VERSION), _uuid);
}
void SSDPHandler::sendAnnounceList(const bool alive)
void SSDPHandler::sendAnnounceList(bool alive)
{
for(const auto & entry : _deviceList){
alive ? SSDPServer::sendAlive(entry) : SSDPServer::sendByeBye(entry);

View File

@@ -166,7 +166,7 @@ void SSDPServer::readPendingDatagrams()
}
}
void SSDPServer::sendMSearchResponse(const QString& st, const QString& senderIp, const quint16& senderPort)
void SSDPServer::sendMSearchResponse(const QString& st, const QString& senderIp, quint16 senderPort)
{
QString message = UPNP_MSEARCH_RESPONSE.arg(SSDP_MAX_AGE
, QDateTime::currentDateTimeUtc().toString("ddd, dd MMM yyyy HH:mm:ss GMT")

View File

@@ -48,7 +48,7 @@ bool NetOrigin::isLocalAddress(const QHostAddress& address, const QHostAddress&
return true;
}
void NetOrigin::handleSettingsUpdate(const settings::type& type, const QJsonDocument& config)
void NetOrigin::handleSettingsUpdate(settings::type type, const QJsonDocument& config)
{
if(type == settings::NETWORK)
{

View File

@@ -16,7 +16,7 @@ class StaticFileServing : public QObject {
public:
explicit StaticFileServing (QObject * parent = nullptr);
virtual ~StaticFileServing (void);
virtual ~StaticFileServing ();
///
/// @brief Overwrite current base url

View File

@@ -6,7 +6,7 @@
#include <api/JsonAPI.h>
WebJsonRpc::WebJsonRpc(QtHttpRequest* request, QtHttpServer* server, const bool& localConnection, QtHttpClientWrapper* parent)
WebJsonRpc::WebJsonRpc(QtHttpRequest* request, QtHttpServer* server, bool localConnection, QtHttpClientWrapper* parent)
: QObject(parent)
, _server(server)
, _wrapper(parent)

View File

@@ -12,7 +12,7 @@ class JsonAPI;
class WebJsonRpc : public QObject {
Q_OBJECT
public:
WebJsonRpc(QtHttpRequest* request, QtHttpServer* server, const bool& localConnection, QtHttpClientWrapper* parent);
WebJsonRpc(QtHttpRequest* request, QtHttpServer* server, bool localConnection, QtHttpClientWrapper* parent);
void handleMessage(QtHttpRequest* request);

View File

@@ -12,7 +12,7 @@
// netUtil
#include <utils/NetUtils.h>
WebServer::WebServer(const QJsonDocument& config, const bool& useSsl, QObject * parent)
WebServer::WebServer(const QJsonDocument& config, bool useSsl, QObject * parent)
: QObject(parent)
, _config(config)
, _useSsl(useSsl)
@@ -83,7 +83,7 @@ void WebServer::onServerError (QString msg)
Error(_log, "%s", msg.toStdString().c_str());
}
void WebServer::handleSettingsUpdate(const settings::type& type, const QJsonDocument& config)
void WebServer::handleSettingsUpdate(settings::type type, const QJsonDocument& config)
{
if(type == settings::WEBSERVER)
{

View File

@@ -10,7 +10,7 @@
#include <QCryptographicHash>
#include <QJsonObject>
WebSocketClient::WebSocketClient(QtHttpRequest* request, QTcpSocket* sock, const bool& localConnection, QObject* parent)
WebSocketClient::WebSocketClient(QtHttpRequest* request, QTcpSocket* sock, bool localConnection, QObject* parent)
: QObject(parent)
, _socket(sock)
, _log(Logger::getInstance("WEBSOCKET"))
@@ -46,7 +46,7 @@ WebSocketClient::WebSocketClient(QtHttpRequest* request, QTcpSocket* sock, const
_jsonAPI->initialize();
}
void WebSocketClient::handleWebSocketFrame(void)
void WebSocketClient::handleWebSocketFrame()
{
while (_socket->bytesAvailable())
{

View File

@@ -12,7 +12,7 @@ class JsonAPI;
class WebSocketClient : public QObject {
Q_OBJECT
public:
WebSocketClient(QtHttpRequest* request, QTcpSocket* sock, const bool& localConnection, QObject* parent);
WebSocketClient(QtHttpRequest* request, QTcpSocket* sock, bool localConnection, QObject* parent);
struct WebSocketHeader
{
@@ -67,6 +67,6 @@ private:
static const quint64 FRAME_SIZE_IN_BYTES = 512 * 512 * 2; //maximum size of a frame when sending a message
private slots:
void handleWebSocketFrame(void);
void handleWebSocketFrame();
qint64 sendMessage(QJsonObject obj);
};