mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
implement origin for effects (#408)
* implement rigin for efx * implement origin for effects and other components add experimental adalight firmware for arduino with upto 5 pwm channels * cleanup * origin ip now with dns lookup * fix compile * move some code
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include <QRgb>
|
||||
#include <QResource>
|
||||
#include <QDateTime>
|
||||
#include <QHostInfo>
|
||||
|
||||
// hyperion util includes
|
||||
#include "hyperion/ImageProcessorFactory.h"
|
||||
@@ -27,13 +28,13 @@ ProtoClientConnection::ProtoClientConnection(QTcpSocket *socket)
|
||||
, _hyperion(Hyperion::getInstance())
|
||||
, _receiveBuffer()
|
||||
, _priority(-1)
|
||||
, _priorityChannelName("Proto-Server")
|
||||
, _clientAddress(QHostInfo::fromName(socket->peerAddress().toString()).hostName())
|
||||
{
|
||||
// connect internal signals and slots
|
||||
connect(_socket, SIGNAL(disconnected()), this, SLOT(socketClosed()));
|
||||
connect(_socket, SIGNAL(readyRead()), this, SLOT(readData()));
|
||||
connect(_hyperion, SIGNAL(imageToLedsMappingChanged(int)), _imageProcessor, SLOT(setLedMappingType(int)));
|
||||
|
||||
_priorityChannelName = "proto@"+ _socket->peerAddress().toString().toStdString();
|
||||
}
|
||||
|
||||
ProtoClientConnection::~ProtoClientConnection()
|
||||
@@ -198,7 +199,7 @@ void ProtoClientConnection::handleImageCommand(const proto::ImageRequest &messag
|
||||
|
||||
// process the image
|
||||
std::vector<ColorRgb> ledColors = _imageProcessor->process(image);
|
||||
_hyperion->setColors(_priority, ledColors, duration);
|
||||
_hyperion->setColors(_priority, ledColors, duration, true, hyperion::COMP_PROTOSERVER , "proto@"+_clientAddress);
|
||||
_hyperion->setImage(_priority, image, duration);
|
||||
|
||||
// send reply
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#include <QByteArray>
|
||||
#include <QTcpSocket>
|
||||
#include <QStringList>
|
||||
#include <QString>
|
||||
|
||||
// Hyperion includes
|
||||
#include <hyperion/Hyperion.h>
|
||||
@@ -140,5 +141,8 @@ private:
|
||||
|
||||
int _priority;
|
||||
|
||||
std::string _priorityChannelName;
|
||||
QString _priorityChannelName;
|
||||
|
||||
/// address of client
|
||||
QString _clientAddress;
|
||||
};
|
||||
|
Reference in New Issue
Block a user