From 4be0c5290acdb77c58114a955047264d6ec22db6 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 18 Nov 2015 19:41:16 +0100 Subject: [PATCH] CScreenSaver: add signal/slot handler OnBeforeStart(), try to fix infoclock In some constelations it is not required to enable infoclock after close screensaver. So it is possible to cotrol this from other objects. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6c8bd668017d4b2c3c03b7f4dce9cd78971649bd Author: Thilo Graf Date: 2015-11-18 (Wed, 18 Nov 2015) ------------------ This commit was generated by Migit --- src/gui/screensaver.cpp | 11 ++++++----- src/gui/screensaver.h | 5 +++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gui/screensaver.cpp b/src/gui/screensaver.cpp index 7c10a6f23..a3a3c8ef3 100644 --- a/src/gui/screensaver.cpp +++ b/src/gui/screensaver.cpp @@ -52,7 +52,6 @@ CScreenSaver::CScreenSaver() m_viewer = new CPictureViewer(); index = 0; status_mute = CAudioMute::getInstance()->getStatus(); - status_clock = InfoClock->getStatus(); } CScreenSaver::~CScreenSaver() @@ -77,12 +76,10 @@ CScreenSaver* CScreenSaver::getInstance() void CScreenSaver::Start() { + OnBeforeStart(); status_mute = CAudioMute::getInstance()->getStatus(); CAudioMute::getInstance()->enableMuteIcon(false); - status_clock = InfoClock->getStatus(); - InfoClock->enableInfoClock(false); - 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); @@ -117,8 +114,12 @@ void CScreenSaver::Stop() thrScreenSaver = 0; m_frameBuffer->paintBackground(); //clear entire screen - InfoClock->enableInfoClock(status_clock); + CAudioMute::getInstance()->enableMuteIcon(status_mute); + if (!OnAfterStop.empty()) + OnAfterStop(); + else + InfoClock->enableInfoClock(); } void* CScreenSaver::ScreenSaverPrg(void* arg) diff --git a/src/gui/screensaver.h b/src/gui/screensaver.h index 7f6984ee7..8be33d1ca 100644 --- a/src/gui/screensaver.h +++ b/src/gui/screensaver.h @@ -29,7 +29,7 @@ #include #include -class CScreenSaver +class CScreenSaver : public sigc::trackable { private: CFrameBuffer *m_frameBuffer; @@ -40,7 +40,6 @@ class CScreenSaver unsigned int index; bool status_mute; - bool status_clock; bool ReadDir(); void PaintPicture(); @@ -52,6 +51,8 @@ class CScreenSaver void Start(); void Stop(); + sigc::signal OnBeforeStart; + sigc::signal OnAfterStop; }; #endif // __CSCREENSAVER_H__