screensaver: fix restart of clock and mute;

restart is now depending on previous status


Origin commit data
------------------
Branch: ni/coolstream
Commit: aea7e1f772
Author: vanhofen <vanhofen@gmx.de>
Date: 2015-01-09 (Fri, 09 Jan 2015)

Origin message was:
------------------
- screensaver: fix restart of clock and mute;

 restart is now depending on previous status


------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2015-01-09 15:04:39 +01:00
parent 2ae7862fbf
commit 91859dcb45
2 changed files with 11 additions and 3 deletions

View File

@@ -51,6 +51,8 @@ CScreenSaver::CScreenSaver()
m_frameBuffer = CFrameBuffer::getInstance(); m_frameBuffer = CFrameBuffer::getInstance();
m_viewer = new CPictureViewer(); m_viewer = new CPictureViewer();
index = 0; index = 0;
status_mute = CAudioMute::getInstance()->getStatus();
status_clock = InfoClock->getStatus();
} }
CScreenSaver::~CScreenSaver() CScreenSaver::~CScreenSaver()
@@ -75,7 +77,10 @@ CScreenSaver* CScreenSaver::getInstance()
void CScreenSaver::Start() void CScreenSaver::Start()
{ {
status_mute = CAudioMute::getInstance()->getStatus();
CAudioMute::getInstance()->enableMuteIcon(false); CAudioMute::getInstance()->enableMuteIcon(false);
status_clock = InfoClock->getStatus();
InfoClock->enableInfoClock(false); InfoClock->enableInfoClock(false);
m_viewer->SetScaling((CPictureViewer::ScalingMode)g_settings.picviewer_scaling); m_viewer->SetScaling((CPictureViewer::ScalingMode)g_settings.picviewer_scaling);
@@ -112,8 +117,8 @@ void CScreenSaver::Stop()
thrScreenSaver = 0; thrScreenSaver = 0;
m_frameBuffer->paintBackground(); //clear entire screen m_frameBuffer->paintBackground(); //clear entire screen
InfoClock->enableInfoClock(true); InfoClock->enableInfoClock(status_clock);
CAudioMute::getInstance()->enableMuteIcon(true); CAudioMute::getInstance()->enableMuteIcon(status_mute);
} }
void* CScreenSaver::ScreenSaverPrg(void* arg) void* CScreenSaver::ScreenSaverPrg(void* arg)

View File

@@ -33,11 +33,14 @@ class CScreenSaver
{ {
private: private:
CFrameBuffer *m_frameBuffer; CFrameBuffer *m_frameBuffer;
CPictureViewer *m_viewer;
pthread_t thrScreenSaver; pthread_t thrScreenSaver;
static void* ScreenSaverPrg(void *arg); static void* ScreenSaverPrg(void *arg);
vector<string> v_bg_files; vector<string> v_bg_files;
unsigned int index; unsigned int index;
CPictureViewer *m_viewer;
bool status_mute;
bool status_clock;
bool ReadDir(); bool ReadDir();
void PaintPicture(); void PaintPicture();