mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 08:51:04 +02:00
movieplayer: Add screensaver function when movie player is paused
Origin commit data
------------------
Branch: ni/coolstream
Commit: f661cb2ee3
Author: defans <defans@bluepeercrew.us>
Date: 2016-01-03 (Sun, 03 Jan 2016)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -44,6 +44,7 @@
|
|||||||
#include <gui/plugins.h>
|
#include <gui/plugins.h>
|
||||||
#include <gui/videosettings.h>
|
#include <gui/videosettings.h>
|
||||||
#include <gui/streaminfo2.h>
|
#include <gui/streaminfo2.h>
|
||||||
|
#include <gui/screensaver.h>
|
||||||
#include <driver/screenshot.h>
|
#include <driver/screenshot.h>
|
||||||
#include <driver/volume.h>
|
#include <driver/volume.h>
|
||||||
#include <driver/display.h>
|
#include <driver/display.h>
|
||||||
@@ -190,6 +191,7 @@ void CMoviePlayerGui::Init(void)
|
|||||||
keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_NORMAL;
|
keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_NORMAL;
|
||||||
isLuaPlay = false;
|
isLuaPlay = false;
|
||||||
blockedFromPlugin = false;
|
blockedFromPlugin = false;
|
||||||
|
m_screensaver=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMoviePlayerGui::cutNeutrino()
|
void CMoviePlayerGui::cutNeutrino()
|
||||||
@@ -952,6 +954,32 @@ void CMoviePlayerGui::PlayFileLoop(void)
|
|||||||
}
|
}
|
||||||
showSubtitle(0);
|
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) {
|
if (msg == (neutrino_msg_t) g_settings.mpkey_plugin) {
|
||||||
g_PluginList->startPlugin_by_name(g_settings.movieplayer_plugin.c_str ());
|
g_PluginList->startPlugin_by_name(g_settings.movieplayer_plugin.c_str ());
|
||||||
} else if (msg == (neutrino_msg_t) g_settings.mpkey_stop) {
|
} else if (msg == (neutrino_msg_t) g_settings.mpkey_stop) {
|
||||||
@@ -2238,3 +2266,18 @@ size_t CMoviePlayerGui::GetReadCount()
|
|||||||
//printf("GetReadCount: %lld\n", res);
|
//printf("GetReadCount: %lld\n", res);
|
||||||
return (size_t) 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -107,6 +107,11 @@ class CMoviePlayerGui : public CMenuTarget
|
|||||||
unsigned short currentapid, currentac3;
|
unsigned short currentapid, currentac3;
|
||||||
repeat_mode_enum repeat_mode;
|
repeat_mode_enum repeat_mode;
|
||||||
|
|
||||||
|
/* screensaver */
|
||||||
|
int m_idletime;
|
||||||
|
bool m_screensaver;
|
||||||
|
void screensaver(bool on);
|
||||||
|
|
||||||
/* subtitles vars */
|
/* subtitles vars */
|
||||||
unsigned short numsubs;
|
unsigned short numsubs;
|
||||||
std::string slanguage[MAX_PLAYBACK_PIDS];
|
std::string slanguage[MAX_PLAYBACK_PIDS];
|
||||||
|
Reference in New Issue
Block a user