2013-08-11 21:49:11 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <QColor>
|
|
|
|
#include <QImage>
|
2013-08-13 19:31:56 +02:00
|
|
|
#include <QTcpSocket>
|
2013-08-11 21:49:11 +02:00
|
|
|
|
|
|
|
#include <json/json.h>
|
|
|
|
|
2013-08-13 19:45:17 +02:00
|
|
|
#include "ColorTransformValues.h"
|
2013-08-13 19:31:56 +02:00
|
|
|
|
2013-08-11 21:49:11 +02:00
|
|
|
class Connection
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Connection(const std::string & address, bool printJson);
|
|
|
|
~Connection();
|
|
|
|
|
|
|
|
bool setColor(QColor color, int priority, int duration);
|
|
|
|
bool setImage(QImage image, int priority, int duration);
|
|
|
|
bool listPriorities();
|
|
|
|
bool clear(int priority);
|
|
|
|
bool clearAll();
|
2013-08-13 19:45:17 +02:00
|
|
|
bool setTransform(ColorTransformValues * threshold, ColorTransformValues * gamma, ColorTransformValues * blacklevel, ColorTransformValues * whitelevel);
|
2013-08-11 21:49:11 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool sendMessage(const Json::Value & message);
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool _printJson;
|
2013-08-13 19:31:56 +02:00
|
|
|
|
|
|
|
QTcpSocket _socket;
|
2013-08-11 21:49:11 +02:00
|
|
|
};
|