mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
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:
parent
f39f074dcf
commit
9578a3e386
@ -9,6 +9,7 @@ enum GrabbingMode
|
|||||||
GRABBINGMODE_OFF,
|
GRABBINGMODE_OFF,
|
||||||
/** Frame grabbing during video */
|
/** Frame grabbing during video */
|
||||||
GRABBINGMODE_VIDEO,
|
GRABBINGMODE_VIDEO,
|
||||||
|
GRABBINGMODE_PAUSE,
|
||||||
GRABBINGMODE_PHOTO,
|
GRABBINGMODE_PHOTO,
|
||||||
GRABBINGMODE_AUDIO,
|
GRABBINGMODE_AUDIO,
|
||||||
GRABBINGMODE_MENU,
|
GRABBINGMODE_MENU,
|
||||||
|
@ -41,7 +41,7 @@ public:
|
|||||||
/// @param grabScreensaver Whether or not to grab when the XBMC screensaver is activated
|
/// @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
|
/// @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
|
/// Start polling XBMC
|
||||||
@ -117,6 +117,9 @@ private:
|
|||||||
/// Flag indicating whether or not to grab when XBMC is playing nothing (in menu)
|
/// Flag indicating whether or not to grab when XBMC is playing nothing (in menu)
|
||||||
const bool _grabMenu;
|
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
|
/// Flag indicating whether or not to grab when the XBMC screensaver is activated
|
||||||
const bool _grabScreensaver;
|
const bool _grabScreensaver;
|
||||||
|
|
||||||
|
@ -78,6 +78,7 @@ void AmlogicWrapper::setGrabbingMode(const GrabbingMode mode)
|
|||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case GRABBINGMODE_VIDEO:
|
case GRABBINGMODE_VIDEO:
|
||||||
|
case GRABBINGMODE_PAUSE:
|
||||||
// _frameGrabber->setFlags(DISPMANX_SNAPSHOT_NO_RGB|DISPMANX_SNAPSHOT_FILL);
|
// _frameGrabber->setFlags(DISPMANX_SNAPSHOT_NO_RGB|DISPMANX_SNAPSHOT_FILL);
|
||||||
start();
|
start();
|
||||||
break;
|
break;
|
||||||
|
@ -74,6 +74,7 @@ void DispmanxWrapper::setGrabbingMode(const GrabbingMode mode)
|
|||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case GRABBINGMODE_VIDEO:
|
case GRABBINGMODE_VIDEO:
|
||||||
|
case GRABBINGMODE_PAUSE:
|
||||||
_frameGrabber->setFlags(DISPMANX_SNAPSHOT_NO_RGB|DISPMANX_SNAPSHOT_FILL);
|
_frameGrabber->setFlags(DISPMANX_SNAPSHOT_NO_RGB|DISPMANX_SNAPSHOT_FILL);
|
||||||
start();
|
start();
|
||||||
break;
|
break;
|
||||||
|
@ -62,6 +62,7 @@ void FramebufferWrapper::setGrabbingMode(const GrabbingMode mode)
|
|||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case GRABBINGMODE_VIDEO:
|
case GRABBINGMODE_VIDEO:
|
||||||
|
case GRABBINGMODE_PAUSE:
|
||||||
case GRABBINGMODE_AUDIO:
|
case GRABBINGMODE_AUDIO:
|
||||||
case GRABBINGMODE_PHOTO:
|
case GRABBINGMODE_PHOTO:
|
||||||
case GRABBINGMODE_MENU:
|
case GRABBINGMODE_MENU:
|
||||||
|
@ -62,6 +62,7 @@ void OsxWrapper::setGrabbingMode(const GrabbingMode mode)
|
|||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case GRABBINGMODE_VIDEO:
|
case GRABBINGMODE_VIDEO:
|
||||||
|
case GRABBINGMODE_PAUSE:
|
||||||
case GRABBINGMODE_AUDIO:
|
case GRABBINGMODE_AUDIO:
|
||||||
case GRABBINGMODE_PHOTO:
|
case GRABBINGMODE_PHOTO:
|
||||||
case GRABBINGMODE_MENU:
|
case GRABBINGMODE_MENU:
|
||||||
|
@ -288,6 +288,10 @@
|
|||||||
"type" : "boolean",
|
"type" : "boolean",
|
||||||
"required" : true
|
"required" : true
|
||||||
},
|
},
|
||||||
|
"grabPause" : {
|
||||||
|
"type" : "boolean",
|
||||||
|
"required" : false
|
||||||
|
},
|
||||||
"grabScreensaver" : {
|
"grabScreensaver" : {
|
||||||
"type" : "boolean",
|
"type" : "boolean",
|
||||||
"required" : false
|
"required" : false
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
// {"jsonrpc":"2.0","method":"GUI.GetProperties","params":{"properties":["stereoscopicmode"]},"id":669}
|
// {"jsonrpc":"2.0","method":"GUI.GetProperties","params":{"properties":["stereoscopicmode"]},"id":669}
|
||||||
// {"id":669,"jsonrpc":"2.0","result":{"stereoscopicmode":{"label":"Nebeneinander","mode":"split_vertical"}}}
|
// {"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(),
|
QObject(),
|
||||||
_address(QString::fromStdString(address)),
|
_address(QString::fromStdString(address)),
|
||||||
_port(port),
|
_port(port),
|
||||||
@ -35,6 +35,7 @@ XBMCVideoChecker::XBMCVideoChecker(const std::string & address, uint16_t port, b
|
|||||||
_grabPhoto(grabPhoto),
|
_grabPhoto(grabPhoto),
|
||||||
_grabAudio(grabAudio),
|
_grabAudio(grabAudio),
|
||||||
_grabMenu(grabMenu),
|
_grabMenu(grabMenu),
|
||||||
|
_grabPause(grabPause),
|
||||||
_grabScreensaver(grabScreensaver),
|
_grabScreensaver(grabScreensaver),
|
||||||
_enable3DDetection(enable3DDetection),
|
_enable3DDetection(enable3DDetection),
|
||||||
_previousScreensaverMode(false),
|
_previousScreensaverMode(false),
|
||||||
@ -73,6 +74,11 @@ void XBMCVideoChecker::receiveReply()
|
|||||||
setGrabbingMode(_grabMenu ? GRABBINGMODE_MENU : GRABBINGMODE_OFF);
|
setGrabbingMode(_grabMenu ? GRABBINGMODE_MENU : GRABBINGMODE_OFF);
|
||||||
setVideoMode(VIDEO_2D);
|
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\""))
|
else if (reply.contains("\"method\":\"GUI.OnScreensaverActivated\""))
|
||||||
{
|
{
|
||||||
setScreensaverMode(!_grabScreensaver);
|
setScreensaverMode(!_grabScreensaver);
|
||||||
@ -272,6 +278,9 @@ void XBMCVideoChecker::setGrabbingMode(GrabbingMode newGrabbingMode)
|
|||||||
case GRABBINGMODE_MENU:
|
case GRABBINGMODE_MENU:
|
||||||
std::cout << "KODICHECK INFO: switching to MENU mode" << std::endl;
|
std::cout << "KODICHECK INFO: switching to MENU mode" << std::endl;
|
||||||
break;
|
break;
|
||||||
|
case GRABBINGMODE_PAUSE:
|
||||||
|
std::cout << "KODICHECK INFO: switching to PAUSE mode" << std::endl;
|
||||||
|
break;
|
||||||
case GRABBINGMODE_OFF:
|
case GRABBINGMODE_OFF:
|
||||||
std::cout << "KODICHECK INFO: switching to OFF mode" << std::endl;
|
std::cout << "KODICHECK INFO: switching to OFF mode" << std::endl;
|
||||||
break;
|
break;
|
||||||
|
@ -178,6 +178,7 @@ void startXBMCVideoChecker(const Json::Value &config, XBMCVideoChecker* &xbmcVid
|
|||||||
videoCheckerConfig["grabPictures"].asBool(),
|
videoCheckerConfig["grabPictures"].asBool(),
|
||||||
videoCheckerConfig["grabAudio"].asBool(),
|
videoCheckerConfig["grabAudio"].asBool(),
|
||||||
videoCheckerConfig["grabMenu"].asBool(),
|
videoCheckerConfig["grabMenu"].asBool(),
|
||||||
|
videoCheckerConfig.get("grabPause", true).asBool(),
|
||||||
videoCheckerConfig.get("grabScreensaver", true).asBool(),
|
videoCheckerConfig.get("grabScreensaver", true).asBool(),
|
||||||
videoCheckerConfig.get("enable3DDetection", true).asBool());
|
videoCheckerConfig.get("enable3DDetection", true).asBool());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user