mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Pass primitive types by value (#935)
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
// Linux includes
|
||||
#include <unistd.h>
|
||||
|
||||
AmlogicWrapper::AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight) :
|
||||
AmlogicWrapper::AmlogicWrapper(unsigned grabWidth, unsigned grabHeight) :
|
||||
_thread(this),
|
||||
_grabber(grabWidth, grabHeight)
|
||||
{
|
||||
|
@@ -9,7 +9,7 @@ class AmlogicWrapper : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight);
|
||||
AmlogicWrapper(unsigned grabWidth, unsigned grabHeight);
|
||||
|
||||
const Image<ColorRgb> & getScreenshot();
|
||||
|
||||
|
@@ -2,11 +2,11 @@
|
||||
// Hyperion-Dispmanx includes
|
||||
#include "DispmanxWrapper.h"
|
||||
|
||||
DispmanxWrapper::DispmanxWrapper(const unsigned grabWidth, const unsigned grabHeight,
|
||||
const VideoMode& videoMode,
|
||||
const unsigned cropLeft, const unsigned cropRight,
|
||||
const unsigned cropTop, const unsigned cropBottom,
|
||||
const unsigned updateRate_Hz) :
|
||||
DispmanxWrapper::DispmanxWrapper(unsigned grabWidth, unsigned grabHeight,
|
||||
VideoMode videoMode,
|
||||
unsigned cropLeft, unsigned cropRight,
|
||||
unsigned cropTop, unsigned cropBottom,
|
||||
unsigned updateRate_Hz) :
|
||||
_timer(this),
|
||||
_grabber(grabWidth, grabHeight)
|
||||
{
|
||||
|
@@ -9,11 +9,11 @@ class DispmanxWrapper : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
DispmanxWrapper(const unsigned grabWidth, const unsigned grabHeight,
|
||||
const VideoMode& videoMode,
|
||||
const unsigned cropLeft, const unsigned cropRight,
|
||||
const unsigned cropTop, const unsigned cropBottom,
|
||||
const unsigned updateRate_Hz);
|
||||
DispmanxWrapper(unsigned grabWidth, unsigned grabHeight,
|
||||
VideoMode videoMode,
|
||||
unsigned cropLeft, unsigned cropRight,
|
||||
unsigned cropTop, unsigned cropBottom,
|
||||
unsigned updateRate_Hz);
|
||||
|
||||
const Image<ColorRgb> & getScreenshot();
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
// Hyperion-AmLogic includes
|
||||
#include "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) :
|
||||
_timer(this),
|
||||
_grabber(device,grabWidth, grabHeight)
|
||||
{
|
||||
|
@@ -10,7 +10,7 @@ class FramebufferWrapper : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
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);
|
||||
|
||||
const Image<ColorRgb> & getScreenshot();
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
// Hyperion-AmLogic includes
|
||||
#include "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) :
|
||||
_timer(this),
|
||||
_grabber(display,grabWidth, grabHeight)
|
||||
{
|
||||
|
@@ -9,7 +9,7 @@ class OsxWrapper : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
OsxWrapper(const unsigned display, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz);
|
||||
OsxWrapper(unsigned display, unsigned grabWidth, unsigned grabHeight, unsigned updateRate_Hz);
|
||||
|
||||
const Image<ColorRgb> & getScreenshot();
|
||||
|
||||
|
@@ -36,7 +36,7 @@ void QtWrapper::capture()
|
||||
emit sig_screenshot(_screenshot);
|
||||
}
|
||||
|
||||
void QtWrapper::setVideoMode(const VideoMode mode)
|
||||
void QtWrapper::setVideoMode(VideoMode mode)
|
||||
{
|
||||
_grabber.setVideoMode(mode);
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ public slots:
|
||||
/// Set the video mode (2D/3D)
|
||||
/// @param[in] mode The new video mode
|
||||
///
|
||||
void setVideoMode(const VideoMode videoMode);
|
||||
void setVideoMode(VideoMode videoMode);
|
||||
|
||||
private slots:
|
||||
///
|
||||
|
@@ -290,7 +290,7 @@ void JsonConnection::clearAll()
|
||||
parseReply(reply);
|
||||
}
|
||||
|
||||
void JsonConnection::setComponentState(const QString & component, const bool state)
|
||||
void JsonConnection::setComponentState(const QString & component, bool state)
|
||||
{
|
||||
qDebug() << (state ? "Enable" : "Disable") << "Component" << component;
|
||||
|
||||
@@ -517,7 +517,7 @@ void JsonConnection::setToken(const QString &token)
|
||||
parseReply(reply);
|
||||
}
|
||||
|
||||
void JsonConnection::setInstance(const int &instance)
|
||||
void JsonConnection::setInstance(int instance)
|
||||
{
|
||||
// create command
|
||||
QJsonObject command;
|
||||
|
@@ -111,7 +111,7 @@ public:
|
||||
/// @param component The component [SMOOTHING, BLACKBORDER, FORWARDER, BOBLIGHT_SERVER, GRABBER]
|
||||
/// @param state The state of the component [true | false]
|
||||
///
|
||||
void setComponentState(const QString & component, const bool state);
|
||||
void setComponentState(const QString & component, bool state);
|
||||
|
||||
///
|
||||
/// Set current active priority channel and deactivate auto source switching
|
||||
@@ -185,7 +185,7 @@ public:
|
||||
/// Send a json message with a specific instance id
|
||||
/// @param instance The instance id
|
||||
///
|
||||
void setInstance(const int &instance);
|
||||
void setInstance(int instance);
|
||||
|
||||
|
||||
private:
|
||||
|
@@ -41,7 +41,7 @@ void X11Wrapper::capture()
|
||||
_inited = true;
|
||||
}
|
||||
|
||||
void X11Wrapper::setVideoMode(const VideoMode mode)
|
||||
void X11Wrapper::setVideoMode(VideoMode mode)
|
||||
{
|
||||
_grabber.setVideoMode(mode);
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ public slots:
|
||||
/// Set the video mode (2D/3D)
|
||||
/// @param[in] mode The new video mode
|
||||
///
|
||||
void setVideoMode(const VideoMode videoMode);
|
||||
void setVideoMode(VideoMode videoMode);
|
||||
|
||||
private slots:
|
||||
///
|
||||
|
@@ -60,7 +60,7 @@
|
||||
|
||||
HyperionDaemon *HyperionDaemon::daemon = nullptr;
|
||||
|
||||
HyperionDaemon::HyperionDaemon(const QString rootPath, QObject *parent, const bool &logLvlOverwrite)
|
||||
HyperionDaemon::HyperionDaemon(const QString rootPath, QObject *parent, bool logLvlOverwrite)
|
||||
: QObject(parent), _log(Logger::getInstance("DAEMON"))
|
||||
, _instanceManager(new HyperionIManager(rootPath, this))
|
||||
, _authManager(new AuthManager(this))
|
||||
@@ -154,7 +154,7 @@ HyperionDaemon::~HyperionDaemon()
|
||||
delete _pyInit;
|
||||
}
|
||||
|
||||
void HyperionDaemon::setVideoMode(const VideoMode &mode)
|
||||
void HyperionDaemon::setVideoMode(VideoMode mode)
|
||||
{
|
||||
if (_currVideoMode != mode)
|
||||
{
|
||||
@@ -163,7 +163,7 @@ void HyperionDaemon::setVideoMode(const VideoMode &mode)
|
||||
}
|
||||
}
|
||||
|
||||
const QJsonDocument HyperionDaemon::getSetting(const settings::type &type)
|
||||
QJsonDocument HyperionDaemon::getSetting(settings::type type) const
|
||||
{
|
||||
return _settingsManager->getSetting(type);
|
||||
}
|
||||
@@ -312,7 +312,7 @@ void HyperionDaemon::startNetworkServices()
|
||||
ssdpThread->start();
|
||||
}
|
||||
|
||||
void HyperionDaemon::handleSettingsUpdate(const settings::type &settingsType, const QJsonDocument &config)
|
||||
void HyperionDaemon::handleSettingsUpdate(settings::type settingsType, const QJsonDocument &config)
|
||||
{
|
||||
if (settingsType == settings::LOGGER)
|
||||
{
|
||||
|
@@ -80,7 +80,7 @@ class HyperionDaemon : public QObject
|
||||
friend SysTray;
|
||||
|
||||
public:
|
||||
HyperionDaemon(QString rootPath, QObject *parent, const bool& logLvlOverwrite);
|
||||
HyperionDaemon(QString rootPath, QObject *parent, bool logLvlOverwrite);
|
||||
~HyperionDaemon();
|
||||
|
||||
///
|
||||
@@ -91,12 +91,12 @@ public:
|
||||
///
|
||||
/// @brief Get the current videoMode
|
||||
///
|
||||
const VideoMode & getVideoMode() { return _currVideoMode; };
|
||||
VideoMode getVideoMode() const { return _currVideoMode; };
|
||||
|
||||
///
|
||||
/// @brief get the settings
|
||||
///
|
||||
const QJsonDocument getSetting(const settings::type& type);
|
||||
QJsonDocument getSetting(settings::type type) const;
|
||||
|
||||
void startNetworkServices();
|
||||
|
||||
@@ -114,7 +114,7 @@ signals:
|
||||
///
|
||||
/// @brief After eval of setVideoMode this signal emits with a new one on change
|
||||
///
|
||||
void videoMode(const VideoMode& mode);
|
||||
void videoMode(VideoMode mode);
|
||||
|
||||
///////////////////////////////////////
|
||||
/// FROM HYPERION TO HYPERIONDAEMON ///
|
||||
@@ -123,12 +123,12 @@ signals:
|
||||
///
|
||||
/// @brief PIPE settings events from Hyperion class to HyperionDaemon components
|
||||
///
|
||||
void settingsChanged(const settings::type& type, const QJsonDocument& data);
|
||||
void settingsChanged(settings::type type, const QJsonDocument& data);
|
||||
|
||||
///
|
||||
/// @brief PIPE component state changes events from Hyperion class to HyperionDaemon components
|
||||
///
|
||||
void compStateChangeRequest(const hyperion::Components component, bool enable);
|
||||
void compStateChangeRequest(hyperion::Components component, bool enable);
|
||||
|
||||
private slots:
|
||||
///
|
||||
@@ -136,13 +136,13 @@ private slots:
|
||||
/// @param type settingyType from enum
|
||||
/// @param config configuration object
|
||||
///
|
||||
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config);
|
||||
void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
|
||||
|
||||
///
|
||||
/// @brief Listen for videoMode changes and emit videoMode in case of a change, update _currVideoMode
|
||||
/// @param mode The requested video mode
|
||||
///
|
||||
void setVideoMode(const VideoMode& mode);
|
||||
void setVideoMode(VideoMode mode);
|
||||
|
||||
private:
|
||||
void createGrabberDispmanx();
|
||||
|
@@ -50,7 +50,7 @@ using namespace commandline;
|
||||
#define PERM0664 QFileDevice::ReadOwner | QFileDevice::ReadGroup | QFileDevice::ReadOther | QFileDevice::WriteOwner | QFileDevice::WriteGroup
|
||||
|
||||
#ifndef _WIN32
|
||||
void signal_handler(const int signum)
|
||||
void signal_handler(int signum)
|
||||
{
|
||||
// Hyperion Managment instance
|
||||
HyperionIManager *_hyperion = HyperionIManager::getInstance();
|
||||
|
@@ -211,7 +211,7 @@ void SysTray::clearEfxColor()
|
||||
_hyperion->clear(1);
|
||||
}
|
||||
|
||||
void SysTray::handleInstanceStateChange(const InstanceState& state, const quint8& instance, const QString& name)
|
||||
void SysTray::handleInstanceStateChange(InstanceState state, quint8 instance, const QString& name)
|
||||
{
|
||||
switch(state){
|
||||
case InstanceState::H_STARTED:
|
||||
|
@@ -35,12 +35,12 @@ private slots:
|
||||
///
|
||||
/// @brief is called whenever the webserver changes the port
|
||||
///
|
||||
void webserverPortChanged(const quint16& port) { _webPort = port; };
|
||||
void webserverPortChanged(quint16 port) { _webPort = port; };
|
||||
|
||||
///
|
||||
/// @brief is called whenever a hyperion instance state changes
|
||||
///
|
||||
void handleInstanceStateChange(const InstanceState& state, const quint8& instance, const QString& name);
|
||||
void handleInstanceStateChange(InstanceState state, quint8 instance, const QString& name);
|
||||
|
||||
private:
|
||||
void createTrayIcon();
|
||||
|
Reference in New Issue
Block a user