every input sources trackes now its priority and ID to hyperion core

ATM all input sources except inputs via proto are tracked
This commit is contained in:
redpanther
2016-07-15 23:08:55 +02:00
parent 5432aa7d27
commit 505b83f028
12 changed files with 94 additions and 38 deletions

View File

@@ -22,15 +22,15 @@
// project includes
#include "BoblightClientConnection.h"
BoblightClientConnection::BoblightClientConnection(QTcpSocket *socket, const int priority, Hyperion * hyperion)
BoblightClientConnection::BoblightClientConnection(QTcpSocket *socket, const int priority)
: QObject()
, _locale(QLocale::C)
, _socket(socket)
, _imageProcessor(ImageProcessorFactory::getInstance().newImageProcessor())
, _hyperion(hyperion)
, _hyperion(Hyperion::getInstance())
, _receiveBuffer()
, _priority(priority)
, _ledColors(hyperion->getLedCount(), ColorRgb::BLACK)
, _ledColors(Hyperion::getInstance()->getLedCount(), ColorRgb::BLACK)
, _log(Logger::getInstance("BOBLIGHT"))
{
// initalize the locale. Start with the default C-locale

View File

@@ -27,7 +27,7 @@ public:
/// @param socket The Socket object for this connection
/// @param hyperion The Hyperion server
///
BoblightClientConnection(QTcpSocket * socket, const int priority, Hyperion * hyperion);
BoblightClientConnection(QTcpSocket * socket, const int priority);
///
/// Destructor

View File

@@ -37,6 +37,9 @@ void BoblightServer::start()
_isActive = true;
emit statusChanged(_isActive);
_hyperion->registerPriority("Boblight", _priority);
}
void BoblightServer::stop()
@@ -49,6 +52,9 @@ void BoblightServer::stop()
}
_isActive = false;
emit statusChanged(_isActive);
_hyperion->unRegisterPriority("Boblight");
}
@@ -64,7 +70,7 @@ void BoblightServer::newConnection()
if (socket != nullptr)
{
Info(_log, "new connection");
BoblightClientConnection * connection = new BoblightClientConnection(socket, _priority, _hyperion);
BoblightClientConnection * connection = new BoblightClientConnection(socket, _priority);
_openConnections.insert(connection);
// register slot for cleaning up after the connection closed