mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
enable components at runtime + grabber refactoring (#160)
* implement enable/disable on runtime for: - smoothing - kodi - udplistener - boblight * implement enable/disable for forwarder refactor component * - implement grabber enable/disable at runtime - big grabber refactoring. now with common base class for all grabbers * implement enable/disable at runtime for bb detector * osx fix * try to fix cutted travis output for osx build
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
#include <boblightserver/BoblightServer.h>
|
||||
#include "BoblightClientConnection.h"
|
||||
|
||||
using namespace hyperion;
|
||||
|
||||
BoblightServer::BoblightServer(const int priority, uint16_t port)
|
||||
: QObject()
|
||||
, _hyperion(Hyperion::getInstance())
|
||||
@@ -50,6 +52,7 @@ void BoblightServer::stop()
|
||||
foreach (BoblightClientConnection * connection, _openConnections) {
|
||||
delete connection;
|
||||
}
|
||||
_server.close();
|
||||
_isActive = false;
|
||||
emit statusChanged(_isActive);
|
||||
|
||||
@@ -57,6 +60,15 @@ void BoblightServer::stop()
|
||||
|
||||
}
|
||||
|
||||
void BoblightServer::componentStateChanged(const hyperion::Components component, bool enable)
|
||||
{
|
||||
if (component == COMP_BOBLIGHTSERVER && _isActive != enable)
|
||||
{
|
||||
if (enable) start();
|
||||
else stop();
|
||||
Info(_log, "change state to %s", (enable ? "enabled" : "disabled") );
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t BoblightServer::getPort() const
|
||||
{
|
||||
|
Reference in New Issue
Block a user