Added configuration to XBMC video checker

Former-commit-id: 82a73ca5a31c7152572f06bff50befd26053d8df
This commit is contained in:
johan
2013-09-24 21:45:27 +02:00
parent f31ed069ef
commit 876100249e
4 changed files with 355 additions and 319 deletions

View File

@@ -181,6 +181,22 @@
"xbmcTcpPort" : {
"type" : "integer",
"required" : true
},
"grabVideo" : {
"type" : "boolean",
"required" : true
},
"grabPictures" : {
"type" : "boolean",
"required" : true
},
"grabAudio" : {
"type" : "boolean",
"required" : true
},
"grabMenu" : {
"type" : "boolean",
"required" : true
}
},
"additionalProperties" : false

View File

@@ -54,8 +54,6 @@ void XBMCVideoChecker::receiveReply()
// expect that the reply is received as a single message. Probably oke considering the size of the expected reply
QString reply(_socket.readAll());
std::cout << reply.toStdString() << std::endl;
// check if the resply is a reply to one of my requests
if (!reply.contains("\"id\":666"))
{
@@ -71,13 +69,13 @@ void XBMCVideoChecker::receiveReply()
}
else if (reply.contains("picture"))
{
// photo viewer is playing
newMode = _grabVideo ? GRABBINGMODE_PHOTO : GRABBINGMODE_OFF;
// picture viewer is playing
newMode = _grabPhoto ? GRABBINGMODE_PHOTO : GRABBINGMODE_OFF;
}
else if (reply.contains("audio"))
{
// photo viewer is playing
newMode = _grabVideo ? GRABBINGMODE_AUDIO : GRABBINGMODE_OFF;
// audio is playing
newMode = _grabAudio ? GRABBINGMODE_AUDIO : GRABBINGMODE_OFF;
}
else
{