From b1341c00169b2fa998ce6f0561f76090fa68ff6c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 31 May 2018 00:57:37 +0200 Subject: [PATCH] screensaver: try to fix display of audiocovers <-> own pictures Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/923fdb054236af88e02501d97b49981ab5248530 Author: vanhofen Date: 2018-05-31 (Thu, 31 May 2018) Origin message was: ------------------ - screensaver: try to fix display of audiocovers <-> own pictures ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/screensaver.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/gui/screensaver.cpp b/src/gui/screensaver.cpp index 05d838c8a..f982c1552 100644 --- a/src/gui/screensaver.cpp +++ b/src/gui/screensaver.cpp @@ -116,8 +116,14 @@ void CScreenSaver::Start() m_viewer->SetAspectRatio(float(4.0/3)); m_viewer->Cleanup(); +#if HAVE_ARM_HARDWARE + /* + Hack to get sure we have a blank screen. + stopFrame()-function seems not work correctly on ARM_HARDWARE + */ + m_frameBuffer->showFrame("blackscreen.jpg"); +#endif m_frameBuffer->stopFrame(); - m_viewer->ShowImage(ICONSDIR "/blackscreen.jpg", false /*unscaled*/); // hack to get sure we have a blank screen if(!thrScreenSaver) { @@ -188,8 +194,21 @@ void* CScreenSaver::ScreenSaverPrg(void* arg) bool CScreenSaver::ReadDir() { - string d; + bool show_audiocover = false; + if (CNeutrinoApp::getInstance()->getMode() == NeutrinoModes::mode_audio && g_settings.audioplayer_cover_as_screensaver) + { + if (access(COVERDIR, F_OK) == 0) + { + struct dirent **coverlist; + int n = scandir(COVERDIR, &coverlist, 0, alphasort); + if (n > 2) // we always have the "." and ".." entrys + show_audiocover = true; + } + } + + string d; + if (show_audiocover) d = COVERDIR; else d = g_settings.screensaver_dir;