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:
@@ -10,6 +10,8 @@
|
||||
#include "utils/ColorRgb.h"
|
||||
#include "HyperionConfig.h"
|
||||
|
||||
using namespace hyperion;
|
||||
|
||||
UDPListener::UDPListener(const int priority, const int timeout, const QString& address, quint16 listenPort, bool shared) :
|
||||
QObject(),
|
||||
_hyperion(Hyperion::getInstance()),
|
||||
@@ -80,6 +82,15 @@ void UDPListener::stop()
|
||||
emit statusChanged(_isActive);
|
||||
}
|
||||
|
||||
void UDPListener::componentStateChanged(const hyperion::Components component, bool enable)
|
||||
{
|
||||
if (component == COMP_UDPLISTENER && _isActive != enable)
|
||||
{
|
||||
if (enable) start();
|
||||
else stop();
|
||||
Info(_log, "change state to %s", (enable ? "enabled" : "disabled") );
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t UDPListener::getPort() const
|
||||
{
|
||||
@@ -95,8 +106,7 @@ void UDPListener::readPendingDatagrams()
|
||||
QHostAddress sender;
|
||||
quint16 senderPort;
|
||||
|
||||
_server->readDatagram(datagram.data(), datagram.size(),
|
||||
&sender, &senderPort);
|
||||
_server->readDatagram(datagram.data(), datagram.size(), &sender, &senderPort);
|
||||
|
||||
processTheDatagram(&datagram);
|
||||
|
||||
|
Reference in New Issue
Block a user