Kodicheck: Add option for pause modus (#681)

* introduce pause mode

* fix it fe...

* fix

* fix compile warning

* change solution

* fix order

* fix

* last update

* -


Former-commit-id: b35c4d672aed5be7a6a694b3c861c6cf287d89df
This commit is contained in:
brindosch 2016-06-07 12:34:50 +02:00
parent f39f074dcf
commit 9578a3e386
9 changed files with 26 additions and 4 deletions

View File

@ -9,6 +9,7 @@ enum GrabbingMode
GRABBINGMODE_OFF,
/** Frame grabbing during video */
GRABBINGMODE_VIDEO,
GRABBINGMODE_PAUSE,
GRABBINGMODE_PHOTO,
GRABBINGMODE_AUDIO,
GRABBINGMODE_MENU,

View File

@ -41,7 +41,7 @@ public:
/// @param grabScreensaver Whether or not to grab when the XBMC screensaver is activated
/// @param enable3DDetection Wheter or not to enable the detection of 3D movies playing
///
XBMCVideoChecker(const std::string & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabScreensaver, bool enable3DDetection);
XBMCVideoChecker(const std::string & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabPause, bool grabScreensaver, bool enable3DDetection);
///
/// Start polling XBMC
@ -76,7 +76,7 @@ private:
void setGrabbingMode(GrabbingMode grabbingMode);
void setScreensaverMode(bool isOnScreensaver);
/// Set the video mode
void setVideoMode(VideoMode videoMode);
@ -117,6 +117,9 @@ private:
/// Flag indicating whether or not to grab when XBMC is playing nothing (in menu)
const bool _grabMenu;
/// Flag indicating whether or not to grab when the XBMC videoplayer is at pause state
const bool _grabPause;
/// Flag indicating whether or not to grab when the XBMC screensaver is activated
const bool _grabScreensaver;
@ -125,7 +128,7 @@ private:
/// Flag indicating if XBMC is on screensaver
bool _previousScreensaverMode;
/// Previous emitted grab mode
GrabbingMode _previousGrabbingMode;

View File

@ -78,6 +78,7 @@ void AmlogicWrapper::setGrabbingMode(const GrabbingMode mode)
switch (mode)
{
case GRABBINGMODE_VIDEO:
case GRABBINGMODE_PAUSE:
// _frameGrabber->setFlags(DISPMANX_SNAPSHOT_NO_RGB|DISPMANX_SNAPSHOT_FILL);
start();
break;

View File

@ -74,6 +74,7 @@ void DispmanxWrapper::setGrabbingMode(const GrabbingMode mode)
switch (mode)
{
case GRABBINGMODE_VIDEO:
case GRABBINGMODE_PAUSE:
_frameGrabber->setFlags(DISPMANX_SNAPSHOT_NO_RGB|DISPMANX_SNAPSHOT_FILL);
start();
break;

View File

@ -62,6 +62,7 @@ void FramebufferWrapper::setGrabbingMode(const GrabbingMode mode)
switch (mode)
{
case GRABBINGMODE_VIDEO:
case GRABBINGMODE_PAUSE:
case GRABBINGMODE_AUDIO:
case GRABBINGMODE_PHOTO:
case GRABBINGMODE_MENU:

View File

@ -62,6 +62,7 @@ void OsxWrapper::setGrabbingMode(const GrabbingMode mode)
switch (mode)
{
case GRABBINGMODE_VIDEO:
case GRABBINGMODE_PAUSE:
case GRABBINGMODE_AUDIO:
case GRABBINGMODE_PHOTO:
case GRABBINGMODE_MENU:

View File

@ -288,6 +288,10 @@
"type" : "boolean",
"required" : true
},
"grabPause" : {
"type" : "boolean",
"required" : false
},
"grabScreensaver" : {
"type" : "boolean",
"required" : false

View File

@ -21,7 +21,7 @@
// {"jsonrpc":"2.0","method":"GUI.GetProperties","params":{"properties":["stereoscopicmode"]},"id":669}
// {"id":669,"jsonrpc":"2.0","result":{"stereoscopicmode":{"label":"Nebeneinander","mode":"split_vertical"}}}
XBMCVideoChecker::XBMCVideoChecker(const std::string & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabScreensaver, bool enable3DDetection) :
XBMCVideoChecker::XBMCVideoChecker(const std::string & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabPause, bool grabScreensaver, bool enable3DDetection) :
QObject(),
_address(QString::fromStdString(address)),
_port(port),
@ -35,6 +35,7 @@ XBMCVideoChecker::XBMCVideoChecker(const std::string & address, uint16_t port, b
_grabPhoto(grabPhoto),
_grabAudio(grabAudio),
_grabMenu(grabMenu),
_grabPause(grabPause),
_grabScreensaver(grabScreensaver),
_enable3DDetection(enable3DDetection),
_previousScreensaverMode(false),
@ -73,6 +74,11 @@ void XBMCVideoChecker::receiveReply()
setGrabbingMode(_grabMenu ? GRABBINGMODE_MENU : GRABBINGMODE_OFF);
setVideoMode(VIDEO_2D);
}
else if (reply.contains("\"method\":\"Player.OnPause\""))
{
// player at pause
setGrabbingMode(_grabPause ? GRABBINGMODE_PAUSE : GRABBINGMODE_OFF);
}
else if (reply.contains("\"method\":\"GUI.OnScreensaverActivated\""))
{
setScreensaverMode(!_grabScreensaver);
@ -272,6 +278,9 @@ void XBMCVideoChecker::setGrabbingMode(GrabbingMode newGrabbingMode)
case GRABBINGMODE_MENU:
std::cout << "KODICHECK INFO: switching to MENU mode" << std::endl;
break;
case GRABBINGMODE_PAUSE:
std::cout << "KODICHECK INFO: switching to PAUSE mode" << std::endl;
break;
case GRABBINGMODE_OFF:
std::cout << "KODICHECK INFO: switching to OFF mode" << std::endl;
break;

View File

@ -178,6 +178,7 @@ void startXBMCVideoChecker(const Json::Value &config, XBMCVideoChecker* &xbmcVid
videoCheckerConfig["grabPictures"].asBool(),
videoCheckerConfig["grabAudio"].asBool(),
videoCheckerConfig["grabMenu"].asBool(),
videoCheckerConfig.get("grabPause", true).asBool(),
videoCheckerConfig.get("grabScreensaver", true).asBool(),
videoCheckerConfig.get("enable3DDetection", true).asBool());