mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
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:
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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(
|
||||
|
Reference in New Issue
Block a user