Manual input source select via json (#143)

* implement manual source select via json interface
fix schema error

* refactoring

* add visible value to all listed prios
This commit is contained in:
redPanther
2016-07-31 22:21:35 +02:00
committed by GitHub
parent 04ab2f05f7
commit 722d4eb357
14 changed files with 208 additions and 47 deletions

View File

@@ -7,9 +7,9 @@
// hyperion-remote includes
#include "JsonConnection.h"
JsonConnection::JsonConnection(const std::string & a, bool printJson) :
_printJson(printJson),
_socket()
JsonConnection::JsonConnection(const std::string & a, bool printJson)
: _printJson(printJson)
, _socket()
{
QString address(a.c_str());
QStringList parts = address.split(":");
@@ -192,6 +192,34 @@ void JsonConnection::clearAll()
parseReply(reply);
}
void JsonConnection::setSource(int priority)
{
// create command
Json::Value command;
command["command"] = "sourceselect";
command["priority"] = priority;
// send command message
Json::Value reply = sendMessage(command);
// parse reply message
parseReply(reply);
}
void JsonConnection::setSourceAutoSelect()
{
// create command
Json::Value command;
command["command"] = "sourceselect";
command["auto"] = true;
// send command message
Json::Value reply = sendMessage(command);
// parse reply message
parseReply(reply);
}
void JsonConnection::setTransform(std::string * transformId, double * saturation, double * value, double * saturationL, double * luminance, double * luminanceMin, ColorTransformValues *threshold, ColorTransformValues *gamma, ColorTransformValues *blacklevel, ColorTransformValues *whitelevel)
{
std::cout << "Set color transforms" << std::endl;