diff --git a/include/base/ComponentController.h b/include/base/ComponentController.h index 78c1671df..c1bcc2764 100644 --- a/include/base/ComponentController.h +++ b/include/base/ComponentController.h @@ -15,7 +15,7 @@ class ComponentController : public QObject Q_OBJECT public: - ComponentController(HyperHdrInstance* hyperhdr); + ComponentController(HyperHdrInstance* hyperhdr, bool disableOnStartup); virtual ~ComponentController(); int isComponentEnabled(hyperhdr::Components comp) const; @@ -35,4 +35,5 @@ private slots: Logger* _log; std::map _componentStates; std::map _prevComponentStates; + bool _disableOnStartup; }; diff --git a/include/base/HyperHdrInstance.h b/include/base/HyperHdrInstance.h index 2cb602bcb..1abad9717 100644 --- a/include/base/HyperHdrInstance.h +++ b/include/base/HyperHdrInstance.h @@ -51,7 +51,7 @@ class HyperHdrInstance : public QObject Q_OBJECT public: - HyperHdrInstance(quint8 instance, bool readonlyMode, QString name); + HyperHdrInstance(quint8 instance, bool readonlyMode, bool disableOnstartup, QString name); ~HyperHdrInstance(); quint8 getInstanceIndex() const { return _instIndex; } @@ -158,6 +158,7 @@ private slots: QString _name; bool _readOnlyMode; + bool _disableOnStartup; static std::atomic _signalTerminate; static std::atomic _totalRunningCount; diff --git a/include/base/HyperHdrManager.h b/include/base/HyperHdrManager.h index 50f4cfc32..1d5b0ed18 100644 --- a/include/base/HyperHdrManager.h +++ b/include/base/HyperHdrManager.h @@ -54,7 +54,7 @@ public slots: QVector getInstanceData() const; - bool startInstance(quint8 inst, QObject* caller = nullptr, int tan = 0); + bool startInstance(quint8 inst, QObject* caller = nullptr, int tan = 0, bool disableOnStartup = false); bool stopInstance(quint8 inst); @@ -97,7 +97,7 @@ private slots: HyperHdrManager(const QString& rootPath, bool readonlyMode); - void startAll(); + void startAll(bool disableOnStartup); void stopAllonExit(); diff --git a/include/leddevice/LedDevice.h b/include/leddevice/LedDevice.h index 2c8b127bb..f1199b8c5 100644 --- a/include/leddevice/LedDevice.h +++ b/include/leddevice/LedDevice.h @@ -70,6 +70,7 @@ public slots: void blinking(QJsonObject params); void smoothingRestarted(int newSmoothingInterval); int hasLedClock(); + void pauseRetryTimer(bool mode); signals: void SignalEnableStateChanged(bool newState); @@ -155,4 +156,5 @@ protected slots: int _blinkIndex; qint64 _blinkTime; int _instanceIndex; + int _pauseRetryTimer; }; diff --git a/include/leddevice/LedDeviceWrapper.h b/include/leddevice/LedDeviceWrapper.h index 50b8555d8..50a27cd19 100644 --- a/include/leddevice/LedDeviceWrapper.h +++ b/include/leddevice/LedDeviceWrapper.h @@ -22,7 +22,7 @@ class LedDeviceWrapper : public QObject explicit LedDeviceWrapper(HyperHdrInstance* ownerInstance); virtual ~LedDeviceWrapper(); - void createLedDevice(QJsonObject config, int smoothingInterval); + void createLedDevice(QJsonObject config, int smoothingInterval, bool disableOnStartup); static QJsonObject getLedDeviceSchemas(); static int addToDeviceMap(QString name, LedDeviceCreateFuncType funcPtr); static const LedDeviceRegistry& getDeviceMap(); diff --git a/sources/base/ComponentController.cpp b/sources/base/ComponentController.cpp index 6d70b84c9..c61ca7fe1 100644 --- a/sources/base/ComponentController.cpp +++ b/sources/base/ComponentController.cpp @@ -8,8 +8,9 @@ using namespace hyperhdr; -ComponentController::ComponentController(HyperHdrInstance* hyperhdr) - : _log(Logger::getInstance(QString("COMPONENTCTRL%1").arg(hyperhdr->getInstanceIndex()))) +ComponentController::ComponentController(HyperHdrInstance* hyperhdr, bool disableOnStartup): + _log(Logger::getInstance(QString("COMPONENTCTRL%1").arg(hyperhdr->getInstanceIndex()))), + _disableOnStartup(disableOnStartup) { // init all comps to false QVector vect; @@ -27,7 +28,7 @@ ComponentController::ComponentController(HyperHdrInstance* hyperhdr) connect(this, &ComponentController::SignalRequestComponent, hyperhdr, &HyperHdrInstance::SignalRequestComponent); connect(hyperhdr, &HyperHdrInstance::SignalRequestComponent, this, &ComponentController::handleCompStateChangeRequest); - Debug(_log, "ComponentController is initialized"); + Debug(_log, "ComponentController is initialized. Components are %s", (_disableOnStartup) ? "DISABLED" : "ENABLED"); } ComponentController::~ComponentController() @@ -41,11 +42,17 @@ void ComponentController::handleCompStateChangeRequest(hyperhdr::Components comp { if (!activated && _prevComponentStates.empty()) { + bool disableLeds = _disableOnStartup && !isComponentEnabled(COMP_ALL) && _prevComponentStates.empty(); + Debug(_log, "Disabling HyperHDR instance: saving current component states first"); for (const auto& comp : _componentStates) if (comp.first != COMP_ALL) { - _prevComponentStates.emplace(comp.first, comp.second); + if (disableLeds && comp.first == COMP_LEDDEVICE) + _prevComponentStates.emplace(comp.first, true); + else + _prevComponentStates.emplace(comp.first, comp.second); + if (comp.second) { emit SignalRequestComponent(comp.first, false); diff --git a/sources/base/HyperHdrInstance.cpp b/sources/base/HyperHdrInstance.cpp index 6fcbe4b50..f62ff0bf6 100644 --- a/sources/base/HyperHdrInstance.cpp +++ b/sources/base/HyperHdrInstance.cpp @@ -67,7 +67,7 @@ std::atomic HyperHdrInstance::_signalTerminate(false); std::atomic HyperHdrInstance::_totalRunningCount(0); -HyperHdrInstance::HyperHdrInstance(quint8 instance, bool readonlyMode, QString name) +HyperHdrInstance::HyperHdrInstance(quint8 instance, bool readonlyMode, bool disableOnStartup, QString name) : QObject() , _instIndex(instance) , _bootEffect(QTime::currentTime().addSecs(5)) @@ -90,6 +90,7 @@ HyperHdrInstance::HyperHdrInstance(quint8 instance, bool readonlyMode, QString n , _currentLedColors() , _name((name.isEmpty()) ? QString("INSTANCE%1").arg(instance) : name) , _readOnlyMode(readonlyMode) + , _disableOnStartup(disableOnStartup) { _totalRunningCount++; } @@ -142,7 +143,7 @@ void HyperHdrInstance::start() Info(_log, "Starting the instance"); _instanceConfig = std::unique_ptr(new InstanceConfig(false, _instIndex, this, _readOnlyMode)); - _componentController = std::unique_ptr(new ComponentController(this)); + _componentController = std::unique_ptr(new ComponentController(this, _disableOnStartup)); connect(_componentController.get(), &ComponentController::SignalComponentStateChanged, this, &HyperHdrInstance::SignalComponentStateChanged); _ledString = LedString::createLedString(getSetting(settings::type::LEDS).array(), LedString::createColorOrder(getSetting(settings::type::DEVICE).object())); _muxer = std::unique_ptr(new Muxer(_instIndex, static_cast(_ledString.leds().size()), this)); @@ -184,7 +185,7 @@ void HyperHdrInstance::start() _ledDeviceWrapper = std::unique_ptr(new LedDeviceWrapper(this)); connect(this, &HyperHdrInstance::SignalRequestComponent, _ledDeviceWrapper.get(), &LedDeviceWrapper::handleComponentState); - _ledDeviceWrapper->createLedDevice(ledDevice, _smoothing->GetSuggestedInterval()); + _ledDeviceWrapper->createLedDevice(ledDevice, _smoothing->GetSuggestedInterval(), _disableOnStartup); // create the effect engine; needs to be initialized after smoothing! _effectEngine = std::unique_ptr(new EffectEngine(this)); @@ -222,6 +223,12 @@ void HyperHdrInstance::start() // instance initiated, enter thread event loop emit SignalInstanceJustStarted(); + if (_disableOnStartup) + { + _componentController->setNewComponentState(hyperhdr::COMP_ALL, false); + Warning(_log, "The user has disabled LEDs auto-start in the configuration (interface: 'General' tab)"); + } + // exit Info(_log, "The instance is running"); } @@ -295,9 +302,7 @@ void HyperHdrInstance::handleSettingsUpdate(settings::type type, const QJsonDocu // do always reinit until the led devices can handle dynamic changes dev["currentLedCount"] = _hwLedCount; // Inject led count info - _ledDeviceWrapper->createLedDevice(dev, _smoothing->GetSuggestedInterval()); - - // TODO: Check, if framegrabber frequency is lower than latchtime..., if yes, stop + _ledDeviceWrapper->createLedDevice(dev, _smoothing->GetSuggestedInterval(), false); } else if (type == settings::type::BGEFFECT || type == settings::type::FGEFFECT) { @@ -684,9 +689,15 @@ void HyperHdrInstance::handlePriorityChangedLedDevice(const quint8& priority) if (previousPriority == Muxer::LOWEST_PRIORITY) { Info(_log, "New source available -> switch LED-Device on"); - - emit SignalRequestComponent(hyperhdr::COMP_LEDDEVICE, true); - emit GlobalSignals::getInstance()->SignalPerformanceStateChanged(true, hyperhdr::PerformanceReportType::INSTANCE, getInstanceIndex(), _name); + if (!isComponentEnabled(hyperhdr::Components::COMP_ALL)) + { + Warning(_log, "Components are disabled: ignoring switching LED-Device on"); + } + else + { + emit SignalRequestComponent(hyperhdr::COMP_LEDDEVICE, true); + emit GlobalSignals::getInstance()->SignalPerformanceStateChanged(true, hyperhdr::PerformanceReportType::INSTANCE, getInstanceIndex(), _name); + } } } } diff --git a/sources/base/HyperHdrManager.cpp b/sources/base/HyperHdrManager.cpp index 540f4b464..0af6e523f 100644 --- a/sources/base/HyperHdrManager.cpp +++ b/sources/base/HyperHdrManager.cpp @@ -102,7 +102,7 @@ bool HyperHdrManager::areInstancesReady() return (--_fireStarter == 0); } -void HyperHdrManager::startAll() +void HyperHdrManager::startAll(bool disableOnStartup) { auto instanceList = _instanceTable->getAllInstances(true); @@ -110,7 +110,7 @@ void HyperHdrManager::startAll() for (const auto& entry : instanceList) { - startInstance(entry["instance"].toInt()); + startInstance(entry["instance"].toInt(), nullptr, 0, disableOnStartup); } } @@ -179,7 +179,7 @@ void HyperHdrManager::hibernate(bool wakeUp) } } -bool HyperHdrManager::startInstance(quint8 inst, QObject* caller, int tan) +bool HyperHdrManager::startInstance(quint8 inst, QObject* caller, int tan, bool disableOnStartup) { if (_instanceTable->instanceExist(inst)) { @@ -191,6 +191,7 @@ bool HyperHdrManager::startInstance(quint8 inst, QObject* caller, int tan) auto hyperhdr = std::shared_ptr( new HyperHdrInstance(inst, _readonlyMode, + disableOnStartup, _instanceTable->getNamebyIndex(inst)), [](HyperHdrInstance* oldInstance) { THREAD_REMOVER(QString("HyperHDR instance at index = %1").arg(oldInstance->getInstanceIndex()), diff --git a/sources/base/schema/schema-general.json b/sources/base/schema/schema-general.json index c13a9125c..0edda76b8 100644 --- a/sources/base/schema/schema-general.json +++ b/sources/base/schema/schema-general.json @@ -32,6 +32,24 @@ "hidden":true }, "propertyOrder" : 4 + }, + "disableOnLocked" : + { + "type" : "boolean", + "format": "checkbox", + "title" : "edt_conf_gen_disableOnLocked_title", + "default" : false, + "required" : true, + "propertyOrder" : 5 + }, + "disableLedsStartup" : + { + "type" : "boolean", + "format": "checkbox", + "title" : "edt_conf_gen_disableLedsStartup_title", + "default" : false, + "required" : true, + "propertyOrder" : 6 } }, diff --git a/sources/grabber/DX/DxGrabber.cpp b/sources/grabber/DX/DxGrabber.cpp index c808b9110..ed330dc10 100644 --- a/sources/grabber/DX/DxGrabber.cpp +++ b/sources/grabber/DX/DxGrabber.cpp @@ -313,6 +313,8 @@ void DxGrabber::stop() _timer->stop(); Info(_log, "Stopped"); } + + _retryTimer->stop(); } bool DxGrabber::initDirectX(QString selectedDeviceName) diff --git a/sources/hyperhdr/HyperHdrDaemon.cpp b/sources/hyperhdr/HyperHdrDaemon.cpp index 08a38ff29..c4411d782 100644 --- a/sources/hyperhdr/HyperHdrDaemon.cpp +++ b/sources/hyperhdr/HyperHdrDaemon.cpp @@ -82,6 +82,7 @@ HyperHdrDaemon::HyperHdrDaemon(const QString& rootPath, QApplication* parent, bo , _rootPath(rootPath) , _params(params) , _isGuiApp(isGuiApp) + , _disableOnStart(false) { // Register metas for thread queued connection @@ -166,7 +167,9 @@ HyperHdrDaemon::HyperHdrDaemon(const QString& rootPath, QApplication* parent, bo // spawn all Hyperhdr instances (non blocking) settingsChangedHandler(settings::type::VIDEOGRABBER, getSetting(settings::type::VIDEOGRABBER)); settingsChangedHandler(settings::type::SYSTEMGRABBER, getSetting(settings::type::SYSTEMGRABBER)); - _instanceManager->startAll(); + QJsonObject genConfig = getSetting(settings::type::GENERAL).object(); + _disableOnStart = genConfig["disableLedsStartup"].toBool(false); + _instanceManager->startAll(_disableOnStart); //Cleaning up Hyperhdr before quit connect(parent, &QCoreApplication::aboutToQuit, this, &HyperHdrDaemon::freeObjects); @@ -177,7 +180,9 @@ HyperHdrDaemon::HyperHdrDaemon(const QString& rootPath, QApplication* parent, bo // power management #if defined(HAVE_POWER_MANAGEMENT) - _suspendHandler = std::unique_ptr(new SuspendHandler()); + bool lockedEnable = genConfig["disableOnLocked"].toBool(false); + + _suspendHandler = std::unique_ptr(new SuspendHandler(lockedEnable)); connect(_suspendHandler.get(), &SuspendHandler::SignalHibernate, _instanceManager.get(), &HyperHdrManager::hibernate); #ifdef _WIN32 @@ -223,6 +228,12 @@ void HyperHdrDaemon::instanceStateChangedHandler(InstanceState state, quint8 ins { _networkThread->start(); } + + if (_disableOnStart) + { + Warning(_log, "The user has disabled LEDs auto-start in the configuration (interface: 'General' tab)"); + _instanceManager->toggleStateAllInstances(false); + } } } } diff --git a/sources/hyperhdr/HyperHdrDaemon.h b/sources/hyperhdr/HyperHdrDaemon.h index 38b4bf915..443bd0e6d 100644 --- a/sources/hyperhdr/HyperHdrDaemon.h +++ b/sources/hyperhdr/HyperHdrDaemon.h @@ -170,5 +170,6 @@ public slots: bool _readonlyMode; QStringList _params; bool _isGuiApp; + bool _disableOnStart; }; diff --git a/sources/hyperhdr/SuspendHandlerLinux.cpp b/sources/hyperhdr/SuspendHandlerLinux.cpp index 46b45a96d..9692edda4 100644 --- a/sources/hyperhdr/SuspendHandlerLinux.cpp +++ b/sources/hyperhdr/SuspendHandlerLinux.cpp @@ -46,7 +46,7 @@ namespace { const QString UPOWER_INTER = QStringLiteral("org.freedesktop.login1.Manager"); } -SuspendHandler::SuspendHandler() +SuspendHandler::SuspendHandler(bool sessionLocker) { QDBusConnection bus = QDBusConnection::systemBus(); diff --git a/sources/hyperhdr/SuspendHandlerLinux.h b/sources/hyperhdr/SuspendHandlerLinux.h index 9f76d6f10..fb46b61b8 100644 --- a/sources/hyperhdr/SuspendHandlerLinux.h +++ b/sources/hyperhdr/SuspendHandlerLinux.h @@ -37,7 +37,7 @@ class SuspendHandler : public QObject { void SignalHibernate(bool wakeUp); public: - SuspendHandler(); + SuspendHandler(bool sessionLocker = false); ~SuspendHandler(); public slots: diff --git a/sources/hyperhdr/SuspendHandlerMacOS.h b/sources/hyperhdr/SuspendHandlerMacOS.h index aca0904ed..182ec5263 100644 --- a/sources/hyperhdr/SuspendHandlerMacOS.h +++ b/sources/hyperhdr/SuspendHandlerMacOS.h @@ -37,6 +37,6 @@ class SuspendHandler : public QObject { void SignalHibernate(bool wakeUp); public: - SuspendHandler(); + SuspendHandler(bool sessionLocker = false); ~SuspendHandler(); }; diff --git a/sources/hyperhdr/SuspendHandlerMacOS.mm b/sources/hyperhdr/SuspendHandlerMacOS.mm index 018410c2f..ab7770d39 100644 --- a/sources/hyperhdr/SuspendHandlerMacOS.mm +++ b/sources/hyperhdr/SuspendHandlerMacOS.mm @@ -89,7 +89,7 @@ - (void)goingWake: (NSNotification*)note @end -SuspendHandler::SuspendHandler() +SuspendHandler::SuspendHandler(bool sessionLocker) { _macSuspendHandlerInstance = [MacSuspendHandler new]; _suspendHandler = this; diff --git a/sources/hyperhdr/SuspendHandlerWindows.cpp b/sources/hyperhdr/SuspendHandlerWindows.cpp index 9e910b05b..baed1d029 100644 --- a/sources/hyperhdr/SuspendHandlerWindows.cpp +++ b/sources/hyperhdr/SuspendHandlerWindows.cpp @@ -37,8 +37,11 @@ #include #include #include +#include -SuspendHandler::SuspendHandler() +#pragma comment (lib, "WtsApi32.Lib") + +SuspendHandler::SuspendHandler(bool sessionLocker) { auto handle = reinterpret_cast (_widget.winId()); _notifyHandle = RegisterSuspendResumeNotification(handle, DEVICE_NOTIFY_WINDOW_HANDLE); @@ -46,7 +49,19 @@ SuspendHandler::SuspendHandler() if (_notifyHandle == NULL) std::cout << "COULD NOT REGISTER SLEEP HANDLER!" << std::endl; else - std::cout << "SLEEP HANDLER REGISTERED!" << std::endl; + std::cout << "Sleep handler registered!" << std::endl; + + _sessionLocker = sessionLocker; + if (_sessionLocker) + { + if (WTSRegisterSessionNotification(handle, NOTIFY_FOR_THIS_SESSION)) + std::cout << "Session handler registered!" << std::endl; + else + { + std::cout << "COULD NOT REGISTER SESSION HANDLER!" << std::endl; + _sessionLocker = false; + } + } } SuspendHandler::~SuspendHandler() @@ -54,9 +69,15 @@ SuspendHandler::~SuspendHandler() if (_notifyHandle != NULL) { UnregisterSuspendResumeNotification(_notifyHandle); - std::cout << "SLEEP HANDLER DEREGISTERED!" << std::endl; + std::cout << "Sleep handler deregistered!" << std::endl; } _notifyHandle = NULL; + + if (_sessionLocker) + { + auto handle = reinterpret_cast (_widget.winId()); + WTSUnRegisterSessionNotification(handle); + } } #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) @@ -81,6 +102,34 @@ bool SuspendHandler::nativeEventFilter(const QByteArray& eventType, void* messag break; } } + + if (_sessionLocker) + { + if (msg->message == WM_WTSSESSION_CHANGE) + { + switch (msg->wParam) + { + case WTS_SESSION_UNLOCK: + emit SignalHibernate(true); + return true; + break; + + case WTS_SESSION_LOCK: + + if (GetSystemMetrics(SM_REMOTESESSION) != 0) + { + std::cout << "Detected RDP session. Skipping disable on lock." << std::endl; + } + else + { + emit SignalHibernate(false); + return true; + } + break; + } + } + } + return false; } diff --git a/sources/hyperhdr/SuspendHandlerWindows.h b/sources/hyperhdr/SuspendHandlerWindows.h index 0b7903d01..979aa8dd0 100644 --- a/sources/hyperhdr/SuspendHandlerWindows.h +++ b/sources/hyperhdr/SuspendHandlerWindows.h @@ -40,12 +40,13 @@ class SuspendHandler : public QObject, public QAbstractNativeEventFilter { QWidget _widget; HPOWERNOTIFY _notifyHandle; + bool _sessionLocker; signals: void SignalHibernate(bool wakeUp); public: - SuspendHandler(); + SuspendHandler(bool sessionLocker = false); ~SuspendHandler(); #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) virtual bool nativeEventFilter(const QByteArray& eventType, void* message, long* result) Q_DECL_OVERRIDE; diff --git a/sources/leddevice/LedDevice.cpp b/sources/leddevice/LedDevice.cpp index b290cfea1..210e5a3dd 100644 --- a/sources/leddevice/LedDevice.cpp +++ b/sources/leddevice/LedDevice.cpp @@ -40,6 +40,7 @@ LedDevice::LedDevice(const QJsonObject& deviceConfig, QObject* parent) , _blinkIndex(-1) , _blinkTime(0) , _instanceIndex(-1) + , _pauseRetryTimer(-1) { std::shared_ptr discoveryWrapper = nullptr; emit GlobalSignals::getInstance()->SignalGetDiscoveryWrapper(discoveryWrapper); @@ -203,10 +204,36 @@ void LedDevice::start() } } +void LedDevice::pauseRetryTimer(bool mode) +{ + if (mode) + { + if (_pauseRetryTimer < 0) + { + _pauseRetryTimer = (_retryTimer != nullptr && _retryTimer->isActive()) ? _retryTimer->interval() : 0; + Debug(_log, "Saving retryTimer (interval: %i)", _pauseRetryTimer); + stopRetryTimer(); + } + } + else + { + if (_pauseRetryTimer >= 0) + { + Debug(_log, "Restoring retryTimer (interval: %i)", _pauseRetryTimer); + if (_pauseRetryTimer > 0 && !_isOn) + { + setupRetry(_pauseRetryTimer); + } + _pauseRetryTimer = -1; + } + } +} + void LedDevice::enable() { if (!_signalTerminate) { + _pauseRetryTimer = -1; stopRetryTimer(); if (!_isDeviceInitialised && init(_devConfig)) diff --git a/sources/leddevice/LedDeviceWrapper.cpp b/sources/leddevice/LedDeviceWrapper.cpp index 0ad255e78..af1554c04 100644 --- a/sources/leddevice/LedDeviceWrapper.cpp +++ b/sources/leddevice/LedDeviceWrapper.cpp @@ -44,7 +44,7 @@ LedDeviceWrapper::~LedDeviceWrapper() _ledDevice.reset(); } -void LedDeviceWrapper::createLedDevice(QJsonObject config, int smoothingInterval) +void LedDeviceWrapper::createLedDevice(QJsonObject config, int smoothingInterval, bool disableOnStartup) { _ledDevice.reset(); @@ -63,7 +63,8 @@ void LedDeviceWrapper::createLedDevice(QJsonObject config, int smoothingInterval _ledDevice->moveToThread(thread); // setup thread management - connect(thread, &QThread::started, _ledDevice.get(), &LedDevice::start); + if (!disableOnStartup) + connect(thread, &QThread::started, _ledDevice.get(), &LedDevice::start); connect(thread, &QThread::finished, _ledDevice.get(), &LedDevice::stop); connect(_ownerInstance, &HyperHdrInstance::SignalSmoothingRestarted, _ledDevice.get(), &LedDevice::smoothingRestarted, Qt::QueuedConnection); connect(_ledDevice.get(), &LedDevice::SignalEnableStateChanged, this, &LedDeviceWrapper::handleInternalEnableState, Qt::QueuedConnection); @@ -88,6 +89,11 @@ void LedDeviceWrapper::handleComponentState(hyperhdr::Components component, bool QUEUE_CALL_0(_ledDevice.get(), disable); } } + + if (component == hyperhdr::COMP_ALL) + { + QUEUE_CALL_1(_ledDevice.get(), pauseRetryTimer, bool, (!state)); + } } void LedDeviceWrapper::handleInternalEnableState(bool newState) diff --git a/www/i18n/en.json b/www/i18n/en.json index a32b093a6..76f939c9c 100644 --- a/www/i18n/en.json +++ b/www/i18n/en.json @@ -1237,5 +1237,9 @@ "edt_conf_hardware_expl" : "Enable hardware acceleration, for example: pixel and vertex shaders on Windows", "edt_conf_monitor_nits_title" : "HDR brightness correction", "edt_conf_monitor_nits_expl" : "SDR target brightness used for HDR to SDR conversion. If 0, it disables hardware color conversion while maintaining accelerated scaling.", - "edt_append_nits" : "nits" -} + "edt_append_nits" : "nits", + "edt_conf_gen_disableOnLocked_title" : "Disable when locked", + "edt_conf_gen_disableOnLocked_expl" : "Turn off processing when the user has locked the system", + "edt_conf_gen_disableLedsStartup_title" : "Turn off LEDs at startup", + "edt_conf_gen_disableLedsStartup_expl" : "Disable LEDs and all components on startup, you must re-enable them manually on the main page or via the JSON API (COMP_ALL component)" +} diff --git a/www/js/general.js b/www/js/general.js index 930635ccd..67a9abea3 100644 --- a/www/js/general.js +++ b/www/js/general.js @@ -235,5 +235,15 @@ $(document).ready(function() createHint("intro", $.i18n('conf_general_inst_desc'), "inst_desc_cont"); } + if (window.serverInfo.grabbers != null && window.serverInfo.grabbers != undefined && + window.serverInfo.grabbers.active != null && window.serverInfo.grabbers.active != undefined) + { + var grabbers = window.serverInfo.grabbers.active; + if (grabbers.indexOf('Media Foundation') < 0) + { + conf_editor.getEditor('root.general.disableOnLocked').disable(); + } + } + removeOverlay(); });