screensaver: rework timeosd handling

This commit is contained in:
2016-01-07 22:36:10 +01:00
parent 0f2c73aed3
commit d7ac78c0c2
3 changed files with 15 additions and 5 deletions

View File

@@ -38,7 +38,7 @@
#include "screensaver.h" #include "screensaver.h"
#include <system/debug.h> #include <system/debug.h>
#include <gui/infoclock.h> #include <gui/infoclock.h>
extern CInfoClock *InfoClock;
#include <video.h> #include <video.h>
extern cVideo * videoDecoder; extern cVideo * videoDecoder;
@@ -84,6 +84,9 @@ void CScreenSaver::Start()
status_mute = CAudioMute::getInstance()->getStatus(); status_mute = CAudioMute::getInstance()->getStatus();
CAudioMute::getInstance()->enableMuteIcon(false); CAudioMute::getInstance()->enableMuteIcon(false);
if(!CInfoClock::getInstance()->isBlocked())
CInfoClock::getInstance()->disableInfoClock();
m_viewer->SetScaling((CPictureViewer::ScalingMode)g_settings.picviewer_scaling); m_viewer->SetScaling((CPictureViewer::ScalingMode)g_settings.picviewer_scaling);
m_viewer->SetVisible(g_settings.screen_StartX, g_settings.screen_EndX, g_settings.screen_StartY, g_settings.screen_EndY); m_viewer->SetVisible(g_settings.screen_StartX, g_settings.screen_EndX, g_settings.screen_StartY, g_settings.screen_EndY);
@@ -125,7 +128,7 @@ void CScreenSaver::Stop()
if (!OnAfterStop.empty()) if (!OnAfterStop.empty())
OnAfterStop(); OnAfterStop();
else else
InfoClock->enableInfoClock(); CInfoClock::getInstance()->enableInfoClock();
} }
void* CScreenSaver::ScreenSaverPrg(void* arg) void* CScreenSaver::ScreenSaverPrg(void* arg)
@@ -281,3 +284,10 @@ void CScreenSaver::paint()
clr.i_color = COL_DARK_GRAY; clr.i_color = COL_DARK_GRAY;
} }
} }
bool CScreenSaver::IsRun()
{
if(thrScreenSaver)
return true;
return false;
}

View File

@@ -65,7 +65,7 @@ class CScreenSaver : public sigc::trackable
CScreenSaver(); CScreenSaver();
~CScreenSaver(); ~CScreenSaver();
static CScreenSaver* getInstance(); static CScreenSaver* getInstance();
bool IsRun();
void Start(); void Start();
void Stop(); void Stop();
sigc::signal<void> OnBeforeStart; sigc::signal<void> OnBeforeStart;

View File

@@ -33,7 +33,7 @@
#include <neutrino.h> #include <neutrino.h>
#include <gui/volumebar.h> #include <gui/volumebar.h>
#include <gui/timeosd.h> #include <gui/timeosd.h>
#include "screensaver.h"
CTimeOSD::CTimeOSD():CComponentsFrmClock( 1, 1, NULL, "%H:%M:%S", NULL, false, 1, NULL, CC_SHADOW_ON, COL_LIGHT_GRAY, COL_MENUCONTENT_PLUS_0,COL_MENUCONTENTDARK_PLUS_0) CTimeOSD::CTimeOSD():CComponentsFrmClock( 1, 1, NULL, "%H:%M:%S", NULL, false, 1, NULL, CC_SHADOW_ON, COL_LIGHT_GRAY, COL_MENUCONTENT_PLUS_0,COL_MENUCONTENTDARK_PLUS_0)
@@ -96,7 +96,7 @@ void CTimeOSD::initTimeString()
void CTimeOSD::show(time_t time_show, bool force) void CTimeOSD::show(time_t time_show, bool force)
{ {
time_show /= 1000; time_show /= 1000;
if (!force && (m_mode == MODE_HIDE || m_time_show == time_show)) if (!force && (m_mode == MODE_HIDE || m_time_show == time_show) || CScreenSaver::getInstance()->IsRun())
return; return;
m_time_show = time_show; m_time_show = time_show;