remove kodiVideoChecker (#475)

This commit is contained in:
brindosch
2017-11-22 00:52:55 +01:00
committed by GitHub
parent 0f9f3a17e7
commit fa75143dbf
43 changed files with 79 additions and 1198 deletions

View File

@@ -34,7 +34,7 @@ ProtoClientConnection::ProtoClientConnection(QTcpSocket *socket)
// 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)));
connect(_hyperion, SIGNAL(imageToLedsMappingChanged(int)), _imageProcessor, SLOT(setLedMappingType(int)));
}
ProtoClientConnection::~ProtoClientConnection()
@@ -85,27 +85,14 @@ void ProtoClientConnection::socketClosed()
emit connectionClosed(this);
}
void ProtoClientConnection::setGrabbingMode(const GrabbingMode mode)
{
int grabbing_mode = (int)mode;
proto::HyperionReply gMode;
// create proto message
gMode.set_type(proto::HyperionReply::GRABBING);
gMode.set_grabbing(grabbing_mode);
// send message
sendMessage(gMode);
}
void ProtoClientConnection::setVideoMode(const VideoMode videoMode)
{
int video_Mode = (int)videoMode;
proto::HyperionReply vMode;
// create proto message
vMode.set_type(proto::HyperionReply::VIDEO);
vMode.set_grabbing(video_Mode);
vMode.set_video(video_Mode);
// send message
sendMessage(vMode);
@@ -149,7 +136,7 @@ void ProtoClientConnection::handleMessage(const proto::HyperionRequest & message
default:
handleNotImplemented();
}
if (prevPriority != _priority)
{
_hyperion->registerPriority(_priorityChannelName, _priority);

View File

@@ -13,7 +13,6 @@
#include <hyperion/Hyperion.h>
//Utils includes
#include <utils/GrabbingMode.h>
#include <utils/VideoMode.h>
// proto includes
@@ -41,12 +40,11 @@ public:
/// Destructor
///
~ProtoClientConnection();
public slots:
///
/// Send KODI Video Checker message to connected client
/// Send video mode message to connected client
///
void setGrabbingMode(const GrabbingMode mode);
void setVideoMode(const VideoMode videoMode);
signals:
@@ -138,9 +136,9 @@ private:
/// The buffer used for reading data from the socket
QByteArray _receiveBuffer;
int _priority;
QString _priorityChannelName;
/// address of client

View File

@@ -47,7 +47,7 @@ ProtoConnection::~ProtoConnection()
}
void ProtoConnection::readData()
{
{
_receiveBuffer += _socket.readAll();
// check if we can read a message size
@@ -68,18 +68,18 @@ void ProtoConnection::readData()
{
return;
}
// read a message
proto::HyperionReply reply;
if (!reply.ParseFromArray(_receiveBuffer.data() + 4, messageSize))
{
Error(_log, "Unable to parse message");
return;
}
parseReply(reply);
// remove message data from buffer
_receiveBuffer = _receiveBuffer.mid(messageSize + 4);
}
@@ -139,7 +139,7 @@ void ProtoConnection::clearAll()
void ProtoConnection::connectToHost()
{
// try connection only when
// try connection only when
if (_socket.state() == QAbstractSocket::UnconnectedState)
{
_socket.connectToHost(_host, _port);
@@ -201,7 +201,7 @@ void ProtoConnection::sendMessage(const proto::HyperionRequest &message)
bool ProtoConnection::parseReply(const proto::HyperionReply &reply)
{
bool success = false;
switch (reply.type())
{
case proto::HyperionReply::REPLY:
@@ -226,13 +226,6 @@ bool ProtoConnection::parseReply(const proto::HyperionReply &reply)
}
break;
}
case proto::HyperionReply::GRABBING:
{
int grabbing = reply.has_grabbing() ? reply.grabbing() : 7;
GrabbingMode gMode = (GrabbingMode)grabbing;
emit setGrabbingMode(gMode);
break;
}
case proto::HyperionReply::VIDEO:
{
int video = reply.has_video() ? reply.video() : 0;
@@ -241,6 +234,6 @@ bool ProtoConnection::parseReply(const proto::HyperionReply &reply)
break;
}
}
return success;
}

View File

@@ -10,7 +10,6 @@ ProtoConnectionWrapper::ProtoConnectionWrapper(const QString &address,
, _connection(address)
{
_connection.setSkipReply(skipProtoReply);
connect(&_connection, SIGNAL(setGrabbingMode(GrabbingMode)), this, SIGNAL(setGrabbingMode(GrabbingMode)));
connect(&_connection, SIGNAL(setVideoMode(VideoMode)), this, SIGNAL(setVideoMode(VideoMode)));
}

View File

@@ -45,7 +45,7 @@ ProtoServer::~ProtoServer()
foreach (ProtoClientConnection * connection, _openConnections) {
delete connection;
}
while (!_proxy_connections.isEmpty())
delete _proxy_connections.takeFirst();
}
@@ -68,11 +68,9 @@ void ProtoServer::newConnection()
// register slot for cleaning up after the connection closed
connect(connection, SIGNAL(connectionClosed(ProtoClientConnection*)), this, SLOT(closedConnection(ProtoClientConnection*)));
connect(connection, SIGNAL(newMessage(const proto::HyperionRequest*)), this, SLOT(newMessage(const proto::HyperionRequest*)));
// register forward signal for kodi checker
connect(this, SIGNAL(grabbingMode(GrabbingMode)), connection, SLOT(setGrabbingMode(GrabbingMode)));
connect(this, SIGNAL(videoMode(VideoMode)), connection, SLOT(setVideoMode(VideoMode)));
// register forward signal for video mode
connect(this, SIGNAL(videoMode(VideoMode)), connection, SLOT(setVideoMode(VideoMode)));
}
}

View File

@@ -63,22 +63,18 @@ message ClearRequest {
message HyperionReply {
enum Type {
REPLY = 1;
GRABBING = 2;
VIDEO = 3;
VIDEO = 2;
}
// Identifies which field is filled in.
required Type type = 1;
// flag indication success or failure
optional bool success = 2;
// string indicating the reason for failure (if applicable)
optional string error = 3;
// KODI Video Checker Proto Messages for Grabbing mode
optional int32 grabbing = 4;
// KODI Video Checker Proto Messages for Video mode
optional int32 video = 5;
// Proto Messages for video mode
optional int32 video = 4;
}