implement set videomode via json api (#457)

* implement set videomode via json api

* refactor grabbers:
- new base class
- move shared code to base class

* fix osx

* rework all cmakelist files with auto file collection. except leddevices (need further restructuring)

* store current video and grabbing mode

* add json stuff

* remove grabbingmode - we do not want to expose it
This commit is contained in:
redPanther
2017-08-04 23:08:15 +02:00
committed by GitHub
parent 3612ccda75
commit 569e59110e
54 changed files with 375 additions and 659 deletions

View File

@@ -576,6 +576,16 @@ void JsonConnection::setLedMapping(QString mappingType)
parseReply(reply);
}
void JsonConnection::setVideoMode(QString videoMode)
{
QJsonObject command;
command["command"] = QString("videomode");
command["videoMode"] = videoMode.toUpper();
QJsonObject reply = sendMessage(command);
parseReply(reply);
}
QJsonObject JsonConnection::sendMessage(const QJsonObject & message)
{
// serialize message

View File

@@ -165,6 +165,10 @@ public:
/// @param mappingType led mapping type
void setLedMapping(QString mappingType);
// sets video mode 3D/2D
void setVideoMode(QString videoMode);
private:
///
/// Send a json command message and receive its reply

View File

@@ -92,6 +92,7 @@ int main(int argc, char * argv[])
ColorOption & argWAdjust = parser.add<ColorOption> ('W', "whiteAdjustment", "Set the adjustment of the white color (requires colors in hex format as RRGGBB)");
ColorOption & argbAdjust = parser.add<ColorOption> ('b', "blackAdjustment", "Set the adjustment of the black color (requires colors in hex format as RRGGBB)");
Option & argMapping = parser.add<Option> ('m', "ledMapping" , "Set the methode for image to led mapping valid values: multicolor_mean, unicolor_mean");
Option & argVideoMode = parser.add<Option> ('V', "videoMode" , "Set the video mode valid values: 3D, 3DSBS, 3DTAB");
IntOption & argSource = parser.add<IntOption> (0x0, "sourceSelect" , "Set current active priority channel and deactivate auto source switching");
BooleanOption & argSourceAuto = parser.add<BooleanOption>(0x0, "sourceAutoSelect", "Enables auto source, if disabled prio by manual selecting input source");
BooleanOption & argOff = parser.add<BooleanOption>(0x0, "off", "deactivates hyperion");
@@ -118,7 +119,7 @@ int main(int argc, char * argv[])
int commandCount = count({ parser.isSet(argColor), parser.isSet(argImage), parser.isSet(argEffect), parser.isSet(argCreateEffect), parser.isSet(argDeleteEffect),
parser.isSet(argServerInfo), parser.isSet(argSysInfo),parser.isSet(argClear), parser.isSet(argClearAll), parser.isSet(argEnableComponent), parser.isSet(argDisableComponent), colorAdjust,
parser.isSet(argSource), parser.isSet(argSourceAuto), parser.isSet(argOff), parser.isSet(argOn), parser.isSet(argConfigGet), parser.isSet(argSchemaGet), parser.isSet(argConfigSet),
parser.isSet(argMapping) });
parser.isSet(argMapping),parser.isSet(argVideoMode) });
if (commandCount != 1)
{
qWarning() << (commandCount == 0 ? "No command found." : "Multiple commands found.") << " Provide exactly one of the following options:";
@@ -235,6 +236,10 @@ int main(int argc, char * argv[])
{
connection.setLedMapping(argMapping.value(parser));
}
else if (parser.isSet(argVideoMode))
{
connection.setVideoMode(argVideoMode.value(parser));
}
else if (colorAdjust)
{
connection.setAdjustment(