diff options
author | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2014-04-03 20:22:49 +0200 |
---|---|---|
committer | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2014-04-03 20:22:49 +0200 |
commit | 68672a09fa611a8d64989192e6270214c73256db (patch) | |
tree | 653637434c90d23bd041f9db379441e4da794216 | |
parent | 9df36839398d1b3ddba93860cdb9d4923b55155c (diff) | |
download | skin-flatplus-68672a09fa611a8d64989192e6270214c73256db.tar.gz skin-flatplus-68672a09fa611a8d64989192e6270214c73256db.tar.bz2 |
add more options to show disk usage
-rw-r--r-- | HISTORY | 3 | ||||
-rw-r--r-- | baserender.c | 244 | ||||
-rw-r--r-- | baserender.h | 4 | ||||
-rw-r--r-- | displaymenu.c | 295 | ||||
-rw-r--r-- | po/de_DE.po | 20 | ||||
-rw-r--r-- | setup.c | 69 |
6 files changed, 334 insertions, 301 deletions
@@ -4,6 +4,7 @@ VDR Plugin 'skinflatplus' Revision History 2014-XX-XX: Versioin 0.3.0 - [update] channel logo in wide format (like 3PO or creimer logos) - [add] TVScraper support +- [add] more options to show disk usage (not show; timer & recording menu; always on the menu; always show) 2014-25-03: Version 0.2.1 - [fix] epgsearch progessbar in SetItemEvent, if epg start time is after now (2 minutes tolerance) @@ -21,7 +22,7 @@ VDR Plugin 'skinflatplus' Revision History - [add] show cutted length of recording in replay info - [add] update script to update MV-Themes (contrib/flatPlus_MV_Update.sh) - [add] timer conflicts in TopBar, active epgsearch is needed, configurable via menu settings - you can configure a min value at which it will shown in red (otherwise yellow) + you can configure a min value at which it will shown in red (otherwise yellow) - [add] display audio channel icons in audio tracks menu 2014-02-22: Version 0.2.0 diff --git a/baserender.c b/baserender.c index a0805baf..5e3b7ed3 100644 --- a/baserender.c +++ b/baserender.c @@ -11,10 +11,10 @@ cFlatBaseRender::cFlatBaseRender(void) { fontHeight = font->Height(); fontSmlHeight = fontSml->Height(); fontFixedHeight = fontFixed->Height(); - + topBarTitle = ""; - tobBarTitleExtra1 = ""; - tobBarTitleExtra2 = ""; + tobBarTitleExtra1 = ""; + tobBarTitleExtra2 = ""; topBarLastDate = ""; topBarUpdateTitle = false; topBarHeight = 0; @@ -26,10 +26,10 @@ cFlatBaseRender::cFlatBaseRender(void) { marginItem = 5; scrollBarWidth = 10; - + buttonsHeight = 0; buttonsDrawn = false; - + osd = NULL; topBarPixmap = NULL; buttonsPixmap = NULL; @@ -38,7 +38,7 @@ cFlatBaseRender::cFlatBaseRender(void) { progressBarPixmap = NULL; progressBarPixmapBg = NULL; decorPixmap = NULL; - + Config.ThemeCheckAndInit(); Config.DecorCheckAndInit(); } @@ -68,7 +68,7 @@ cFlatBaseRender::~cFlatBaseRender(void) { osd->DestroyPixmap(topBarIconPixmap); if( topBarIconBGPixmap ) osd->DestroyPixmap(topBarIconBGPixmap); - + delete osd; } } @@ -86,7 +86,7 @@ void cFlatBaseRender::CreateOsd(int left, int top, int width, int height) { osd = cOsdProvider::NewOsd(left, top); if (osd) { tArea Area = { 0, 0, width, height, 32 }; - if (osd->SetAreas(&Area, 1) == oeOk) { + if (osd->SetAreas(&Area, 1) == oeOk) { //dsyslog("skinflatplus: create osd SUCCESS left: %d top: %d width: %d height: %d", left, top, width, height); return; } @@ -113,6 +113,9 @@ void cFlatBaseRender::TopBarCreate(void) { topBarPixmap->Fill(clrTransparent); topBarIconBGPixmap->Fill(clrTransparent); topBarIconPixmap->Fill(clrTransparent); + + if( Config.DiskUsageShow == 3) + TopBarEnableDiskUsage(); } void cFlatBaseRender::TopBarSetTitle(cString title) { @@ -126,6 +129,8 @@ void cFlatBaseRender::TopBarSetTitle(cString title) { topBarMenuIconSet = false; topBarMenuLogo = ""; topBarMenuLogoSet = false; + if( Config.DiskUsageShow == 3) + TopBarEnableDiskUsage(); } void cFlatBaseRender::TopBarSetTitleExtra(cString extra1, cString extra2) { @@ -158,47 +163,73 @@ void cFlatBaseRender::TopBarSetMenuLogo(cString icon) { topBarUpdateTitle = true; } +void cFlatBaseRender::TopBarEnableDiskUsage(void) { + cVideoDiskUsage::HasChanged(VideoDiskUsageState); + int DiskUsage = cVideoDiskUsage::UsedPercent(); + double FreeGB = cVideoDiskUsage::FreeMB() / 1024.0; + int FreeMinutes = cVideoDiskUsage::FreeMinutes(); + cString extra1 = cString::sprintf("%s: %d%%", tr("disk usage"), DiskUsage); + cString extra2 = cString::sprintf("%s: %.1f GB ~ %02d:%02d", tr("free"), FreeGB, FreeMinutes / 60, FreeMinutes % 60); + + cString iconName("chart1"); + if( DiskUsage > 14 ) + iconName = "chart2"; + if( DiskUsage > 28 ) + iconName = "chart3"; + if( DiskUsage > 42 ) + iconName = "chart4"; + if( DiskUsage > 56 ) + iconName = "chart5"; + if( DiskUsage > 70 ) + iconName = "chart6"; + if( DiskUsage > 84 ) + iconName = "chart7"; + + TopBarSetTitleExtra(extra1, extra2); + TopBarSetExtraIcon(iconName); +} // sollte bei jedum "Flush" aufgerufen werden! void cFlatBaseRender::TopBarUpdate(void) { cString curDate = DayDateTime(); int TopBarWidth = osdWidth - Config.decorBorderTopBarSize*2; int MenuIconWidth = 0; - + if ( strcmp(curDate, topBarLastDate) || topBarUpdateTitle ) { topBarUpdateTitle = false; topBarLastDate = curDate; int TitleWidthLeft = TopBarWidth; - + int fontTop = (topBarHeight - topBarFontHeight) / 2; int fontSmlTop = (topBarHeight - topBarFontSmlHeight*2) / 2; int RecLeft = TopBarWidth / 2; - - topBarPixmap->Fill(Theme.Color(clrTopBarBg)); - int extra1Width = topBarFontSml->Width(tobBarTitleExtra1); - int extra2Width = topBarFontSml->Width(tobBarTitleExtra2); - int extraMaxWidth = max(extra1Width, extra2Width); - - int extraLeft = TopBarWidth/2 - extraMaxWidth/2; - topBarPixmap->DrawText(cPoint(extraLeft, fontSmlTop), tobBarTitleExtra1, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, extraMaxWidth, 0, taRight); - topBarPixmap->DrawText(cPoint(extraLeft, fontSmlTop + topBarFontSmlHeight), tobBarTitleExtra2, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, extraMaxWidth, 0, taRight); - - RecLeft = extraLeft + extraMaxWidth + marginItem; - + topBarPixmap->Fill(Theme.Color(clrTopBarBg)); topBarIconPixmap->Fill(clrTransparent); topBarIconBGPixmap->Fill(clrTransparent); - if( topBarExtraIconSet ) { - int extraIconLeft = extraLeft + extraMaxWidth + marginItem; - cImage *img = imgLoader.LoadIcon(*topBarExtraIcon, 999, topBarHeight); - if( img ) { - int iconTop = 0; - topBarIconPixmap->DrawImage(cPoint(extraIconLeft, iconTop), *img); - - RecLeft += topBarHeight + marginItem; - } - } + + int TitleWidth = topBarFont->Width(topBarTitle); + time_t t; + time(&t); + + cString time = TimeString(t); + cString time2 = cString::sprintf("%s %s", *time, tr("clock")); + + int timeWidth = topBarFont->Width(*time2) + marginItem*2; + topBarPixmap->DrawText(cPoint(TopBarWidth - timeWidth, fontTop), time2, Theme.Color(clrTopBarTimeFont), Theme.Color(clrTopBarBg), topBarFont); + + TitleWidthLeft -= timeWidth; + + cString weekday = WeekDayNameFull(t); + int weekdayWidth = topBarFontSml->Width(*weekday); + + cString date = ShortDateString(t); + int dateWidth = topBarFontSml->Width(*date); + + int fullWidth = max(weekdayWidth, dateWidth); + TitleWidthLeft -= fullWidth; + int DateRight = TopBarWidth - timeWidth - fullWidth - marginItem*2; if( topBarMenuIconSet && Config.TopBarMenuIconShow ) { int IconLeft = marginItem; @@ -210,7 +241,7 @@ void cFlatBaseRender::TopBarUpdate(void) { TitleWidthLeft -= MenuIconWidth + marginItem*3; } } - + if( topBarMenuLogoSet && Config.TopBarMenuIconShow ) { topBarIconPixmap->Fill(clrTransparent); int IconLeft = marginItem; @@ -225,7 +256,7 @@ void cFlatBaseRender::TopBarUpdate(void) { iconTop = (topBarHeight / 2 - imgBG->Height()/2); topBarIconBGPixmap->DrawImage( cPoint(IconLeft, iconTop), *imgBG ); } - + cImage *img = imgLoader.LoadLogo(*topBarMenuLogo, imageBGWidth - 4, imageBGHeight - 4); if( img ) { iconTop += (imageBGHeight - img->Height())/2; @@ -235,31 +266,35 @@ void cFlatBaseRender::TopBarUpdate(void) { MenuIconWidth = imageBGWidth+marginItem*2; TitleWidthLeft -= MenuIconWidth + marginItem*3; } - - time_t t; - time(&t); - cString time = TimeString(t); - cString time2 = cString::sprintf("%s %s", *time, tr("clock")); + int extra1Width = topBarFontSml->Width(tobBarTitleExtra1); + int extra2Width = topBarFontSml->Width(tobBarTitleExtra2); + int extraMaxWidth = max(extra1Width, extra2Width); - int timeWidth = topBarFont->Width(*time2) + marginItem*2; - topBarPixmap->DrawText(cPoint(TopBarWidth - timeWidth, fontTop), time2, Theme.Color(clrTopBarTimeFont), Theme.Color(clrTopBarBg), topBarFont); - - TitleWidthLeft -= timeWidth; - - cString weekday = WeekDayNameFull(t); - int weekdayWidth = topBarFontSml->Width(*weekday); + int extraLeft = TopBarWidth/2 - extraMaxWidth/2; + extraLeft = max(MenuIconWidth + marginItem*4 + TitleWidth, extraLeft); - cString date = ShortDateString(t); - int dateWidth = topBarFontSml->Width(*date); + topBarPixmap->DrawText(cPoint(extraLeft, fontSmlTop), tobBarTitleExtra1, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, extraMaxWidth, 0, taRight); + topBarPixmap->DrawText(cPoint(extraLeft, fontSmlTop + topBarFontSmlHeight), tobBarTitleExtra2, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, extraMaxWidth, 0, taRight); - int fullWidth = max(weekdayWidth, dateWidth); - TitleWidthLeft -= fullWidth; + RecLeft = extraLeft + extraMaxWidth + marginItem; + + if( topBarExtraIconSet ) { + int extraIconLeft = extraLeft + extraMaxWidth + marginItem; + cImage *img = imgLoader.LoadIcon(*topBarExtraIcon, 999, topBarHeight); + if( img ) { + if( (extraIconLeft + img->Width() + marginItem) < DateRight ) { + int iconTop = 0; + topBarIconPixmap->DrawImage(cPoint(extraIconLeft, iconTop), *img); + + RecLeft += topBarHeight + marginItem; + } + } + } topBarPixmap->DrawText(cPoint(TopBarWidth - timeWidth - fullWidth - marginItem*2, fontSmlTop), weekday, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, fullWidth, 0, taRight); topBarPixmap->DrawText(cPoint(TopBarWidth - timeWidth - fullWidth - marginItem*2, fontSmlTop + topBarFontSmlHeight), date, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, fullWidth, 0, taRight); - int DateRight = TopBarWidth - timeWidth - fullWidth - marginItem*2; - + DecorBorderDraw(Config.decorBorderTopBarSize, Config.decorBorderTopBarSize, osdWidth - Config.decorBorderTopBarSize*2, topBarHeight, Config.decorBorderTopBarSize, Config.decorBorderTopBarType, Config.decorBorderTopBarFg, Config.decorBorderTopBarBg); int RecW = 0; @@ -303,7 +338,7 @@ void cFlatBaseRender::TopBarUpdate(void) { imgCon = imgLoader.LoadIcon("topbar_timerconflict_low", topBarFontHeight - marginItem*2, topBarFontHeight - marginItem*2); else imgCon = imgLoader.LoadIcon("topbar_timerconflict_high", topBarFontHeight - marginItem*2, topBarFontHeight - marginItem*2); - + if( imgCon ) ConW = imgCon->Width(); if( numConflicts ) { @@ -312,7 +347,6 @@ void cFlatBaseRender::TopBarUpdate(void) { TitleWidthLeft -= ConW + marginItem*2; } - int TitleWidth = topBarFont->Width(topBarTitle); if( TitleWidth > TitleWidthLeft ) { int dotsWidth = topBarFont->Width("... "); cTextWrapper TitleWrapper(topBarTitle, topBarFont, TitleWidthLeft - dotsWidth); @@ -320,7 +354,7 @@ void cFlatBaseRender::TopBarUpdate(void) { topBarTitle = cString::sprintf("%s...", *topBarTitle); TitleWidth = topBarFont->Width(topBarTitle); } - + topBarPixmap->DrawText(cPoint(MenuIconWidth + marginItem*2, fontTop), topBarTitle, Theme.Color(clrTopBarFont), Theme.Color(clrTopBarBg), topBarFont); if( TitleWidth > RecLeft ) @@ -343,14 +377,14 @@ void cFlatBaseRender::TopBarUpdate(void) { topBarIconPixmap->DrawImage( cPoint(RecLeft, iconTop), *imgCon ); ConW = imgCon->Width(); } - + cString ConNum = cString::sprintf("%d", numConflicts); if( numConflicts < Config.TopBarRecConflictsHigh ) topBarPixmap->DrawText(cPoint(ConLeft + ConW + marginItem, fontSmlTop), ConNum, Theme.Color(clrTopBarConflictLowFg), Theme.Color(clrTopBarConflictLowBg), topBarFontSml); else topBarPixmap->DrawText(cPoint(ConLeft + ConW + marginItem, fontSmlTop), ConNum, Theme.Color(clrTopBarConflictHighFg), Theme.Color(clrTopBarConflictHighBg), topBarFontSml); } - + } } @@ -372,9 +406,9 @@ void cFlatBaseRender::ButtonsSet(const char *Red, const char *Green, const char buttonsPixmap->Fill(clrTransparent); DecorBorderClearByFrom(BorderButton); - + buttonsDrawn = false; - + int x = 0; if( !(!Config.ButtonsShowEmpty && !Red) ) { buttonsPixmap->DrawText(cPoint(x, 0), Red, Theme.Color(clrButtonFont), Theme.Color(clrButtonBg), font, buttonWidth, fontHeight + marginButtonColor, taCenter); @@ -392,7 +426,7 @@ void cFlatBaseRender::ButtonsSet(const char *Red, const char *Green, const char Config.decorBorderButtonFg, Config.decorBorderButtonBg, BorderButton); buttonsDrawn = true; } - + x += buttonWidth + marginItem + Config.decorBorderButtonSize*2; if( !(!Config.ButtonsShowEmpty && !Yellow) ) { buttonsPixmap->DrawText(cPoint(x, 0), Yellow, Theme.Color(clrButtonFont), Theme.Color(clrButtonBg), font, buttonWidth, fontHeight + marginButtonColor, taCenter); @@ -401,7 +435,7 @@ void cFlatBaseRender::ButtonsSet(const char *Red, const char *Green, const char Config.decorBorderButtonFg, Config.decorBorderButtonBg, BorderButton); buttonsDrawn = true; } - + x += buttonWidth + marginItem + Config.decorBorderButtonSize*2; if( x + buttonWidth + Config.decorBorderButtonSize*2 < buttonsWidth ) buttonWidth += buttonsWidth - (x + buttonWidth + Config.decorBorderButtonSize*2); @@ -428,7 +462,7 @@ void cFlatBaseRender::MessageCreate(void) { void cFlatBaseRender::MessageSet(eMessageType Type, const char *Text) { tColor col = Theme.Color(clrMessageStatus); switch (Type) { - case mtStatus: + case mtStatus: col = Theme.Color(clrMessageStatus); break; case mtInfo: @@ -471,7 +505,7 @@ void cFlatBaseRender::MessageSet(eMessageType Type, const char *Text) { messagePixmap->DrawText(cPoint((osdWidth - textWidth) / 2, marginItem), Text, Theme.Color(clrMessageFont), Theme.Color(clrMessageBg), font); } else messagePixmap->DrawText(cPoint((osdWidth - textWidth) / 2, marginItem), Text, Theme.Color(clrMessageFont), Theme.Color(clrMessageBg), font); - + int top = osdHeight - Config.MessageOffset - messageHeight - Config.decorBorderMessageSize; DecorBorderDraw(Config.decorBorderMessageSize, top, osdWidth - Config.decorBorderMessageSize*2, messageHeight, Config.decorBorderMessageSize, Config.decorBorderMessageType, Config.decorBorderMessageFg, Config.decorBorderMessageBg, BorderMessage); @@ -493,7 +527,7 @@ void cFlatBaseRender::ContentCreate(int Left, int Top, int Width, int Height, in contentWidth = Width; contentHeight = Height; int lines = ContentVisibleLines(); - + if( contentFontType == 0 ) contentHeight = lines * fontHeight; else if( contentFontType == 1 ) @@ -510,7 +544,7 @@ void cFlatBaseRender::ContentSet(const char *Text, tColor ColorFg, tColor ColorB contentWrapper.Set(Text, fontFixed, contentWidth - marginItem*2); else if( contentFontType == 2 ) contentWrapper.Set(Text, fontSml, contentWidth - marginItem*2); - + contentColorFg = ColorFg; contentColorBg = ColorBg; @@ -525,7 +559,7 @@ void cFlatBaseRender::ContentSet(const char *Text, tColor ColorFg, tColor ColorB contentWrapperHeight = (contentWrapper.Lines()+1) * fontSmlHeight; contentTextHeight = (contentWrapper.Lines()) * fontSmlHeight + marginItem; } - + if( contentWrapperHeight > contentHeight ) { contentDrawPortHeight = contentWrapperHeight; contentHasScrollbar = true; @@ -536,7 +570,7 @@ void cFlatBaseRender::ContentSet(const char *Text, tColor ColorFg, tColor ColorB if( contentPixmap ) osd->DestroyPixmap(contentPixmap); - + contentPixmap = osd->CreatePixmap(2, cRect(contentLeft, contentTop, contentWidth, contentHeight), cRect(0, 0, contentWidth, contentDrawPortHeight)); @@ -570,7 +604,7 @@ bool cFlatBaseRender::ContentWillItBeScrollable(int Width, int Height, const cha if( wrapper.Lines() > 0 && wrapper.Lines() > VisibleLines ) return true; - + return false; } @@ -603,7 +637,7 @@ int cFlatBaseRender::ContentScrollOffset(void) { h = fontFixedHeight; else if( contentFontType == 2 ) h = fontSmlHeight; - + if ( ((-1)*contentPixmap->DrawPort().Point().Y() + contentHeight + h) > contentDrawPortHeight) { offset = (double)1 - ScrollbarSize(); //dsyslog("1 offset %f h %d return %d", offset, h, (int)(ContentScrollTotal() * offset)); @@ -613,7 +647,7 @@ int cFlatBaseRender::ContentScrollOffset(void) { //dsyslog("contentHeight %d Y %d", contentHeight, contentPixmap->DrawPort().Point().Y()); //dsyslog("contentDrawPortHeight %d Y %d", contentDrawPortHeight, contentPixmap->DrawPort().Point().Y()); } - + return ContentScrollTotal() * offset; } @@ -632,7 +666,7 @@ bool cFlatBaseRender::ContentScroll(bool Up, bool Page) { int totalHeight = contentPixmap->DrawPort().Height(); int screenHeight = contentPixmap->ViewPort().Height(); int lineHeight = 0; - + if( contentFontType == 0 ) lineHeight = fontHeight; else if( contentFontType == 1 ) @@ -705,16 +739,16 @@ void cFlatBaseRender::ProgressBarCreate(int Left, int Top, int Width, int Height ProgressType = Type; progressBarMarginHor = MarginHor; progressBarMarginVer = MarginVer; - + progressBarColorFg = ColorFg; progressBarColorBarFg = ColorBarFg; progressBarColorBg = ColorBg; - + progressBarSetBackground = SetBackground; progressBarIsSignal = isSignal; - + progressBarColorBarCurFg = Theme.Color(clrReplayProgressBarCurFg); - + progressBarPixmap = osd->CreatePixmap(3, cRect(Left, Top, Width, progressBarHeight)); progressBarPixmapBg = osd->CreatePixmap(2, cRect(Left - progressBarMarginVer, Top - progressBarMarginHor, Width + progressBarMarginVer*2, progressBarHeight + progressBarMarginHor*2)); progressBarPixmap->Fill(clrTransparent); @@ -733,19 +767,19 @@ void cFlatBaseRender::ProgressBarDrawBgColor(void) { void cFlatBaseRender::ProgressBarDrawRaw(cPixmap *Pixmap, cPixmap *PixmapBg, cRect rect, cRect rectBg, int Current, int Total, tColor ColorFg, tColor ColorBarFg, tColor ColorBg, int Type, bool SetBackground, bool isSignal) { int Middle = rect.Height()/2; - + double percentLeft = ((double)Current) / (double)Total; if( PixmapBg && SetBackground ) PixmapBg->DrawRectangle(cRect( rectBg.Left(), rectBg.Top(), rectBg.Width(), rectBg.Height()), ColorBg); - + if( SetBackground ) { if( PixmapBg == Pixmap ) Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top(), rect.Width(), rect.Height()), ColorBg); else Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top(), rect.Width(), rect.Height()), clrTransparent); } - + switch( Type ) { case 0: // small line + big line { @@ -761,7 +795,7 @@ void cFlatBaseRender::ProgressBarDrawRaw(cPixmap *Pixmap, cPixmap *PixmapBg, cRe break; } case 1: // big line - { + { int big = rect.Height(); if (Current > 0) @@ -769,7 +803,7 @@ void cFlatBaseRender::ProgressBarDrawRaw(cPixmap *Pixmap, cPixmap *PixmapBg, cRe break; } case 2: // big line + outline - { + { int big = rect.Height(); int out = 1; if( rect.Height() > 10 ) @@ -777,10 +811,10 @@ void cFlatBaseRender::ProgressBarDrawRaw(cPixmap *Pixmap, cPixmap *PixmapBg, cRe // outline Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top(), rect.Width(), out), ColorFg); Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top() + rect.Height() - out, rect.Width(), out), ColorFg); - + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top(), out, rect.Height()), ColorFg); Pixmap->DrawRectangle(cRect( rect.Left() + rect.Width() - out, rect.Top(), out, rect.Height()), ColorFg); - + if (Current > 0) { if( isSignal ) { double perc = 100.0 / (double) Total * (double) Current / 100.0; @@ -793,7 +827,7 @@ void cFlatBaseRender::ProgressBarDrawRaw(cPixmap *Pixmap, cPixmap *PixmapBg, cRe Pixmap->DrawRectangle(cRect( rect.Left() + out, rect.Top() + Middle - (big/2) + out, (rect.Width() * 0.333) - out*2, big - out*2), Theme.Color(clrButtonRed)); } else Pixmap->DrawRectangle(cRect( rect.Left() + out, rect.Top() + Middle - (big/2) + out, (rect.Width() * percentLeft) - out*2, big - out*2), Theme.Color(clrButtonRed)); - + } else Pixmap->DrawRectangle(cRect( rect.Left() + out, rect.Top() + Middle - (big/2) + out, (rect.Width() * percentLeft) - out*2, big - out*2), ColorBarFg); } @@ -827,7 +861,7 @@ void cFlatBaseRender::ProgressBarDrawRaw(cPixmap *Pixmap, cPixmap *PixmapBg, cRe break; } case 5: // big line + outline + dot - { + { int big = rect.Height(); int out = 1; if( rect.Height() > 10 ) @@ -837,7 +871,7 @@ void cFlatBaseRender::ProgressBarDrawRaw(cPixmap *Pixmap, cPixmap *PixmapBg, cRe Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top() + rect.Height() - out, rect.Width(), out), ColorFg); Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top(), out, rect.Height()), ColorFg); Pixmap->DrawRectangle(cRect( rect.Left() + rect.Width() - out, rect.Top(), out, rect.Height()), ColorFg); - + if (Current > 0) { Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top() + Middle - (big/2), (rect.Width() * percentLeft), big), ColorBarFg); // dot @@ -861,7 +895,7 @@ void cFlatBaseRender::ProgressBarDrawRaw(cPixmap *Pixmap, cPixmap *PixmapBg, cRe break; } case 7: // outline + dot - { + { int big = rect.Height(); int out = 1; if( rect.Height() > 10 ) @@ -871,7 +905,7 @@ void cFlatBaseRender::ProgressBarDrawRaw(cPixmap *Pixmap, cPixmap *PixmapBg, cRe Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top() + rect.Height() - out, rect.Width(), out), ColorFg); Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top(), out, rect.Height()), ColorFg); Pixmap->DrawRectangle(cRect( rect.Left() + rect.Width() - out, rect.Top(), out, rect.Height()), ColorFg); - + if (Current > 0) { // dot Pixmap->DrawEllipse(cRect( rect.Left() + (rect.Width() * percentLeft) - (big/2), rect.Top() + Middle - (big/2), big, big), ColorBarFg, 0); @@ -910,18 +944,18 @@ void cFlatBaseRender::ProgressBarDrawMarks(int Current, int Total, const cMarks progressBarColorMark = Color; progressBarColorMarkCurrent = ColorCurrent; int posMark = 0, posMarkLast = 0, posCurrent = 0; - + int top = progressBarHeight / 2; if( progressBarPixmapBg ) progressBarPixmapBg->DrawRectangle(cRect( 0, progressBarMarginHor + progressBarHeight, progressBarWidth, progressBarMarginHor), progressBarColorBg); - + progressBarPixmap->Fill( progressBarColorBg ); int sml = Config.decorProgressReplaySize / 10 * 2; if( sml <= 4 ) sml = 4; int big = Config.decorProgressReplaySize - sml*2 - 2; - + if( !Marks ) { progressBarColorFg = progressBarColorBarCurFg; progressBarColorBarFg = progressBarColorBarCurFg; @@ -941,7 +975,7 @@ void cFlatBaseRender::ProgressBarDrawMarks(int Current, int Total, const cMarks progressBarPixmap->DrawRectangle(cRect( 0, top - sml/2, progressBarWidth, sml), progressBarColorFg); bool Start = true; - + for( const cMark *m = Marks->First(); m; m = Marks->Next(m) ) { posMark = ProgressBarMarkPos( m->Position(), Total ); posCurrent = ProgressBarMarkPos( Current, Total ); @@ -950,13 +984,13 @@ void cFlatBaseRender::ProgressBarDrawMarks(int Current, int Total, const cMarks posMarkLast = posMark; Start = !Start; } - + // draw last marker vertical line if( posCurrent == posMark ) progressBarPixmap->DrawRectangle(cRect( posMark - sml, 0, sml*2, progressBarHeight), progressBarColorMarkCurrent); else progressBarPixmap->DrawRectangle(cRect( posMark - sml/2, 0, sml, progressBarHeight), progressBarColorMark); - + if( !Start ) { //progressBarPixmap->DrawRectangle(cRect( posMarkLast + sml/2, top - big/2, progressBarWidth - posMarkLast, big), progressBarColorBarFg); if( posCurrent > posMarkLast ) @@ -982,7 +1016,7 @@ void cFlatBaseRender::ProgressBarDrawMark(int posMark, int posMarkLast, int posC if( sml <= 4 ) sml = 4; int big = Config.decorProgressReplaySize - sml*2 - 2; - + int mbig = Config.decorProgressReplaySize*2; if( Config.decorProgressReplaySize > 15 ) mbig = Config.decorProgressReplaySize; @@ -1032,7 +1066,7 @@ void cFlatBaseRender::ProgressBarDrawMark(int posMark, int posMarkLast, int posC progressBarPixmap->DrawRectangle(cRect( posMarkLast - sml, 0, sml*2, progressBarHeight), progressBarColorMarkCurrent); else if( posMarkLast != 0 ) progressBarPixmap->DrawRectangle(cRect( posMarkLast - sml/2, 0, sml, progressBarHeight), progressBarColorMark); - + } void cFlatBaseRender::ScrollbarDraw(cPixmap *Pixmap, int Left, int Top, int Height, int Total, int Offset, int Shown, bool CanScrollUp, bool CanScrollDown) { @@ -1105,7 +1139,7 @@ void cFlatBaseRender::DecorBorderClearAll(void) { void cFlatBaseRender::DecorBorderDraw(int Left, int Top, int Width, int Height, int Size, int Type, tColor ColorFg, tColor ColorBg, int From, bool Store) { if( Size == 0 || Type <= 0 ) return; - + if( Store ) { sDecorBorder f; f.Left = Left; @@ -1117,10 +1151,10 @@ void cFlatBaseRender::DecorBorderDraw(int Left, int Top, int Width, int Height, f.ColorFg = ColorFg; f.ColorBg = ColorBg; f.From = From; - + Borders.push_back(f); } - + int LeftDecor = Left - Size; int TopDecor = Top - Size; int WidthDecor = Width + Size*2; @@ -1131,7 +1165,7 @@ void cFlatBaseRender::DecorBorderDraw(int Left, int Top, int Width, int Height, decorPixmap = osd->CreatePixmap(4, cRect(0, 0, cOsd::OsdWidth(), cOsd::OsdHeight())); decorPixmap->Fill(clrTransparent); } - + switch( Type ) { case 1: // rect // top @@ -1190,7 +1224,7 @@ void cFlatBaseRender::DecorBorderDraw(int Left, int Top, int Width, int Height, DecorDrawGlowRectVer(decorPixmap, LeftDecor, TopDecor + Size, Size, HeightDecor - Size*2, ColorBg); // right DecorDrawGlowRectVer(decorPixmap, LeftDecor + Size + Width, TopDecor + Size, -1*Size, HeightDecor - Size*2, ColorBg); - + DecorDrawGlowRectTL(decorPixmap, LeftDecor, TopDecor, Size, Size, ColorBg); DecorDrawGlowRectTR(decorPixmap, LeftDecor + Size + Width, TopDecor, Size, Size, ColorBg); DecorDrawGlowRectBL(decorPixmap, LeftDecor, TopDecor + Size + Height, Size, Size, ColorBg); @@ -1205,7 +1239,7 @@ void cFlatBaseRender::DecorBorderDraw(int Left, int Top, int Width, int Height, DecorDrawGlowRectVer(decorPixmap, LeftDecor, TopDecor + Size, Size, HeightDecor - Size*2, ColorBg); // right DecorDrawGlowRectVer(decorPixmap, LeftDecor + Size + Width, TopDecor + Size, -1*Size, HeightDecor - Size*2, ColorBg); - + DecorDrawGlowEllipseTL(decorPixmap, LeftDecor, TopDecor, Size, Size, ColorBg, 2); DecorDrawGlowEllipseTR(decorPixmap, LeftDecor + Size + Width, TopDecor, Size, Size, ColorBg, 1); DecorDrawGlowEllipseBL(decorPixmap, LeftDecor, TopDecor + Size + Height, Size, Size, ColorBg, 3); @@ -1220,7 +1254,7 @@ void cFlatBaseRender::DecorBorderDraw(int Left, int Top, int Width, int Height, DecorDrawGlowRectVer(decorPixmap, LeftDecor, TopDecor + Size, Size, HeightDecor - Size*2, ColorBg); // right DecorDrawGlowRectVer(decorPixmap, LeftDecor + Size + Width, TopDecor + Size, -1*Size, HeightDecor - Size*2, ColorBg); - + DecorDrawGlowEllipseTL(decorPixmap, LeftDecor, TopDecor, Size, Size, ColorBg, -4); DecorDrawGlowEllipseTR(decorPixmap, LeftDecor + Size + Width, TopDecor, Size, Size, ColorBg, -3); DecorDrawGlowEllipseBL(decorPixmap, LeftDecor, TopDecor + Size + Height, Size, Size, ColorBg, -1); @@ -1246,7 +1280,7 @@ tColor cFlatBaseRender::SetAlpha(tColor Color, double am) uint8_t R = (Color & 0x00FF0000) >> 16; uint8_t G = (Color & 0x0000FF00) >> 8; uint8_t B = (Color & 0x000000FF); - + A = A * am; return ArgbToColor(A, R, G, B); } @@ -1330,7 +1364,7 @@ void cFlatBaseRender::DecorDrawGlowRectBR(cPixmap *pixmap, int Left, int Top, in void cFlatBaseRender::DecorDrawGlowEllipseTL(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg, int type) { double Alpha; - + for(int i = 0, j = Width; i < Width; i++, j--) { if( VDRVERSNUM < 20002 && j == 1 ) // in VDR Version < 2.0.2 osd breaks if width & height == 1 continue; @@ -1366,7 +1400,7 @@ void cFlatBaseRender::DecorDrawGlowEllipseBL(cPixmap *pixmap, int Left, int Top, void cFlatBaseRender::DecorDrawGlowEllipseBR(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg, int type) { double Alpha; - + for(int i = 0, j = Width; i < Width; i++, j--) { if( VDRVERSNUM < 20002 && j == 1 ) // in VDR Version < 2.0.2 osd breaks if width & height == 1 continue; diff --git a/baserender.h b/baserender.h index bf583f02..947533a2 100644 --- a/baserender.h +++ b/baserender.h @@ -55,6 +55,7 @@ class cFlatBaseRender bool topBarUpdateTitle; cString topBarLastDate; int topBarHeight; + int VideoDiskUsageState; // Progressbar cPixmap *progressBarPixmap; @@ -112,7 +113,8 @@ class cFlatBaseRender void DecorDrawGlowEllipseTR(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg, int type); void DecorDrawGlowEllipseBL(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg, int type); void DecorDrawGlowEllipseBR(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg, int type); - + + void TopBarEnableDiskUsage(void); //tColor Multiply(tColor Color, uint8_t Alpha); tColor SetAlpha(tColor Color, double am); public: diff --git a/displaymenu.c b/displaymenu.c index f8f93c5d..db7dd733 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -38,11 +38,11 @@ cFlatDisplayMenu::cFlatDisplayMenu(void) { MessageCreate(); VideoDiskUsageState = -1; - + itemHeight = fontHeight + Config.MenuItemPadding + Config.decorBorderMenuItemSize*2; itemChannelHeight = fontHeight + Config.MenuItemPadding + Config.decorBorderMenuItemSize*2; itemTimerHeight = fontHeight + Config.MenuItemPadding + Config.decorBorderMenuItemSize*2; - + scrollBarWidth = ScrollBarWidth() + marginItem; scrollBarHeight = osdHeight - (topBarHeight + Config.decorBorderTopBarSize*2 + marginItem*3 + buttonsHeight + Config.decorBorderButtonSize*2); @@ -51,29 +51,29 @@ cFlatDisplayMenu::cFlatDisplayMenu(void) { ShowEvent = false; ShowRecording = false; ShowText = false; - + ItemEventLastChannelName = ""; - + menuWidth = osdWidth; menuTop = topBarHeight + marginItem + Config.decorBorderTopBarSize*2 + Config.decorBorderMenuItemSize; menuPixmap = osd->CreatePixmap(1, cRect(0, menuTop, menuWidth, scrollBarHeight )); menuIconsBGPixmap = osd->CreatePixmap(2, cRect(0, menuTop, menuWidth, scrollBarHeight )); menuIconsPixmap = osd->CreatePixmap(3, cRect(0, menuTop, menuWidth, scrollBarHeight )); - + chLeft = Config.decorBorderMenuContentHeadSize; chTop = topBarHeight + marginItem + Config.decorBorderTopBarSize*2 + Config.decorBorderMenuContentHeadSize; chWidth = menuWidth - Config.decorBorderMenuContentHeadSize*2; chHeight = fontHeight + fontSmlHeight*2 + marginItem*2; contentHeadPixmap = osd->CreatePixmap(1, cRect(chLeft, chTop, chWidth, chHeight)); - + scrollbarPixmap = osd->CreatePixmap(2, cRect(0, scrollBarTop, menuWidth, scrollBarHeight + buttonsHeight + Config.decorBorderButtonSize*2)); menuPixmap->Fill(clrTransparent); menuIconsPixmap->Fill(clrTransparent); menuIconsBGPixmap->Fill(clrTransparent); scrollbarPixmap->Fill(clrTransparent); - + menuCategory = mcUndefined; bmNew = &bmCNew; @@ -96,9 +96,9 @@ void cFlatDisplayMenu::SetMenuCategory(eMenuCategory MenuCategory) { ItemBorderClear(); isScrolling = false; ShowRecording = ShowEvent = ShowText = false; - + menuCategory = MenuCategory; - + if( menuCategory == mcChannel ) { if( Config.MenuChannelView == 0 || Config.MenuChannelView == 1 || Config.MenuChannelView == 2 ) itemChannelHeight = fontHeight + Config.MenuItemPadding + Config.decorBorderMenuItemSize*2; @@ -120,7 +120,7 @@ void cFlatDisplayMenu::SetMenuCategory(eMenuCategory MenuCategory) { else if( Config.MenuRecordingView == 2 || Config.MenuRecordingView == 3 ) itemRecordingHeight = fontHeight + fontSmlHeight + marginItem + Config.MenuItemPadding + Config.decorBorderMenuItemSize*2; } - + } void cFlatDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown, bool isContent) { @@ -134,7 +134,7 @@ void cFlatDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, int Top, menuPixmap->DrawRectangle(cRect(menuItemWidth - scrollBarWidth + Config.decorBorderMenuContentSize, 0, scrollBarWidth + marginItem, scrollBarHeight), clrTransparent); else menuPixmap->DrawRectangle(cRect(menuItemWidth - scrollBarWidth + Config.decorBorderMenuItemSize, 0, scrollBarWidth + marginItem, scrollBarHeight), clrTransparent); - + } } else if( ShowEvent == false && ShowRecording == false && ShowText == false ) { isScrolling = false; @@ -144,7 +144,7 @@ void cFlatDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, int Top, ScrollbarDraw(scrollbarPixmap, menuItemWidth - scrollBarWidth + Config.decorBorderMenuContentSize*2 + marginItem, Top, Height, Total, Offset, Shown, CanScrollUp, CanScrollDown); else ScrollbarDraw(scrollbarPixmap, menuItemWidth - scrollBarWidth + Config.decorBorderMenuItemSize*2 + marginItem, Top, Height, Total, Offset, Shown, CanScrollUp, CanScrollDown); - + } void cFlatDisplayMenu::SetScrollbar(int Total, int Offset) { @@ -204,35 +204,8 @@ void cFlatDisplayMenu::Clear(void) { } void cFlatDisplayMenu::SetTitle(const char *Title) { - if( (menuCategory == mcRecording || menuCategory == mcTimer) && Config.DiskUsageShow ) { - cVideoDiskUsage::HasChanged(VideoDiskUsageState); - int DiskUsage = cVideoDiskUsage::UsedPercent(); - double FreeGB = cVideoDiskUsage::FreeMB() / 1024.0; - int FreeMinutes = cVideoDiskUsage::FreeMinutes(); - cString extra1 = cString::sprintf("%s: %d%%", tr("disk usage"), DiskUsage); - cString extra2 = cString::sprintf("%s: %.1f GB ~ %02d:%02d", tr("free"), FreeGB, FreeMinutes / 60, FreeMinutes % 60); - - cString iconName("chart1"); - if( DiskUsage > 14 ) - iconName = "chart2"; - if( DiskUsage > 28 ) - iconName = "chart3"; - if( DiskUsage > 42 ) - iconName = "chart4"; - if( DiskUsage > 56 ) - iconName = "chart5"; - if( DiskUsage > 70 ) - iconName = "chart6"; - if( DiskUsage > 84 ) - iconName = "chart7"; - - TopBarSetTitle(Title); - TopBarSetTitleExtra(extra1, extra2); - TopBarSetExtraIcon(iconName); - } else { - TopBarSetTitle(Title); - } - + TopBarSetTitle(Title); + if( Config.TopBarMenuIconShow ) { cString icon; switch( menuCategory ) { @@ -270,6 +243,10 @@ void cFlatDisplayMenu::SetTitle(const char *Title) { icon = ""; } TopBarSetMenuIcon(icon); + + if( (menuCategory == mcRecording || menuCategory == mcTimer) && Config.DiskUsageShow == 1 || Config.DiskUsageShow == 2 | Config.DiskUsageShow == 3) { + TopBarEnableDiskUsage(); + } } } @@ -288,13 +265,13 @@ void cFlatDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool S ShowEvent = false; ShowRecording = false; ShowText = false; - + int y = Index * itemHeight; menuItemWidth = menuWidth - Config.decorBorderMenuItemSize*2; if( menuCategory == mcMain ) menuItemWidth *= Config.MainMenuItemScale; - + int AvailableTextWidth = menuItemWidth - scrollBarWidth; if( isScrolling ) menuItemWidth -= scrollBarWidth; @@ -331,9 +308,9 @@ void cFlatDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool S bool isRecording = false; bool hasVPS = false; bool isRunning = false; - + int xt = Tab(i); - + if( xt >= menuItemWidth ) continue; if( true ) { @@ -348,7 +325,7 @@ void cFlatDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool S && isdigit(*s) && isdigit(*(s + 1)) && isdigit(*(s + 3)) && isdigit(*(s + 4)) && isdigit(*(s + 6)) && isdigit(*(s + 7)))) { // check if new recording: "10:10*", "1:10*", "01.01.06*" - + isnewrecording = true; // update status strncpy(buffer, s, strlen(s)); // make a copy buffer[strlen(s) - 1] = '\0'; // remove the '*' character @@ -367,7 +344,7 @@ void cFlatDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool S } } xOff = x1 + Tab(i) + Config.decorBorderMenuItemSize; - + if( istimer ) { // timer menu switch( s[0] ) { @@ -402,11 +379,11 @@ void cFlatDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool S if( isRunning ) menuPixmap->DrawText(cPoint(xOff, y), "*", ColorFg, ColorBg, font, AvailableTextWidth - xOff); - + } else if( isnewrecording ) { // recordings menu menuPixmap->DrawText(cPoint(xOff, y), buffer, ColorFg, ColorBg, font, AvailableTextWidth - xOff); - + // draw symbol "new" centered int gap = std::max(0, (Tab(i+1)-Tab(i)- font->Width(buffer) - bmNew->Width()) / 2); menuPixmap->DrawBitmap(cPoint(xOff + font->Width(buffer) + gap, y + (lh - bmNew->Height()) / 2), *bmNew, ColorFg, ColorBg); @@ -477,14 +454,14 @@ void cFlatDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool S sDecorBorder ib; ib.Left = Config.decorBorderMenuItemSize; ib.Top = topBarHeight + marginItem + Config.decorBorderTopBarSize*2 + Config.decorBorderMenuItemSize + y; - + ib.Width = menuWidth - Config.decorBorderMenuItemSize*2; if( isScrolling ) { ib.Width -= scrollBarWidth; } - + ib.Width = menuItemWidth; - + ib.Height = fontHeight; ib.Size = Config.decorBorderMenuItemSize; ib.Type = Config.decorBorderMenuItemType; @@ -504,11 +481,11 @@ void cFlatDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool S DecorBorderDraw(ib.Left, ib.Top, ib.Width, ib.Height, ib.Size, ib.Type, ib.ColorFg, ib.ColorBg, BorderMenuItem); - + if( !isScrolling ) { ItemBorderInsertUnique(ib); } - + SetEditableWidth(menuWidth - Tab(1)); } @@ -533,7 +510,7 @@ std::string cFlatDisplayMenu::MainMenuText(std::string Text) { if (found) { if (!(s >= '0' && s <= '9')) { doBreak = true; - } + } } if (s >= '0' && s <= '9') { found = true; @@ -548,7 +525,7 @@ std::string cFlatDisplayMenu::MainMenuText(std::string Text) { menuEntry = skipspace(text.substr(i).c_str()); } else { menuNumber = ""; - menuEntry = text.c_str(); + menuEntry = text.c_str(); } return menuEntry; } @@ -583,7 +560,7 @@ cString cFlatDisplayMenu::GetIconName(std::string element) { return cString::sprintf("pluginIcons/%s", p->Name()); } } catch (...) {} - } + } } else break; } @@ -591,10 +568,10 @@ cString cFlatDisplayMenu::GetIconName(std::string element) { } bool cFlatDisplayMenu::CheckProgressBar(const char *text) { - if (strlen(text) > 5 + if (strlen(text) > 5 && text[0] == '[' - && ((text[1] == '|')||(text[1] == ' ')) - && ((text[2] == '|')||(text[2] == ' ')) + && ((text[1] == '|')||(text[1] == ' ')) + && ((text[2] == '|')||(text[2] == ' ')) && text[strlen(text) - 1] == ']') return true; return false; @@ -629,7 +606,7 @@ bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool C cSchedulesLock schedulesLock; const cSchedules *schedules = cSchedules::Schedules(schedulesLock); const cEvent *Event = NULL; - + bool DrawProgress = true; cString buffer; int y = Index * itemChannelHeight; @@ -661,17 +638,17 @@ bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool C } menuPixmap->DrawRectangle(cRect(Config.decorBorderMenuItemSize, y, menuItemWidth, Height), ColorBg); - + int Left, Top, Width; int LeftName; Left = Config.decorBorderMenuItemSize + marginItem; Top = y; - + if( Channel->GroupSep() ) DrawProgress = false; float progress = 0.0; cString EventTitle = ""; - + cString ws = cString::sprintf("%d", Channels.MaxNumber()); int w = font->Width(ws); if( !Channel->GroupSep() ) @@ -683,13 +660,13 @@ bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool C Width = w; menuPixmap->DrawText(cPoint(Left, Top), buffer, ColorFg, ColorBg, font, Width, fontHeight, taRight); Left += Width + marginItem; - + int imageHeight = fontHeight; int imageLeft = Left; int imageTop = Top; int imageBGHeight = imageHeight; int imageBGWidth = imageHeight*1.34; - + if( !Channel->GroupSep() ) { cImage *imgBG = imgLoader.LoadIcon("logo_background", imageHeight*1.34, imageHeight); if( imgBG ) { @@ -737,7 +714,7 @@ bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool C } LeftName = Left; - + // event from channel const cSchedule *Schedule = schedules->GetSchedule( Channel->GetChannelID() ); if( Schedule ) { @@ -753,12 +730,12 @@ bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool C EventTitle = Event->Title(); } } - + if( WithProvider ) buffer = cString::sprintf("%s - %s", Channel->Provider(), Channel->Name()); else buffer = cString::sprintf("%s", Channel->Name()); - + if( Config.MenuChannelView == 1 ) { Width = menuItemWidth - LeftName; menuPixmap->DrawText(cPoint(LeftName, Top), buffer, ColorFg, ColorBg, font, Width); @@ -766,14 +743,14 @@ bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool C Width = menuItemWidth / 10*2; if( isScrolling ) Width = (menuItemWidth + scrollBarWidth) / 10*2; - + if( Config.MenuChannelView == 3 || Config.MenuChannelView == 4 ) Width = menuItemWidth - LeftName; - + menuPixmap->DrawText(cPoint(LeftName, Top), buffer, ColorFg, ColorBg, font, Width); - + Left += Width + marginItem; - + if( DrawProgress ) { int PBTop = y + (itemChannelHeight-Config.MenuItemPadding)/2 - Config.decorProgressMenuItemSize/2 - Config.decorBorderMenuItemSize; int PBLeft = Left; @@ -782,11 +759,11 @@ bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool C PBTop = Top + fontHeight + fontSmlHeight; PBLeft = Left - Width - marginItem; PBWidth = menuItemWidth - LeftName - marginItem*2 - Config.decorBorderMenuItemSize - scrollBarWidth; - + if( isScrolling ) PBWidth += scrollBarWidth; } - + Width = menuItemWidth/10; if( isScrolling ) Width = (menuItemWidth + scrollBarWidth) / 10; @@ -808,19 +785,19 @@ bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool C } else menuPixmap->DrawText(cPoint(Left, Top), EventTitle, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem ); } - + sDecorBorder ib; ib.Left = Config.decorBorderMenuItemSize; ib.Top = topBarHeight + marginItem + Config.decorBorderTopBarSize*2 + Config.decorBorderMenuItemSize + y; - + ib.Width = menuItemWidth - Config.decorBorderMenuItemSize*2; - + if( isScrolling ) { ib.Width -= scrollBarWidth; } - + ib.Width = menuItemWidth; - + ib.Height = Height; ib.Size = Config.decorBorderMenuItemSize; ib.Type = Config.decorBorderMenuItemType; @@ -840,7 +817,7 @@ bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool C DecorBorderDraw(ib.Left, ib.Top, ib.Width, ib.Height, ib.Size, ib.Type, ib.ColorFg, ib.ColorBg, BorderMenuItem); - + if( !isScrolling ) { ItemBorderInsertUnique(ib); } @@ -848,7 +825,7 @@ bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool C if( Config.MenuChannelView == 4 && Event && Current ) { DrawItemExtraEvent(Event, ""); } - + return true; } @@ -868,7 +845,7 @@ void cFlatDisplayMenu::DrawItemExtraEvent(const cEvent *Event, cString EmptyText if( !isempty(Event->Description()) ) { text << Event->Description(); } - + if( Config.EpgAdditionalInfoShow ) { text << endl; const cComponents *Components = Event->Components(); @@ -940,7 +917,7 @@ void cFlatDisplayMenu::DrawItemExtraEvent(const cEvent *Event, cString EmptyText } else text << *EmptyText; ContentCreate(cLeft, cTop, cWidth, cHeight, 2); - + ContentSet( text.str().c_str(), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg) ); DecorBorderClearByFrom(BorderContent); @@ -957,7 +934,7 @@ bool cFlatDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Current return false; const cChannel *Channel = Timer->Channel(); const cEvent *Event = Timer->Event(); - + cString buffer; int y = Index * itemTimerHeight; @@ -996,7 +973,7 @@ bool cFlatDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Current int imageHeight = fontHeight; int imageLeft = Left; int imageTop = Top; - + cString TimerIconName(""); if (!(Timer->HasFlags(tfActive))) { TimerIconName = "timerInactive"; @@ -1006,7 +983,7 @@ bool cFlatDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Current ColorFg = Theme.Color( clrMenuTimerItemRecordingFont ); } else TimerIconName = "timerActive"; - + img = imgLoader.LoadIcon(TimerIconName, imageHeight, imageHeight); if( img ) { imageTop = Top + (fontHeight - img->Height()) / 2; @@ -1035,7 +1012,7 @@ bool cFlatDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Current imageTop = Top + (fontHeight - imgBG->Height()) / 2; menuIconsBGPixmap->DrawImage( cPoint(imageLeft, imageTop), *imgBG ); } - + img = imgLoader.LoadLogo(Channel->Name(), imageBGWidth - 4, imageBGHeight - 4); if( img ) { imageTop = Top + (imageBGHeight - img->Height()) / 2; @@ -1068,7 +1045,7 @@ bool cFlatDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Current } } Left += imageBGWidth + marginItem * 2; - + cString day, name(""); if (Timer->WeekDays()) day = Timer->PrintDay(0, Timer->WeekDays(), false); @@ -1082,11 +1059,11 @@ bool cFlatDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Current char buffer[16]; strftime(buffer, sizeof(buffer), "%Y%m%d", &tm_r); day = buffer; - } + } const char *File = Setup.FoldersInTimerMenu ? NULL : strrchr(Timer->File(), FOLDERDELIMCHAR); if (File && strcmp(File + 1, TIMERMACRO_TITLE) && strcmp(File + 1, TIMERMACRO_EPISODE)) File++; - else + else File = Timer->File(); if( Config.MenuTimerView == 1 ) { @@ -1104,19 +1081,19 @@ bool cFlatDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Current menuPixmap->DrawText(cPoint(Left, Top), buffer, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem); menuPixmap->DrawText(cPoint(Left, Top + fontHeight), File, ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem); } - + sDecorBorder ib; ib.Left = Config.decorBorderMenuItemSize; ib.Top = topBarHeight + marginItem + Config.decorBorderTopBarSize*2 + Config.decorBorderMenuItemSize + y; - + ib.Width = menuItemWidth - Config.decorBorderMenuItemSize*2; - + if( isScrolling ) { ib.Width -= scrollBarWidth; } - + ib.Width = menuItemWidth; - + ib.Height = Height; ib.Size = Config.decorBorderMenuItemSize; ib.Type = Config.decorBorderMenuItemType; @@ -1136,22 +1113,22 @@ bool cFlatDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Current DecorBorderDraw(ib.Left, ib.Top, ib.Width, ib.Height, ib.Size, ib.Type, ib.ColorFg, ib.ColorBg, BorderMenuItem); - + if( !isScrolling ) { ItemBorderInsertUnique(ib); } - + if( Config.MenuTimerView == 3 && Current ) { DrawItemExtraEvent(Event, tr("timer not enabled")); } - + return true; } bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current, bool Selectable, const cChannel *Channel, bool WithDate, eTimerMatch TimerMatch) { if( Config.MenuEventView == 0 ) return false; - + cImage *img = NULL; cString buffer; int y = Index * itemEventHeight; @@ -1185,7 +1162,7 @@ bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current } menuPixmap->DrawRectangle(cRect(Config.decorBorderMenuItemSize, y, menuItemWidth, Height), ColorBg); - + int Left = 0, Top = 0, LeftSecond = 0; LeftSecond = Left = Config.decorBorderMenuItemSize + marginItem; Top = y; @@ -1254,15 +1231,15 @@ bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current } Left += imageBGWidth + marginItem * 2; LeftSecond = Left; - + w = menuWidth / 10 * 2; menuPixmap->DrawText(cPoint(Left, Top), Channel->ShortName(true), ColorFg, ColorBg, font, w); Left += w + marginItem * 2; - + if( Event ) { int PBWidth = menuItemWidth/20; time_t now = time(NULL); - + if( (now >= (Event->StartTime() - 2*60) ) ) { int total = Event->EndTime() - Event->StartTime(); if( total >= 0 ) { @@ -1275,8 +1252,8 @@ bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current int PBTop = y + (itemEventHeight - Config.MenuItemPadding)/2 - Config.decorProgressMenuItemSize/2 - Config.decorBorderMenuItemSize; int PBLeft = Left; int PBHeight = Config.decorProgressMenuItemSize; - - + + if( (Config.MenuEventView == 2 || Config.MenuEventView == 3) ) { PBTop = y + fontHeight + fontSmlHeight + marginItem; PBWidth = menuItemWidth - LeftSecond - scrollBarWidth - marginItem * 2; @@ -1286,7 +1263,7 @@ bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current PBLeft = LeftSecond; PBHeight = Config.decorProgressMenuItemSize / 2; } - + if( Current ) ProgressBarDrawRaw(menuPixmap, menuPixmap, cRect( PBLeft, PBTop, PBWidth, PBHeight), cRect( PBLeft, PBTop, PBWidth, PBHeight), progress, 100, @@ -1306,23 +1283,23 @@ bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current w = fontSml->Width("XXX 99. ") + marginItem; else w = font->Width("XXX 99. ") + marginItem; - + struct tm tm_r; time_t Day = Event->StartTime(); localtime_r(&Day, &tm_r); char buf[8]; strftime(buf, sizeof(buf), "%2d", &tm_r); - + cString DateString = cString::sprintf("%s %s. ", *WeekDayName( (time_t)Event->StartTime()), buf ); if( (Config.MenuEventView == 2 || Config.MenuEventView == 3) && Channel ) { menuPixmap->DrawText(cPoint(LeftSecond, Top + fontHeight), DateString, ColorFg, ColorBg, fontSml, w); LeftSecond += w + marginItem; } else menuPixmap->DrawText(cPoint(Left, Top), DateString, ColorFg, ColorBg, font, w, fontHeight, taRight); - + Left += w + marginItem; } - + int imageHeight = fontHeight; if( (Config.MenuEventView == 2 || Config.MenuEventView == 3) && Channel && Event && Selectable ) { Top += fontHeight; @@ -1338,7 +1315,7 @@ bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current menuPixmap->DrawText(cPoint(Left, Top), Event->GetTimeString(), ColorFg, ColorBg, font); Left += font->Width( Event->GetTimeString() ) + marginItem; } - + if( TimerMatch == tmFull ) { img = imgLoader.LoadIcon("timer_full", imageHeight, imageHeight); if( img ) { @@ -1360,7 +1337,7 @@ bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current imageTop = Top; menuIconsPixmap->DrawImage( cPoint(Left, imageTop), *img ); } - } + } Left += imageHeight + marginItem; if( (Config.MenuEventView == 2 || Config.MenuEventView == 3) && Channel ) { @@ -1406,15 +1383,15 @@ bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current sDecorBorder ib; ib.Left = Config.decorBorderMenuItemSize; ib.Top = topBarHeight + marginItem + Config.decorBorderTopBarSize*2 + Config.decorBorderMenuItemSize + y; - + ib.Width = menuItemWidth - Config.decorBorderMenuItemSize*2; - + if( isScrolling ) { ib.Width -= scrollBarWidth; } - + ib.Width = menuItemWidth; - + ib.Height = Height; ib.Size = Config.decorBorderMenuItemSize; ib.Type = Config.decorBorderMenuItemType; @@ -1434,7 +1411,7 @@ bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current DecorBorderDraw(ib.Left, ib.Top, ib.Width, ib.Height, ib.Size, ib.Type, ib.ColorFg, ib.ColorBg, BorderMenuItem); - + if( !isScrolling ) { ItemBorderInsertUnique(ib); } @@ -1442,7 +1419,7 @@ bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current if( Config.MenuEventView == 3 ) { DrawItemExtraEvent(Event, ""); } - + return true; } @@ -1481,7 +1458,7 @@ bool cFlatDisplayMenu::SetItemRecording(const cRecording *Recording, int Index, ColorBg = Theme.Color(clrItemBg); } } - + menuPixmap->DrawRectangle(cRect(Config.decorBorderMenuItemSize, y, menuItemWidth, Height), ColorBg); cImage *img = NULL; cImage *imgRecNew = imgLoader.LoadIcon("recording_new", fontHeight, fontHeight); @@ -1493,7 +1470,7 @@ bool cFlatDisplayMenu::SetItemRecording(const cRecording *Recording, int Index, Top = y; if( Config.MenuRecordingView == 1 ) { - int LeftWidth = Left + fontHeight + imgRecNew->Width() + imgRecCut->Width() + + int LeftWidth = Left + fontHeight + imgRecNew->Width() + imgRecCut->Width() + marginItem * 3 + font->Width("99.99.99 99:99 99:99 "); if( Total == 0 ) { @@ -1502,14 +1479,14 @@ bool cFlatDisplayMenu::SetItemRecording(const cRecording *Recording, int Index, menuIconsPixmap->DrawImage( cPoint(Left, Top), *img ); Left += fontHeight + marginItem; } - + //int Minutes = max(0, (Recording->LengthInSeconds() + 30) / 60); - int Minutes = (Recording->LengthInSeconds() + 30) / 60; + int Minutes = (Recording->LengthInSeconds() + 30) / 60; cString Length = cString::sprintf("%02d:%02d", Minutes / 60, Minutes % 60); buffer = cString::sprintf("%s %s %s ", *ShortDateString(Recording->Start()), *TimeString(Recording->Start()), *Length); menuPixmap->DrawText(cPoint(Left, Top), buffer, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem); - + Left += font->Width( buffer ); if( Recording->IsNew() ) { if( imgRecNew ) { @@ -1546,7 +1523,7 @@ bool cFlatDisplayMenu::SetItemRecording(const cRecording *Recording, int Index, buffer = cString::sprintf(" (%s)", *ShortDateString(GetLastRecTimeFromFolder(Recording, Level))); menuPixmap->DrawText(cPoint(Left, Top), buffer, ColorExtraTextFg, ColorBg, font, menuItemWidth - Left - marginItem); } - + menuPixmap->DrawText(cPoint(LeftWidth, Top), RecName, ColorFg, ColorBg, font, menuItemWidth - LeftWidth - marginItem); LeftWidth += font->Width(RecName) + marginItem*2; } else if( Total == -1 ) { @@ -1571,13 +1548,13 @@ bool cFlatDisplayMenu::SetItemRecording(const cRecording *Recording, int Index, menuPixmap->DrawText(cPoint(Left, Top), RecName, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem - ImagesWidth); Top += fontHeight; - - int Minutes = (Recording->LengthInSeconds() + 30) / 60; + + int Minutes = (Recording->LengthInSeconds() + 30) / 60; cString Length = cString::sprintf("%02d:%02d", Minutes / 60, Minutes % 60); buffer = cString::sprintf("%s %s %s ", *ShortDateString(Recording->Start()), *TimeString(Recording->Start()), *Length); menuPixmap->DrawText(cPoint(Left, Top), buffer, ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem); - + Top -= fontHeight; Left = menuItemWidth - ImagesWidth; if( Recording->IsNew() ) { @@ -1630,15 +1607,15 @@ bool cFlatDisplayMenu::SetItemRecording(const cRecording *Recording, int Index, sDecorBorder ib; ib.Left = Config.decorBorderMenuItemSize; ib.Top = topBarHeight + marginItem + Config.decorBorderTopBarSize*2 + Config.decorBorderMenuItemSize + y; - + ib.Width = menuItemWidth - Config.decorBorderMenuItemSize*2; - + if( isScrolling ) { ib.Width -= scrollBarWidth; } - + ib.Width = menuItemWidth; - + ib.Height = Height; ib.Size = Config.decorBorderMenuItemSize; ib.Type = Config.decorBorderMenuItemType; @@ -1658,15 +1635,15 @@ bool cFlatDisplayMenu::SetItemRecording(const cRecording *Recording, int Index, DecorBorderDraw(ib.Left, ib.Top, ib.Width, ib.Height, ib.Size, ib.Type, ib.ColorFg, ib.ColorBg, BorderMenuItem); - + if( !isScrolling ) { ItemBorderInsertUnique(ib); } - + if( Config.MenuRecordingView == 3 && Current ) { DrawItemExtraRecording(Recording, tr("no recording info")); } - + return true; } @@ -1684,7 +1661,7 @@ void cFlatDisplayMenu::SetEvent(const cEvent *Event) { Config.decorBorderMenuContentSize + Config.decorBorderMenuContentHeadSize; cWidth = menuWidth - Config.decorBorderMenuContentSize*2; cHeight = osdHeight - (topBarHeight + Config.decorBorderTopBarSize*2 + - buttonsHeight + Config.decorBorderButtonSize*2 + marginItem*3 + + buttonsHeight + Config.decorBorderButtonSize*2 + marginItem*3 + chHeight + Config.decorBorderMenuContentHeadSize*2 + Config.decorBorderMenuContentSize*2); if( !ButtonsDrawn() ) @@ -1710,13 +1687,13 @@ void cFlatDisplayMenu::SetEvent(const cEvent *Event) { DecorBorderDraw(chLeft, chTop, chWidth, chHeight, Config.decorBorderMenuContentHeadSize, Config.decorBorderMenuContentHeadType, Config.decorBorderMenuContentHeadFg, Config.decorBorderMenuContentHeadBg); - + // Description ostringstream text; if( !isempty(Event->Description()) ) { text << Event->Description(); } - + if( Config.EpgAdditionalInfoShow ) { text << endl; const cComponents *Components = Event->Components(); @@ -1785,14 +1762,14 @@ void cFlatDisplayMenu::SetEvent(const cEvent *Event) { text << endl << tr("Subtitle") << ": "<< subtitle.str(); } } - + bool contentScrollable = ContentWillItBeScrollable(cWidth, cHeight, text.str().c_str(), 0); if( contentScrollable ) { cWidth -= scrollBarWidth; } ContentCreate(cLeft, cTop, cWidth, cHeight, 0); - + ContentSet( text.str().c_str(), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg) ); if( ContentScrollable() ) { DrawScrollbar(ContentScrollTotal(), ContentScrollOffset(), ContentVisibleLines(), contentTop - scrollBarTop, ContentGetHeight(), ContentScrollOffset() > 0, ContentScrollOffset() + ContentVisibleLines() < ContentScrollTotal(), true); @@ -1822,7 +1799,7 @@ void cFlatDisplayMenu::DrawItemExtraRecording(const cRecording *Recording, cStri if (!isempty(recInfo->Description())) text << recInfo->Description() << endl << endl; - + // lent from skinelchi if( Config.RecordingAdditionalInfoShow ) { cChannel *channel = Channels.GetByChannelID(((cRecordingInfo *)recInfo)->ChannelID()); @@ -2009,7 +1986,7 @@ void cFlatDisplayMenu::DrawItemExtraRecording(const cRecording *Recording, cStri text << *EmptyText; ContentCreate(cLeft, cTop, cWidth, cHeight, 2); - + ContentSet( text.str().c_str(), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg) ); DecorBorderClearByFrom(BorderContent); @@ -2043,7 +2020,7 @@ void cFlatDisplayMenu::SetRecording(const cRecording *Recording) { Config.decorBorderMenuContentSize + Config.decorBorderMenuContentHeadSize; cWidth = menuWidth - Config.decorBorderMenuContentSize*2; cHeight = osdHeight - (topBarHeight + Config.decorBorderTopBarSize*2 + - buttonsHeight + Config.decorBorderButtonSize*2 + marginItem*3 + + buttonsHeight + Config.decorBorderButtonSize*2 + marginItem*3 + chHeight + Config.decorBorderMenuContentHeadSize*2 + Config.decorBorderMenuContentSize*2); if( !ButtonsDrawn() ) @@ -2056,7 +2033,7 @@ void cFlatDisplayMenu::SetRecording(const cRecording *Recording) { if (!isempty(recInfo->Description())) text << recInfo->Description() << endl << endl; - + // lent from skinelchi if( Config.RecordingAdditionalInfoShow ) { cChannel *channel = Channels.GetByChannelID(((cRecordingInfo *)recInfo)->ChannelID()); @@ -2246,7 +2223,7 @@ void cFlatDisplayMenu::SetRecording(const cRecording *Recording) { } ContentCreate(cLeft, cTop, cWidth, cHeight, 0); - + contentHeadPixmap->Fill(clrTransparent); contentHeadPixmap->DrawRectangle(cRect(0, 0, menuWidth, fontHeight + fontSmlHeight*2 + marginItem*2), Theme.Color(clrScrollbarBg)); @@ -2263,7 +2240,7 @@ void cFlatDisplayMenu::SetRecording(const cRecording *Recording) { DecorBorderDraw(chLeft, chTop, chWidth, chHeight, Config.decorBorderMenuContentHeadSize, Config.decorBorderMenuContentHeadType, Config.decorBorderMenuContentHeadFg, Config.decorBorderMenuContentHeadBg); - + ContentSet( text.str().c_str(), Theme.Color(clrMenuRecFontInfo), Theme.Color(clrMenuRecBg) ); if( ContentScrollable() ) { DrawScrollbar(ContentScrollTotal(), ContentScrollOffset(), ContentVisibleLines(), contentTop - scrollBarTop, ContentGetHeight(), ContentScrollOffset() > 0, ContentScrollOffset() + ContentVisibleLines() < ContentScrollTotal(), true); @@ -2278,7 +2255,7 @@ void cFlatDisplayMenu::SetRecording(const cRecording *Recording) { RecordingBorder.ColorFg = Config.decorBorderMenuContentFg; RecordingBorder.ColorBg = Config.decorBorderMenuContentBg; RecordingBorder.From = BorderMenuRecord; - + if( Config.MenuContentFullSize || ContentScrollable() ) DecorBorderDraw(RecordingBorder.Left, RecordingBorder.Top, RecordingBorder.Width, RecordingBorder.Height, RecordingBorder.Size, RecordingBorder.Type, @@ -2324,7 +2301,7 @@ void cFlatDisplayMenu::SetText(const char *Text, bool FixedFont) { ContentSet( Text, Theme.Color(clrMenuTextFont), Theme.Color(clrMenuTextBg) ); } - + if( ContentScrollable() ) DrawScrollbar(ContentScrollTotal(), ContentScrollOffset(), ContentVisibleLines(), contentTop - scrollBarTop, ContentGetHeight(), ContentScrollOffset() > 0, ContentScrollOffset() + ContentVisibleLines() < ContentScrollTotal(), true); @@ -2366,7 +2343,7 @@ void cFlatDisplayMenu::ItemBorderInsertUnique(sDecorBorder ib) { return; } } - + ItemsBorder.push_back(ib); } @@ -2393,7 +2370,7 @@ void cFlatDisplayMenu::ItemBorderClear(void) { time_t cFlatDisplayMenu::GetLastRecTimeFromFolder(const cRecording *Recording, int Level) { std::string RecFolder = GetRecordingName(Recording, Level, true); time_t RecStart = Recording->Start(); - + for(cRecording *rec = Recordings.First(); rec; rec = Recordings.Next(rec)) { std::string RecFolder2 = GetRecordingName(rec, Level, true); if( RecFolder == RecFolder2 ) { // recordings must be in the same folder @@ -2406,7 +2383,7 @@ time_t cFlatDisplayMenu::GetLastRecTimeFromFolder(const cRecording *Recording, i RecStart = RecStart2; } } - + return RecStart; } @@ -2441,13 +2418,13 @@ const char * cFlatDisplayMenu::GetRecordingName(const cRecording *Recording, int } catch (...) { recNamePart = recName.c_str(); } - + if( Config.MenuItemRecordingClearPercent && isFolder ) { if( recNamePart[0] == '%' ) { recNamePart.erase(0, 1); } } - + return recNamePart.c_str(); } @@ -2460,9 +2437,9 @@ void cFlatDisplayMenu::PreLoadImages(void) { cString FileName = cString::sprintf("menuIcons/%s", GetFilenameWithoutext(e->d_name)); imgLoader.LoadIcon(*FileName, fontHeight - marginItem*2, fontHeight - marginItem*2); } - + imgLoader.LoadIcon("menuIcons/blank", fontHeight - marginItem*2, fontHeight - marginItem*2); - + int imageHeight = fontHeight; int imageBGHeight = imageHeight; int imageBGWidth = imageHeight*1.34; @@ -2471,14 +2448,14 @@ void cFlatDisplayMenu::PreLoadImages(void) { imageBGHeight = imgBG->Height(); imageBGWidth = imgBG->Width(); } - + imgLoader.LoadIcon("radio", imageBGWidth - 10, imageBGHeight - 10); imgLoader.LoadIcon("changroup", imageBGWidth - 10, imageBGHeight - 10); imgLoader.LoadIcon("tv", imageBGWidth - 10, imageBGHeight - 10); imgLoader.LoadIcon("timerInactive", imageHeight, imageHeight); imgLoader.LoadIcon("timerRecording", imageHeight, imageHeight); imgLoader.LoadIcon("timerActive", imageHeight, imageHeight); - + int index = 0; cImage *img = NULL; for(cChannel *Channel = Channels.First(); Channel && index < LOGO_PRE_CACHE; Channel = Channels.Next(Channel)) @@ -2491,11 +2468,11 @@ void cFlatDisplayMenu::PreLoadImages(void) { imgLoader.LoadIcon("radio", 999, topBarHeight - marginItem*2); imgLoader.LoadIcon("changroup", 999, topBarHeight - marginItem*2); imgLoader.LoadIcon("tv", 999, topBarHeight - marginItem*2); - + imgLoader.LoadIcon("timer_full", imageHeight, imageHeight); imgLoader.LoadIcon("timer_partial", imageHeight, imageHeight); imgLoader.LoadIcon("vps", imageHeight, imageHeight); - + imgLoader.LoadIcon("recording_new", fontHeight, fontHeight); imgLoader.LoadIcon("recording_new", fontSmlHeight, fontSmlHeight); imgLoader.LoadIcon("recording_cutted", fontHeight, fontHeight); diff --git a/po/de_DE.po b/po/de_DE.po index 4c3a9ad9..8b9f9979 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-skinflat 0.2.1\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2014-03-27 21:33+0100\n" +"POT-Creation-Date: 2014-04-03 19:32+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -15,15 +15,15 @@ msgstr "" "Content-Type: text/plain; charset=ISO-8859-15\n" "Content-Transfer-Encoding: 8bit\n" -msgid "clock" -msgstr "Uhr" - msgid "disk usage" msgstr "Plattennutzung" msgid "free" msgstr "frei" +msgid "clock" +msgstr "Uhr" + msgid "Video" msgstr "Video" @@ -120,6 +120,18 @@ msgstr "" msgid "big line + alpha blend" msgstr "" +msgid "do not show" +msgstr "nicht anzeigen" + +msgid "timer & recording menu" +msgstr "Timer & Aufnahme Menü" + +msgid "always on the menu" +msgstr "immer im Menü" + +msgid "always show" +msgstr "immer anzeigen" + msgid "VDR default" msgstr "VDR standard" @@ -1,6 +1,7 @@ #include "setup.h" cStringList Bordertypes; +cStringList DiskUsages; cStringList Progresstypes; cStringList MenuChannelViews; cStringList MenuTimerViews; @@ -15,14 +16,14 @@ cFlatSetup::cFlatSetup(void) { } cFlatSetup::~cFlatSetup() { - + } void cFlatSetup::Setup(void) { Clear(); Bordertypes.Clear(); Progresstypes.Clear(); - + Bordertypes.Clear(); Bordertypes.Append( strdup(tr("none")) ); Bordertypes.Append( strdup(tr("rect")) ); @@ -44,6 +45,12 @@ void cFlatSetup::Setup(void) { Progresstypes.Append( strdup(tr("small line + big line + alpha blend")) ); Progresstypes.Append( strdup(tr("big line + alpha blend")) ); + DiskUsages.Clear(); + DiskUsages.Append( strdup(tr("do not show")) ); + DiskUsages.Append( strdup(tr("timer & recording menu")) ); + DiskUsages.Append( strdup(tr("always on the menu")) ); + DiskUsages.Append( strdup(tr("always show")) ); + MenuChannelViews.Clear(); MenuChannelViews.Append( strdup(tr("VDR default")) ); MenuChannelViews.Append( strdup(tr("flatPlus long")) ); @@ -81,7 +88,7 @@ void cFlatSetup::Setup(void) { Add(new cOsdItem(tr("TVScraper settings"), osUnknown, true)); else Add(new cOsdItem(tr("TVScraper not installed"), osUnknown, false)); - + if( ItemLastSel >= 0 ) { SetCurrent(Get(ItemLastSel)); ItemLastSel = -1; @@ -91,7 +98,7 @@ void cFlatSetup::Setup(void) { } eOSState cFlatSetup::ProcessKey(eKeys Key) { - bool hadSubMenu = HasSubMenu(); + bool hadSubMenu = HasSubMenu(); eOSState state = cMenuSetupPage::ProcessKey(Key); if (hadSubMenu && Key == kOk) Store(); @@ -113,7 +120,7 @@ eOSState cFlatSetup::ProcessKey(eKeys Key) { if (strcmp(ItemText, tr("TVScraper settings")) == 0) state = AddSubMenu(new cFlatSetupTvsraper(&SetupConfig)); } - } + } return state; } @@ -217,7 +224,7 @@ cOsdItem *cMenuSetupSubMenu::InfoItem(const char *label, const char *value) { return item; } -// General Settings +// General Settings cFlatSetupGeneral::cFlatSetupGeneral(cFlatConfig* data) : cMenuSetupSubMenu(tr("General settings"), data) { Setup(); } @@ -229,12 +236,12 @@ void cFlatSetupGeneral::Setup(void) { SetupConfig->DecorDescriptions( DecorDescriptions ); if( SetupConfig->DecorIndex < 0 || SetupConfig->DecorIndex > DecorDescriptions.Size() ) SetupConfig->DecorIndex = 0; - + Add(new cMenuEditStraItem(tr("Decorfile"), &SetupConfig->DecorIndex, DecorDescriptions.Size(), &DecorDescriptions[0])); Add(new cMenuEditBoolItem(tr("Show empty color-buttons"), &SetupConfig->ButtonsShowEmpty)); Add(new cMenuEditBoolItem(tr("Show TopBar menu icons"), &SetupConfig->TopBarMenuIconShow)); - Add(new cMenuEditBoolItem(tr("Show Diskusage stats"), &SetupConfig->DiskUsageShow)); + Add(new cMenuEditStraItem(tr("Show Diskusage stats"), &SetupConfig->DiskUsageShow, DiskUsages.Size(), &DiskUsages[0])); Add(new cMenuEditIntItem(tr("OSD vertical margin"), &SetupConfig->marginOsdVer)); Add(new cMenuEditIntItem(tr("OSD horizontal margin"), &SetupConfig->marginOsdHor)); Add(new cMenuEditPrcItem(tr("TopBar font size"), &SetupConfig->TopBarFontSize, 0.01, 0.2, 1)); @@ -279,7 +286,7 @@ void cFlatSetupGeneral::Setup(void) { cString ImageCache = cString::sprintf("%s:\t%d / %d", tr("Imagecache entries"), imgCache.getCacheCount(), MAX_IMAGE_CACHE); Add(new cOsdItem(ImageCache, osUnknown, true)); - + if( ItemLastSel >= 0 ) { SetCurrent(Get(ItemLastSel)); ItemLastSel = -1; @@ -307,11 +314,11 @@ eOSState cFlatSetupGeneral::ProcessKey(eKeys Key) { ItemLastSel = Current(); Setup(); } - } + } return state; } -// Channel Info Settings +// Channel Info Settings cFlatSetupChannelInfo::cFlatSetupChannelInfo(cFlatConfig* data) : cMenuSetupSubMenu(tr("Channelinfo settings"), data) { Setup(); } @@ -325,7 +332,7 @@ void cFlatSetupChannelInfo::Setup(void) { Add(new cMenuEditBoolItem(tr("Show resolution & aspect"), &SetupConfig->ChannelResolutionAspectShow)); Add(new cMenuEditBoolItem(tr("Show format (hd/sd)"), &SetupConfig->ChannelFormatShow)); Add(new cMenuEditBoolItem(tr("Simple aspect & format"), &SetupConfig->ChannelSimpleAspectFormat)); - + Add(new cMenuEditBoolItem(tr("Channelinfo border by decor-file?"), &SetupConfig->decorBorderChannelByTheme)); if( SetupConfig->decorBorderChannelByTheme ) { cString type = cString::sprintf("%s:\t%s", tr("Channelinfo border type"), Bordertypes[SetupConfig->decorBorderChannelTypeTheme]); @@ -358,7 +365,7 @@ void cFlatSetupChannelInfo::Setup(void) { Add(new cMenuEditStraItem(tr("Signalquality progress type"), &SetupConfig->decorProgressSignalTypeUser, Progresstypes.Size(), &Progresstypes[0])); Add(new cMenuEditIntItem(tr("Signalquality progress size"), &SetupConfig->decorProgressSignalSizeUser)); } - + if( ItemLastSel >= 0 ) { SetCurrent(Get(ItemLastSel)); ItemLastSel = -1; @@ -386,11 +393,11 @@ eOSState cFlatSetupChannelInfo::ProcessKey(eKeys Key) { ItemLastSel = Current(); Setup(); } - } + } return state; } -// Menu Settings +// Menu Settings cFlatSetupMenu::cFlatSetupMenu(cFlatConfig* data) : cMenuSetupSubMenu(tr("Menu settings"), data) { Setup(); } @@ -420,7 +427,7 @@ void cFlatSetupMenu::Setup(void) { Add(new cMenuEditStraItem(tr("Menuitem border type"), &SetupConfig->decorBorderMenuItemTypeUser, Bordertypes.Size(), &Bordertypes[0])); Add(new cMenuEditIntItem(tr("Menuitem border size"), &SetupConfig->decorBorderMenuItemSizeUser)); } - + Add(new cMenuEditBoolItem(tr("Menucont. border by decor-file?"), &SetupConfig->decorBorderMenuContentByTheme)); if( SetupConfig->decorBorderMenuContentByTheme ) { cString type = cString::sprintf("%s:\t%s", tr("Menucont. border type"), Bordertypes[SetupConfig->decorBorderMenuContentTypeTheme]); @@ -453,7 +460,7 @@ void cFlatSetupMenu::Setup(void) { Add(new cMenuEditStraItem(tr("Menuitem progress type"), &SetupConfig->decorProgressMenuItemTypeUser, Progresstypes.Size(), &Progresstypes[0])); Add(new cMenuEditIntItem(tr("Menuitem progress size"), &SetupConfig->decorProgressMenuItemSizeUser)); } - + if( ItemLastSel >= 0 ) { SetCurrent(Get(ItemLastSel)); ItemLastSel = -1; @@ -482,11 +489,11 @@ eOSState cFlatSetupMenu::ProcessKey(eKeys Key) { ItemLastSel = Current(); Setup(); } - } + } return state; } -// Replay Settings +// Replay Settings cFlatSetupReplay::cFlatSetupReplay(cFlatConfig* data) : cMenuSetupSubMenu(tr("Replay settings"), data) { Setup(); } @@ -498,7 +505,7 @@ void cFlatSetupReplay::Setup(void) { Add(new cMenuEditBoolItem(tr("Show resolution & aspect"), &SetupConfig->RecordingResolutionAspectShow)); Add(new cMenuEditBoolItem(tr("Show format (hd/sd)"), &SetupConfig->RecordingFormatShow)); Add(new cMenuEditBoolItem(tr("Simple aspect & format"), &SetupConfig->RecordingSimpleAspectFormat)); - + if( SetupConfig->decorBorderReplayByTheme ) { cString type = cString::sprintf("%s:\t%s", tr("Replay border type"), Bordertypes[SetupConfig->decorBorderReplayTypeTheme]); Add(new cOsdItem(type, osUnknown, false)); @@ -516,7 +523,7 @@ void cFlatSetupReplay::Setup(void) { } else { Add(new cMenuEditIntItem(tr("Replay progress size"), &SetupConfig->decorProgressReplaySizeUser)); } - + if( ItemLastSel >= 0 ) { SetCurrent(Get(ItemLastSel)); ItemLastSel = -1; @@ -543,11 +550,11 @@ eOSState cFlatSetupReplay::ProcessKey(eKeys Key) { ItemLastSel = Current(); Setup(); } - } + } return state; } -// Volume Settings +// Volume Settings cFlatSetupVolume::cFlatSetupVolume(cFlatConfig* data) : cMenuSetupSubMenu(tr("Volume settings"), data) { Setup(); } @@ -576,7 +583,7 @@ void cFlatSetupVolume::Setup(void) { Add(new cMenuEditStraItem(tr("Volume progress type"), &SetupConfig->decorProgressVolumeTypeUser, Progresstypes.Size(), &Progresstypes[0])); Add(new cMenuEditIntItem(tr("Volume progress size"), &SetupConfig->decorProgressVolumeSizeUser)); } - + if( ItemLastSel >= 0 ) { SetCurrent(Get(ItemLastSel)); ItemLastSel = -1; @@ -603,11 +610,11 @@ eOSState cFlatSetupVolume::ProcessKey(eKeys Key) { ItemLastSel = Current(); Setup(); } - } + } return state; } -// Tracks Settings +// Tracks Settings cFlatSetupTracks::cFlatSetupTracks(cFlatConfig* data) : cMenuSetupSubMenu(tr("Tracks settings"), data) { Setup(); } @@ -625,7 +632,7 @@ void cFlatSetupTracks::Setup(void) { Add(new cMenuEditStraItem(tr("Tracks border type"), &SetupConfig->decorBorderTrackTypeUser, Bordertypes.Size(), &Bordertypes[0])); Add(new cMenuEditIntItem(tr("Tracks border size"), &SetupConfig->decorBorderTrackSizeUser)); } - + if( ItemLastSel >= 0 ) { SetCurrent(Get(ItemLastSel)); ItemLastSel = -1; @@ -651,11 +658,11 @@ eOSState cFlatSetupTracks::ProcessKey(eKeys Key) { ItemLastSel = Current(); Setup(); } - } + } return state; } -// TVScraper Settings +// TVScraper Settings cFlatSetupTvsraper::cFlatSetupTvsraper(cFlatConfig* data) : cMenuSetupSubMenu(tr("Tracks settings"), data) { Setup(); } @@ -665,7 +672,7 @@ void cFlatSetupTvsraper::Setup(void) { Add(new cMenuEditBoolItem(tr("Channelinfo show poster?"), &SetupConfig->TVScraperChanInfoShowPoster)); Add(new cMenuEditPrcItem(tr("Channelinfo poster size"), &SetupConfig->TVScraperChanInfoPosterSize, 0.004, 0.015, 2)); - + if( ItemLastSel >= 0 ) { SetCurrent(Get(ItemLastSel)); ItemLastSel = -1; @@ -693,6 +700,6 @@ eOSState cFlatSetupTvsraper::ProcessKey(eKeys Key) { Setup(); } } - */ + */ return state; } |