mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-01 18:01:13 +02:00
* Moviebrowser: Deleting recordings
- Deleting of active recordings will be disabled. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2112 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -1636,6 +1636,20 @@ bool CRecordManager::MountDirectory(const char *recordingDir)
|
|||||||
return ret;
|
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
|
#if 0 // not used, saved in case we needed it
|
||||||
extern bool autoshift_delete;
|
extern bool autoshift_delete;
|
||||||
bool CRecordManager::LinkTimeshift()
|
bool CRecordManager::LinkTimeshift()
|
||||||
|
@@ -213,5 +213,6 @@ class CRecordManager : public CMenuTarget, public CChangeObserver
|
|||||||
bool IsTimeshift(t_channel_id channel_id=0);
|
bool IsTimeshift(t_channel_id channel_id=0);
|
||||||
void StartTimeshift();
|
void StartTimeshift();
|
||||||
int GetRecordMode(const t_channel_id channel_id=0);
|
int GetRecordMode(const t_channel_id channel_id=0);
|
||||||
|
bool IsFileRecord(std::string file);
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@@ -67,6 +67,7 @@
|
|||||||
#include <gui/widget/progressbar.h>
|
#include <gui/widget/progressbar.h>
|
||||||
#include <gui/pictureviewer.h>
|
#include <gui/pictureviewer.h>
|
||||||
#include <gui/customcolor.h>
|
#include <gui/customcolor.h>
|
||||||
|
#include <driver/record.h>
|
||||||
|
|
||||||
extern CPictureViewer * g_PicViewer;
|
extern CPictureViewer * g_PicViewer;
|
||||||
static CProgressBar *timescale;
|
static CProgressBar *timescale;
|
||||||
@@ -515,6 +516,7 @@ void CMovieBrowser::init(void)
|
|||||||
refreshBrowserList();
|
refreshBrowserList();
|
||||||
refreshFilterList();
|
refreshFilterList();
|
||||||
g_PicViewer->getSupportedImageFormats(PicExts);
|
g_PicViewer->getSupportedImageFormats(PicExts);
|
||||||
|
IsRecord = false;
|
||||||
#if 0
|
#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",
|
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,
|
g_settings.screen_StartX,
|
||||||
@@ -1208,13 +1210,18 @@ void CMovieBrowser::refreshMovieInfo(void)
|
|||||||
m_pcInfo->setText(&emptytext);
|
m_pcInfo->setText(&emptytext);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_movieSelectionHandler == NULL)
|
if (m_movieSelectionHandler == NULL) {
|
||||||
{
|
|
||||||
// There is no selected element, clear LCD
|
// There is no selected element, clear LCD
|
||||||
m_pcInfo->setText(&emptytext);
|
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;
|
bool logo_ok = false;
|
||||||
int picw = (int)(((float)16 / (float)9) * (float)m_cBoxFrameInfo.iHeight);
|
int picw = (int)(((float)16 / (float)9) * (float)m_cBoxFrameInfo.iHeight);
|
||||||
int pich = 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->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_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
|
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
|
||||||
|
|
||||||
|
if (IsRecord == false) {
|
||||||
//delte icon
|
//delte icon
|
||||||
m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_SMALL, &iw, &ih);
|
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_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
|
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,14 +1724,9 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg)
|
|||||||
}
|
}
|
||||||
else if (msg == CRCInput::RC_spkr)
|
else if (msg == CRCInput::RC_spkr)
|
||||||
{
|
{
|
||||||
if(m_vMovieInfo.size() > 0)
|
if ((m_vMovieInfo.size() > 0) && (m_movieSelectionHandler != NULL) && (IsRecord == false))
|
||||||
{
|
|
||||||
if(m_movieSelectionHandler != NULL)
|
|
||||||
{
|
|
||||||
onDeleteFile(*m_movieSelectionHandler);
|
onDeleteFile(*m_movieSelectionHandler);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info)
|
else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info)
|
||||||
{
|
{
|
||||||
if(m_movieSelectionHandler != NULL)
|
if(m_movieSelectionHandler != NULL)
|
||||||
|
@@ -294,6 +294,8 @@ class CMovieBrowser : public CMenuTarget
|
|||||||
MB_SETTINGS m_settings;
|
MB_SETTINGS m_settings;
|
||||||
std::vector<MB_DIR> m_dir;
|
std::vector<MB_DIR> m_dir;
|
||||||
|
|
||||||
|
bool IsRecord;
|
||||||
|
|
||||||
int movieInfoUpdateAll[MB_INFO_MAX_NUMBER];
|
int movieInfoUpdateAll[MB_INFO_MAX_NUMBER];
|
||||||
int movieInfoUpdateAllIfDestEmptyOnly;
|
int movieInfoUpdateAllIfDestEmptyOnly;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user