diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index 19f927b09..a32969cea 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -1797,17 +1797,23 @@ void CFrameBuffer::Clear() paintBackground(); //memset(getFrameBufferPointer(), 0, stride * yRes); } -#if 0 -//never used + void CFrameBuffer::showFrame(const std::string & filename) { - std::string varpath = CONFIGDIR "/neutrino/icons/"; - if(!access((varpath + filename).c_str(), F_OK)) - videoDecoder->ShowPicture((varpath + filename).c_str()); - else - videoDecoder->ShowPicture((iconBasePath + filename).c_str()); + std::string picture = std::string(ICONDIR_VAR) + filename; + if (access(picture.c_str(), F_OK)) + picture = iconBasePath + filename; + if (filename.find("/", 0) != std::string::npos) + picture = filename; + + videoDecoder->ShowPicture(picture.c_str()); } -#endif + +void CFrameBuffer::stopFrame() +{ + videoDecoder->StopPicture(); +} + bool CFrameBuffer::Lock() { if(locked) diff --git a/src/driver/framebuffer.h b/src/driver/framebuffer.h index 078c1a2c0..23f7c19a8 100644 --- a/src/driver/framebuffer.h +++ b/src/driver/framebuffer.h @@ -256,6 +256,7 @@ class CFrameBuffer void Clear(); void showFrame(const std::string & filename); + void stopFrame(); bool loadBackgroundPic(const std::string & filename, bool show = true); bool Lock(void); void Unlock(void); diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index e13edc997..8d17e9bf2 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -286,7 +286,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) // set zapit in lock mode CNeutrinoApp::getInstance()->stopPlayBack(true); - videoDecoder->ShowPicture(DATADIR "/neutrino/icons/mp3.jpg"); + m_frameBuffer->showFrame("mp3.jpg"); // tell neutrino we're in audio mode m_LastMode = CNeutrinoApp::getInstance()->getMode(); @@ -315,7 +315,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) CZapit::getInstance()->EnablePlayback(true); // Start Sectionsd g_Sectionsd->setPauseScanning(false); - videoDecoder->StopPicture(); + m_frameBuffer->stopFrame(); CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , m_LastMode ); g_RCInput->postMsg( NeutrinoMessages::SHOW_INFOBAR, 0 ); @@ -386,8 +386,8 @@ int CAudioPlayerGui::show() { screensaver(false); - videoDecoder->StopPicture(); - videoDecoder->ShowPicture(DATADIR "/neutrino/icons/mp3.jpg"); + m_frameBuffer->stopFrame(); + m_frameBuffer->showFrame("mp3.jpg"); paint(); if (msg <= CRCInput::RC_MaxRC) { @@ -706,7 +706,7 @@ int CAudioPlayerGui::show() { pictureviewer = true; m_frameBuffer->Clear(); - videoDecoder->StopPicture(); + m_frameBuffer->stopFrame(); CPictureViewerGui * picture = new CPictureViewerGui(); picture->m_audioPlayer = this; picture->exec(this, "audio"); @@ -714,7 +714,7 @@ int CAudioPlayerGui::show() pictureviewer = false; screensaver(false); videoDecoder->setBlank(true); - videoDecoder->ShowPicture(DATADIR "/neutrino/icons/mp3.jpg"); + m_frameBuffer->showFrame("mp3.jpg"); CVFD::getInstance()->setMode(CVFD::MODE_AUDIO); paintLCD(); update = true; diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index e91ea0330..b09badcb4 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -682,13 +682,13 @@ int CLuaInstance::setBlank(lua_State *L) int CLuaInstance::ShowPicture(lua_State *L) { const char *fname = luaL_checkstring(L, 2); - videoDecoder->ShowPicture(fname); + CFrameBuffer::getInstance()->showFrame(fname); return 0; } int CLuaInstance::StopPicture(lua_State */*L*/) { - videoDecoder->StopPicture(); + CFrameBuffer::getInstance()->stopFrame(); return 0; } diff --git a/src/gui/mediaplayer.cpp b/src/gui/mediaplayer.cpp index 0ef9af0b2..a355c448f 100644 --- a/src/gui/mediaplayer.cpp +++ b/src/gui/mediaplayer.cpp @@ -111,10 +111,10 @@ int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &actionKey) InfoClock->enableInfoClock(false); int mode = CNeutrinoApp::getInstance()->getMode(); if( mode == NeutrinoMessages::mode_radio ) - videoDecoder->StopPicture(); + CFrameBuffer::getInstance()->stopFrame(); int res = CMoviePlayerGui::getInstance().exec(NULL, "tsmoviebrowser"); if( mode == NeutrinoMessages::mode_radio ) - videoDecoder->ShowPicture(DATADIR "/neutrino/icons/radiomode.jpg"); + CFrameBuffer::getInstance()->showFrame("radiomode.jpg"); audiomute->enableMuteIcon(true); InfoClock->enableInfoClock(true); return res; diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 7457b7c68..91916906c 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -205,7 +205,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) #endif frameBuffer->paintBackground(); - videoDecoder->ShowPicture(DATADIR "/neutrino/icons/scan.jpg"); + frameBuffer->showFrame("scan.jpg"); g_Sectionsd->setPauseScanning(true); CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8); @@ -365,7 +365,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) hide(); CZapit::getInstance()->scanPids(scan_pids); - videoDecoder->StopPicture(); + frameBuffer->stopFrame(); frameBuffer->Clear(); g_Sectionsd->setPauseScanning(false); if (CNeutrinoApp::getInstance()->channelList) diff --git a/src/gui/screensaver.cpp b/src/gui/screensaver.cpp index 6106912e6..d3788e419 100644 --- a/src/gui/screensaver.cpp +++ b/src/gui/screensaver.cpp @@ -93,7 +93,7 @@ void CScreenSaver::Start() m_viewer->Cleanup(); - videoDecoder->StopPicture(); + m_frameBuffer->stopFrame(); if(!thrScreenSaver) { diff --git a/src/gui/start_wizard.cpp b/src/gui/start_wizard.cpp index e902a1a5c..13d7dd128 100644 --- a/src/gui/start_wizard.cpp +++ b/src/gui/start_wizard.cpp @@ -172,11 +172,11 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/) inline void CStartUpWizard::showBackgroundLogo() { - videoDecoder->ShowPicture(DATADIR "/neutrino/icons/start.jpg"); + CFrameBuffer::getInstance()->showFrame("start.jpg"); } inline void CStartUpWizard::killBackgroundLogo() { - videoDecoder->StopPicture(); + CFrameBuffer::getInstance()->stopFrame(); } diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index f58515f1f..c21a6e4e2 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -99,7 +99,7 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/ /* stop playback, disable playback start */ CNeutrinoApp::getInstance()->stopPlayBack(true); - videoDecoder->ShowPicture(DATADIR "/neutrino/icons/mp3.jpg"); + m_frameBuffer->showFrame("mp3.jpg"); // tell neutrino we're in audio mode CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE , NeutrinoMessages::mode_audio); @@ -139,7 +139,7 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/ // Start Sectionsd g_Sectionsd->setPauseScanning(false); - videoDecoder->StopPicture(); + m_frameBuffer->stopFrame(); m_frameBuffer->Clear(); CZapit::getInstance()->EnablePlayback(true); @@ -772,7 +772,7 @@ bool CUpnpBrowserGui::selectItem(std::string id) { m_frameBuffer->Clear(); playVideo((*entries)[selected - liststart].title, (*entries)[selected - liststart].resources[preferred].url); - videoDecoder->ShowPicture(DATADIR "/neutrino/icons/mp3.jpg"); + m_frameBuffer->showFrame("mp3.jpg"); refresh = true; } else if (mime.substr(0,6) == "image/") @@ -1278,7 +1278,7 @@ void CUpnpBrowserGui::playVideo(std::string name, std::string url) if (CAudioPlayer::getInstance()->getState() != CBaseDec::STOP) CAudioPlayer::getInstance()->stop(); - videoDecoder->StopPicture(); + m_frameBuffer->stopFrame(); CMoviePlayerGui::getInstance().SetFile(name, url); CMoviePlayerGui::getInstance().exec(NULL, "upnp"); } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 93bdc6104..05cb835b7 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2214,8 +2214,8 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu) printf("[neutrino] CSreenSaver stop; msg: %X\n", msg); screensaver(false); - videoDecoder->StopPicture(); - videoDecoder->ShowPicture(DATADIR "/neutrino/icons/radiomode.jpg"); + frameBuffer->stopFrame(); + frameBuffer->showFrame("radiomode.jpg"); if (msg <= CRCInput::RC_MaxRC) { // ignore first keypress - just quit the screensaver @@ -3220,7 +3220,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } if((data & mode_mask)== mode_ts && CMoviePlayerGui::getInstance().Playing()) { if(mode == mode_radio) - videoDecoder->StopPicture(); + frameBuffer->stopFrame(); lastMode=mode; mode=mode_ts; } @@ -3322,7 +3322,7 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) stopPlayBack(); frameBuffer->paintBackground(); - videoDecoder->ShowPicture(DATADIR "/neutrino/icons/shutdown.jpg"); + frameBuffer->showFrame("shutdown.jpg"); delete cHddStat::getInstance(); delete CRecordManager::getInstance(); @@ -3476,7 +3476,7 @@ void CNeutrinoApp::tvMode( bool rezap ) g_Radiotext = NULL; } - videoDecoder->StopPicture(); + frameBuffer->stopFrame(); CVFD::getInstance()->ShowIcon(FP_ICON_RADIO, false); StartSubtitles(!rezap); } @@ -3686,7 +3686,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) radioMode( false ); } else { /* for standby -> tv mode from radio mode in case of record */ - videoDecoder->StopPicture(); + frameBuffer->stopFrame(); tvMode( false ); } t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); @@ -3748,7 +3748,7 @@ void CNeutrinoApp::radioMode( bool rezap) else channelList->zapTo(0, true); /* force re-zap */ } - videoDecoder->ShowPicture(DATADIR "/neutrino/icons/radiomode.jpg"); + frameBuffer->showFrame("radiomode.jpg"); } //switching from current mode to tv or radio mode or to optional parameter prev_mode @@ -3858,12 +3858,12 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) else if(actionKey=="nkplayback" || actionKey=="ytplayback" || actionKey=="tsmoviebrowser" || actionKey=="fileplayback") { frameBuffer->Clear(); if(mode == NeutrinoMessages::mode_radio ) - videoDecoder->StopPicture(); + frameBuffer->stopFrame(); int _mode = mode; // FIXME CMediaPlayerMenu::getInstance()->exec(NULL, actionKey); ?? CMoviePlayerGui::getInstance().exec(NULL, actionKey); if(_mode == NeutrinoMessages::mode_radio ) - videoDecoder->ShowPicture(DATADIR "/neutrino/icons/radiomode.jpg"); + frameBuffer->showFrame("radiomode.jpg"); #if 0 else if (_mode == mode_webtv) tvMode(true);