diff --git a/src/driver/record.cpp b/src/driver/record.cpp index cb3ca8c35..d99baa94b 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1636,6 +1636,20 @@ bool CRecordManager::MountDirectory(const char *recordingDir) return ret; } +bool CRecordManager::IsFileRecord(std::string file) +{ + mutex.lock(); + for(recmap_iterator_t it = recmap.begin(); it != recmap.end(); it++) { + CRecordInstance * inst = it->second; + if ((((std::string)inst->GetFileName()) + ".ts") == file) { + mutex.unlock(); + return true; + } + } + mutex.unlock(); + return false; +} + #if 0 // not used, saved in case we needed it extern bool autoshift_delete; bool CRecordManager::LinkTimeshift() diff --git a/src/driver/record.h b/src/driver/record.h index 36bac7246..992c3525e 100644 --- a/src/driver/record.h +++ b/src/driver/record.h @@ -213,5 +213,6 @@ class CRecordManager : public CMenuTarget, public CChangeObserver bool IsTimeshift(t_channel_id channel_id=0); void StartTimeshift(); int GetRecordMode(const t_channel_id channel_id=0); + bool IsFileRecord(std::string file); }; #endif diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 020c5bb1a..655072405 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -67,6 +67,7 @@ #include #include #include +#include extern CPictureViewer * g_PicViewer; static CProgressBar *timescale; @@ -515,6 +516,7 @@ void CMovieBrowser::init(void) refreshBrowserList(); refreshFilterList(); g_PicViewer->getSupportedImageFormats(PicExts); + IsRecord = false; #if 0 TRACE_1("Frames\r\n\tScren:\t%3d,%3d,%3d,%3d\r\n\tMain:\t%3d,%3d,%3d,%3d\r\n\tTitle:\t%3d,%3d,%3d,%3d \r\n\tBrowsr:\t%3d,%3d,%3d,%3d \r\n\tPlay:\t%3d,%3d,%3d,%3d \r\n\tRecord:\t%3d,%3d,%3d,%3d\r\n\r\n", g_settings.screen_StartX, @@ -1208,13 +1210,18 @@ void CMovieBrowser::refreshMovieInfo(void) m_pcInfo->setText(&emptytext); return; } - if (m_movieSelectionHandler == NULL) - { + if (m_movieSelectionHandler == NULL) { // There is no selected element, clear LCD m_pcInfo->setText(&emptytext); } - else - { + else { + // Is record? + bool tmp = CRecordManager::getInstance()->IsFileRecord(m_movieSelectionHandler->file.Name); + if (tmp != IsRecord) { + IsRecord = tmp; + refreshFoot(); + } + bool logo_ok = false; int picw = (int)(((float)16 / (float)9) * (float)m_cBoxFrameInfo.iHeight); int pich = m_cBoxFrameInfo.iHeight; @@ -1615,10 +1622,13 @@ void CMovieBrowser::refreshFoot(void) m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_OKAY, &iw, &ih); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, m_cBoxFrame.iX+xpos1+width*2, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY, m_cBoxFrameFootRel.iHeight+ 6); m_pcFontFoot->RenderString(m_cBoxFrame.iX+xpos1+width*2 + 10 + iw, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width-30, ok_text.c_str(), (CFBWindow::color_t)color, 0, true); // UTF-8 - //delte icon - m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_SMALL, &iw, &ih); - m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_MUTE_SMALL, m_cBoxFrame.iX+xpos1+width*3, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY, m_cBoxFrameFootRel.iHeight+ 6); - m_pcFontFoot->RenderString(m_cBoxFrame.iX+xpos1+width*3 + 10 + iw , m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width-30, g_Locale->getText(LOCALE_FILEBROWSER_DELETE), (CFBWindow::color_t)color, 0, true); // UTF-8 + + if (IsRecord == false) { + //delte icon + m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_SMALL, &iw, &ih); + m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_MUTE_SMALL, m_cBoxFrame.iX+xpos1+width*3, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY, m_cBoxFrameFootRel.iHeight+ 6); + m_pcFontFoot->RenderString(m_cBoxFrame.iX+xpos1+width*3 + 10 + iw , m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width-30, g_Locale->getText(LOCALE_FILEBROWSER_DELETE), (CFBWindow::color_t)color, 0, true); // UTF-8 + } } @@ -1714,13 +1724,8 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) } else if (msg == CRCInput::RC_spkr) { - if(m_vMovieInfo.size() > 0) - { - if(m_movieSelectionHandler != NULL) - { - onDeleteFile(*m_movieSelectionHandler); - } - } + if ((m_vMovieInfo.size() > 0) && (m_movieSelectionHandler != NULL) && (IsRecord == false)) + onDeleteFile(*m_movieSelectionHandler); } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser.h index 66045e041..8f751f0e2 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser.h @@ -294,6 +294,8 @@ class CMovieBrowser : public CMenuTarget MB_SETTINGS m_settings; std::vector m_dir; + bool IsRecord; + int movieInfoUpdateAll[MB_INFO_MAX_NUMBER]; int movieInfoUpdateAllIfDestEmptyOnly;