* Moviebrowser: Show rec icon when recording in progress.

This commit is contained in:
micha-bbg
2012-11-26 22:35:55 +01:00
parent 86a95b039f
commit 964c6f9af0
3 changed files with 39 additions and 4 deletions

View File

@@ -380,6 +380,7 @@ CMovieBrowser::~CMovieBrowser()
m_playListLines.lineArray[i].clear(); m_playListLines.lineArray[i].clear();
m_FilterLines.lineArray[i].clear(); m_FilterLines.lineArray[i].clear();
} }
m_browserListLines.Icon.clear();
} }
void CMovieBrowser::fileInfoStale(void) void CMovieBrowser::fileInfoStale(void)
@@ -408,6 +409,7 @@ void CMovieBrowser::fileInfoStale(void)
m_playListLines.lineArray[i].clear(); m_playListLines.lineArray[i].clear();
m_FilterLines.lineArray[i].clear(); m_FilterLines.lineArray[i].clear();
} }
m_browserListLines.Icon.clear();
}; };
void CMovieBrowser::init(void) void CMovieBrowser::init(void)
@@ -937,6 +939,7 @@ int CMovieBrowser::exec(const char* path)
m_recordListLines.lineArray[i].clear(); m_recordListLines.lineArray[i].clear();
m_playListLines.lineArray[i].clear(); m_playListLines.lineArray[i].clear();
} }
m_browserListLines.Icon.clear();
m_selectedDir = path; m_selectedDir = path;
@@ -1508,6 +1511,7 @@ void CMovieBrowser::refreshBrowserList(void) //P1
m_browserListLines.lineArray[row].clear(); m_browserListLines.lineArray[row].clear();
m_browserListLines.rowWidth[row] = m_settings.browserRowWidth[row]; m_browserListLines.rowWidth[row] = m_settings.browserRowWidth[row];
m_browserListLines.lineHeader[row]= g_Locale->getText(m_localizedItemName[m_settings.browserRowItem[row]]); m_browserListLines.lineHeader[row]= g_Locale->getText(m_localizedItemName[m_settings.browserRowItem[row]]);
m_browserListLines.Icon.clear();
} }
m_vHandleBrowserList.clear(); m_vHandleBrowserList.clear();
@@ -1545,8 +1549,13 @@ void CMovieBrowser::refreshBrowserList(void) //P1
if(m_settings.browserRowItem[row] == MB_INFO_TITLE) if(m_settings.browserRowItem[row] == MB_INFO_TITLE)
getMovieInfoItem(*m_vHandleBrowserList[handle], MB_INFO_FILENAME, &string_item); getMovieInfoItem(*m_vHandleBrowserList[handle], MB_INFO_FILENAME, &string_item);
} }
m_browserListLines.lineArray[row].push_back(string_item); m_browserListLines.lineArray[row].push_back(string_item);
} }
if (CRecordManager::getInstance()->getRecordInstance(m_vHandleBrowserList[handle]->file.Name) != NULL)
m_browserListLines.Icon.push_back(NEUTRINO_ICON_REC);
else
m_browserListLines.Icon.push_back("");
} }
m_pcBrowser->setLines(&m_browserListLines); m_pcBrowser->setLines(&m_browserListLines);

View File

@@ -389,6 +389,20 @@ void CListFrame::refreshScroll(void)
} }
} }
int CListFrame::paintListIcon(int x, int y, int line)
{
int xDiff = 0;
if (m_pLines->Icon[line] != "") {
int icol_w, icol_h;
frameBuffer->getIconSize(m_pLines->Icon[line].c_str(), &icol_w, &icol_h);
if ((icol_w > 0) && (icol_h > 0)) {
frameBuffer->paintIcon(m_pLines->Icon[line], x+m_cFrame.iX, y+m_cFrame.iY-m_nFontListHeight, m_nFontListHeight);
xDiff = icol_w + TEXT_BORDER_WIDTH;
}
}
return xDiff;
}
void CListFrame::refreshList(void) void CListFrame::refreshList(void)
{ {
//TRACE("[CListFrame]->refreshList: %d\r\n",m_nCurrentLine); //TRACE("[CListFrame]->refreshList: %d\r\n",m_nCurrentLine);
@@ -417,6 +431,9 @@ void CListFrame::refreshList(void)
int width; int width;
int x = m_cFrameListRel.iX + TEXT_BORDER_WIDTH; int x = m_cFrameListRel.iX + TEXT_BORDER_WIDTH;
y += m_nFontListHeight; y += m_nFontListHeight;
int xDiff = paintListIcon(x, y, line);
int net_width = m_cFrameListRel.iWidth - ROW_BORDER_WIDTH * (m_pLines->rows - 1); int net_width = m_cFrameListRel.iWidth - ROW_BORDER_WIDTH * (m_pLines->rows - 1);
for(int row = 0; row < m_pLines->rows; row++) for(int row = 0; row < m_pLines->rows; row++)
{ {
@@ -426,8 +443,10 @@ void CListFrame::refreshList(void)
width = m_cFrameListRel.iWidth - x + m_cFrameListRel.iX - TEXT_BORDER_WIDTH; width = m_cFrameListRel.iWidth - x + m_cFrameListRel.iX - TEXT_BORDER_WIDTH;
//TRACE(" normalize width to %d , x:%d \r\n",width,x); //TRACE(" normalize width to %d , x:%d \r\n",width,x);
} }
m_pcFontList->RenderString(x+m_cFrame.iX, y+m_cFrame.iY, if (row > 0)
width, m_pLines->lineArray[row][line].c_str(), xDiff = 0;
m_pcFontList->RenderString(x+m_cFrame.iX+xDiff, y+m_cFrame.iY,
width-xDiff, m_pLines->lineArray[row][line].c_str(),
color, 0, true); // UTF-8 color, 0, true); // UTF-8
x += width + ROW_BORDER_WIDTH; x += width + ROW_BORDER_WIDTH;
} }
@@ -462,13 +481,18 @@ void CListFrame::refreshLine(int line)
int width; int width;
int x = m_cFrameListRel.iX + TEXT_BORDER_WIDTH; int x = m_cFrameListRel.iX + TEXT_BORDER_WIDTH;
y += m_nFontListHeight; y += m_nFontListHeight;
int xDiff = paintListIcon(x, y, line);
int net_width = m_cFrameListRel.iWidth - ROW_BORDER_WIDTH * (m_pLines->rows - 1); int net_width = m_cFrameListRel.iWidth - ROW_BORDER_WIDTH * (m_pLines->rows - 1);
for(int row = 0; row < m_pLines->rows; row++) for(int row = 0; row < m_pLines->rows; row++)
{ {
width = std::min(m_pLines->rowWidth[row] * net_width / 100, width = std::min(m_pLines->rowWidth[row] * net_width / 100,
m_cFrameListRel.iWidth - x + m_cFrameListRel.iX - TEXT_BORDER_WIDTH); m_cFrameListRel.iWidth - x + m_cFrameListRel.iX - TEXT_BORDER_WIDTH);
m_pcFontList->RenderString(x+m_cFrame.iX, y+m_cFrame.iY, if (row > 0)
width, m_pLines->lineArray[row][line].c_str(), xDiff = 0;
m_pcFontList->RenderString(x+m_cFrame.iX+xDiff, y+m_cFrame.iY,
width-xDiff, m_pLines->lineArray[row][line].c_str(),
color, 0, true); // UTF-8 color, 0, true); // UTF-8
x += width + ROW_BORDER_WIDTH; x += width + ROW_BORDER_WIDTH;
} }

View File

@@ -63,6 +63,7 @@ typedef struct
std::string lineHeader[LF_MAX_ROWS]; std::string lineHeader[LF_MAX_ROWS];
std::vector<std::string> lineArray[LF_MAX_ROWS]; std::vector<std::string> lineArray[LF_MAX_ROWS];
int rowWidth[LF_MAX_ROWS]; int rowWidth[LF_MAX_ROWS];
std::vector<std::string> Icon;
}LF_LINES; }LF_LINES;
class CListFrame class CListFrame
@@ -78,6 +79,7 @@ class CListFrame
void refreshHeaderList(void); void refreshHeaderList(void);
void reSizeMainFrameWidth(int maxTextWidth); void reSizeMainFrameWidth(int maxTextWidth);
void reSizeMainFrameHeight(int maxTextHeight); void reSizeMainFrameHeight(int maxTextHeight);
int paintListIcon(int x, int y, int line);
/* Variables */ /* Variables */
LF_LINES* m_pLines; LF_LINES* m_pLines;