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:
@@ -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)
|
||||
{
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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"))
|
||||
{
|
||||
|
@@ -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);
|
||||
|
@@ -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)));
|
||||
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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:
|
||||
|
||||
|
@@ -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())
|
||||
|
@@ -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)
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user