From 5535b884bfea368e92fc5bd24a2826e0bd9d62b3 Mon Sep 17 00:00:00 2001 From: LordGrey <48840279+Lord-Grey@users.noreply.github.com> Date: Sun, 7 May 2023 14:04:45 +0200 Subject: [PATCH] Fixes (#1605) * Correct misleading Error messages * Fix that Audio Capture is not shown when there is no screen nor video grabber * Fix - Audio Capture enabled after reboot automatically (#1581) --- assets/webconfig/js/content_index.js | 4 +++- libsrc/hyperion/CaptureCont.cpp | 6 +++--- libsrc/hyperion/GrabberWrapper.cpp | 2 +- src/hyperiond/SuspendHandler.cpp | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/assets/webconfig/js/content_index.js b/assets/webconfig/js/content_index.js index 5a5203ca..e8ec28a8 100644 --- a/assets/webconfig/js/content_index.js +++ b/assets/webconfig/js/content_index.js @@ -218,7 +218,9 @@ $(document).ready(function () { loadContent(undefined,true); //Hide capture menu entries, if no grabbers are available - if ((window.serverInfo.grabbers.screen.available.length === 0) && (window.serverInfo.grabbers.video.available.length === 0)) { + if ((window.serverInfo.grabbers.screen.available.length === 0) && + (window.serverInfo.grabbers.video.available.length === 0) && + (window.serverInfo.grabbers.audio.available.length === 0)) { $("#MenuItemGrabber").attr('style', 'display:none') if ((jQuery.inArray("boblight", window.serverInfo.services) === -1)) { $("#MenuItemInstCapture").attr('style', 'display:none') diff --git a/libsrc/hyperion/CaptureCont.cpp b/libsrc/hyperion/CaptureCont.cpp index 4f3a7aae..5ae2a9e5 100644 --- a/libsrc/hyperion/CaptureCont.cpp +++ b/libsrc/hyperion/CaptureCont.cpp @@ -97,7 +97,7 @@ void CaptureCont::setSystemCaptureEnable(bool enable) } else { - disconnect(GlobalSignals::getInstance(), &GlobalSignals::setSystemImage, this, 0); + disconnect(GlobalSignals::getInstance(), &GlobalSignals::setSystemImage, this, nullptr); _hyperion->clear(_systemCaptPrio); _systemInactiveTimer->stop(); _systemCaptName = ""; @@ -120,7 +120,7 @@ void CaptureCont::setV4LCaptureEnable(bool enable) } else { - disconnect(GlobalSignals::getInstance(), &GlobalSignals::setV4lImage, this, 0); + disconnect(GlobalSignals::getInstance(), &GlobalSignals::setV4lImage, this, nullptr); _hyperion->clear(_v4lCaptPrio); _v4lInactiveTimer->stop(); _v4lCaptName = ""; @@ -143,7 +143,7 @@ void CaptureCont::setAudioCaptureEnable(bool enable) } else { - disconnect(GlobalSignals::getInstance(), &GlobalSignals::setAudioImage, this, 0); + disconnect(GlobalSignals::getInstance(), &GlobalSignals::setAudioImage, this, nullptr); _hyperion->clear(_audioCaptPrio); _audioInactiveTimer->stop(); _audioCaptName = ""; diff --git a/libsrc/hyperion/GrabberWrapper.cpp b/libsrc/hyperion/GrabberWrapper.cpp index 4d88a6f2..e0e4a27c 100644 --- a/libsrc/hyperion/GrabberWrapper.cpp +++ b/libsrc/hyperion/GrabberWrapper.cpp @@ -290,7 +290,7 @@ void GrabberWrapper::handleSourceRequest(hyperion::Components component, int hyp else GRABBER_AUDIO_CLIENTS.remove(hyperionInd); - if (GRABBER_AUDIO_CLIENTS.empty()) + if (GRABBER_AUDIO_CLIENTS.empty() || !getAudioGrabberState()) stop(); else start(); diff --git a/src/hyperiond/SuspendHandler.cpp b/src/hyperiond/SuspendHandler.cpp index a2014ef6..b680b3ea 100644 --- a/src/hyperiond/SuspendHandler.cpp +++ b/src/hyperiond/SuspendHandler.cpp @@ -268,7 +268,7 @@ SuspendHandlerLinux::SuspendHandlerLinux() QDBusConnection systemBus = QDBusConnection::systemBus(); if (!systemBus.isConnected()) { - Error(Logger::getInstance("DAEMON"), "Suspend/resume handler - System bus is not connected"); + Info(Logger::getInstance("DAEMON"), "The suspend/resume feature is not supported by your system configuration"); } else { @@ -288,7 +288,7 @@ SuspendHandlerLinux::SuspendHandlerLinux() QDBusConnection sessionBus = QDBusConnection::sessionBus(); if (!sessionBus.isConnected()) { - Error(Logger::getInstance("DAEMON"), "Lock/unlock handler- Session bus is not connected"); + Info(Logger::getInstance("DAEMON"), "The lock/unlock feature is not supported by your system configuration"); } else {