make all prios settable and make prios more consistent

Former-commit-id: f1d1c35063e98389d627f3535d2a94da33a22da4
This commit is contained in:
redpanther
2016-03-08 17:31:56 +01:00
parent 7f4ea9ae7b
commit 0bc725054c
15 changed files with 52 additions and 40 deletions

View File

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

View File

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

View File

@@ -5,11 +5,12 @@
#include <boblightserver/BoblightServer.h>
#include "BoblightClientConnection.h"
BoblightServer::BoblightServer(Hyperion *hyperion, uint16_t port) :
BoblightServer::BoblightServer(Hyperion *hyperion, const int priority,uint16_t port) :
QObject(),
_hyperion(hyperion),
_server(),
_openConnections()
_openConnections(),
_priority(priority)
{
if (!_server.listen(QHostAddress::Any, port))
{
@@ -39,7 +40,7 @@ void BoblightServer::newConnection()
if (socket != nullptr)
{
std::cout << "New boblight connection" << std::endl;
BoblightClientConnection * connection = new BoblightClientConnection(socket, _hyperion);
BoblightClientConnection * connection = new BoblightClientConnection(socket, _priority, _hyperion);
_openConnections.insert(connection);
// register slot for cleaning up after the connection closed