mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
movieplayer: Add screensaver function when movie player is paused
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
#include <gui/plugins.h>
|
||||
#include <gui/videosettings.h>
|
||||
#include <gui/streaminfo2.h>
|
||||
#include <gui/screensaver.h>
|
||||
#include <driver/screenshot.h>
|
||||
#include <driver/volume.h>
|
||||
#include <driver/display.h>
|
||||
@@ -190,6 +191,7 @@ void CMoviePlayerGui::Init(void)
|
||||
keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_NORMAL;
|
||||
isLuaPlay = false;
|
||||
blockedFromPlugin = false;
|
||||
m_screensaver=false;
|
||||
}
|
||||
|
||||
void CMoviePlayerGui::cutNeutrino()
|
||||
@@ -952,6 +954,32 @@ void CMoviePlayerGui::PlayFileLoop(void)
|
||||
}
|
||||
showSubtitle(0);
|
||||
|
||||
if (playstate == CMoviePlayerGui::PAUSE && (msg == CRCInput::RC_timeout || msg == NeutrinoMessages::EVT_TIMER))
|
||||
{
|
||||
int delay = time(NULL) - m_idletime;
|
||||
int screensaver_delay = g_settings.screensaver_delay;
|
||||
if (screensaver_delay != 0 && delay > screensaver_delay*60 && !m_screensaver) {
|
||||
videoDecoder->setBlank(true);
|
||||
screensaver(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_idletime = time(NULL);
|
||||
if (m_screensaver)
|
||||
{
|
||||
videoDecoder->setBlank(false);
|
||||
screensaver(false);
|
||||
//ignore first keypress stop - just quit the screensaver and call infoviewer
|
||||
if (msg == CRCInput::RC_stop) {
|
||||
g_RCInput->clearRCMsg();
|
||||
callInfoViewer();
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (msg == (neutrino_msg_t) g_settings.mpkey_plugin) {
|
||||
g_PluginList->startPlugin_by_name(g_settings.movieplayer_plugin.c_str ());
|
||||
} else if (msg == (neutrino_msg_t) g_settings.mpkey_stop) {
|
||||
@@ -2238,3 +2266,18 @@ size_t CMoviePlayerGui::GetReadCount()
|
||||
//printf("GetReadCount: %lld\n", res);
|
||||
return (size_t) res;
|
||||
}
|
||||
|
||||
void CMoviePlayerGui::screensaver(bool on)
|
||||
{
|
||||
if (on)
|
||||
{
|
||||
m_screensaver = true;
|
||||
CScreenSaver::getInstance()->Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
CScreenSaver::getInstance()->Stop();
|
||||
m_screensaver = false;
|
||||
m_idletime = time(NULL);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user