mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Proto- and Flatbuffer now share their input to all instances
Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>
This commit is contained in:
@@ -23,7 +23,6 @@ ProtoClientConnection::ProtoClientConnection(QTcpSocket* socket, const int &time
|
||||
, _timeoutTimer(new QTimer(this))
|
||||
, _timeout(timeout * 1000)
|
||||
, _priority()
|
||||
, _hyperion(HyperionIManager::getInstance()->getHyperionInstance())
|
||||
{
|
||||
// timer setup
|
||||
_timeoutTimer->setSingleShot(true);
|
||||
@@ -80,8 +79,8 @@ void ProtoClientConnection::forceClose()
|
||||
void ProtoClientConnection::disconnected()
|
||||
{
|
||||
Debug(_log, "Socket Closed");
|
||||
_socket->deleteLater();
|
||||
_hyperion->clear(_priority);
|
||||
_socket->deleteLater();
|
||||
emit clearGlobalInput(_priority);
|
||||
emit clientDisconnected();
|
||||
}
|
||||
|
||||
@@ -134,13 +133,13 @@ void ProtoClientConnection::handleColorCommand(const proto::ColorRequest &messag
|
||||
// make sure the prio is registered before setColor()
|
||||
if(priority != _priority)
|
||||
{
|
||||
_hyperion->clear(_priority);
|
||||
_hyperion->registerInput(priority, hyperion::COMP_PROTOSERVER, "Proto@"+_clientAddress);
|
||||
emit clearGlobalInput(_priority);
|
||||
emit registerGlobalInput(priority, hyperion::COMP_PROTOSERVER, "Proto@"+_clientAddress);
|
||||
_priority = priority;
|
||||
}
|
||||
|
||||
// set output
|
||||
_hyperion->setColor(_priority, color, duration);
|
||||
emit setGlobalInputColor(_priority, color, duration);
|
||||
|
||||
// send reply
|
||||
sendSuccessReply();
|
||||
@@ -158,8 +157,8 @@ void ProtoClientConnection::handleImageCommand(const proto::ImageRequest &messag
|
||||
// make sure the prio is registered before setInput()
|
||||
if(priority != _priority)
|
||||
{
|
||||
_hyperion->clear(_priority);
|
||||
_hyperion->registerInput(priority, hyperion::COMP_PROTOSERVER, "Proto@"+_clientAddress);
|
||||
emit clearGlobalInput(_priority);
|
||||
emit registerGlobalInput(priority, hyperion::COMP_PROTOSERVER, "Proto@"+_clientAddress);
|
||||
_priority = priority;
|
||||
}
|
||||
|
||||
@@ -174,7 +173,7 @@ void ProtoClientConnection::handleImageCommand(const proto::ImageRequest &messag
|
||||
Image<ColorRgb> image(width, height);
|
||||
memcpy(image.memptr(), imageData.c_str(), imageData.size());
|
||||
|
||||
_hyperion->setInputImage(_priority, image, duration);
|
||||
emit setGlobalInputImage(_priority, image, duration);
|
||||
|
||||
// send reply
|
||||
sendSuccessReply();
|
||||
@@ -187,15 +186,15 @@ void ProtoClientConnection::handleClearCommand(const proto::ClearRequest &messag
|
||||
int priority = message.priority();
|
||||
|
||||
// clear priority
|
||||
_hyperion->clear(priority);
|
||||
emit clearGlobalInput(priority);
|
||||
// send reply
|
||||
sendSuccessReply();
|
||||
}
|
||||
|
||||
void ProtoClientConnection::handleClearallCommand()
|
||||
{
|
||||
// clear priority
|
||||
_hyperion->clearall();
|
||||
// clear all priority
|
||||
emit clearAllGlobalInput();
|
||||
|
||||
// send reply
|
||||
sendSuccessReply();
|
||||
|
Reference in New Issue
Block a user