diff options
| author | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2014-10-18 15:23:51 +0200 |
|---|---|---|
| committer | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2014-10-18 15:23:51 +0200 |
| commit | 9b5b367dd5f9c76648b615c5747a411c9c98a1f1 (patch) | |
| tree | c16da55c4000f86df7c2ceb268b55619bc569607 | |
| parent | 9bac4f27b79519205a1ae90f2a97de061708ec19 (diff) | |
| download | skin-flatplus-9b5b367dd5f9c76648b615c5747a411c9c98a1f1.tar.gz skin-flatplus-9b5b367dd5f9c76648b615c5747a411c9c98a1f1.tar.bz2 | |
update timer count in timer menu
| -rw-r--r-- | baserender.c | 7 | ||||
| -rw-r--r-- | baserender.h | 1 | ||||
| -rw-r--r-- | displaymenu.c | 20 | ||||
| -rw-r--r-- | displaymenu.h | 3 |
4 files changed, 29 insertions, 2 deletions
diff --git a/baserender.c b/baserender.c index b5a1a5b7..3fd4e3e6 100644 --- a/baserender.c +++ b/baserender.c @@ -154,6 +154,13 @@ void cFlatBaseRender::TopBarSetTitle(cString title) { TopBarEnableDiskUsage(); } +void cFlatBaseRender::TopBarSetTitleWithoutClear(cString title) { + topBarTitle = title; + topBarUpdateTitle = true; + if( Config.DiskUsageShow == 3) + TopBarEnableDiskUsage(); +} + void cFlatBaseRender::TopBarSetTitleExtra(cString extra1, cString extra2) { tobBarTitleExtra1 = extra1; tobBarTitleExtra2 = extra2; diff --git a/baserender.h b/baserender.h index 81fc913d..a027d6d5 100644 --- a/baserender.h +++ b/baserender.h @@ -140,6 +140,7 @@ class cFlatBaseRender void TopBarCreate(void); void TopBarSetTitle(cString title); + void TopBarSetTitleWithoutClear(cString title); void TopBarSetTitleExtra(cString extra1, cString extra2); void TopBarSetMenuIcon(cString icon); void TopBarSetMenuIconRight(cString icon); diff --git a/displaymenu.c b/displaymenu.c index 969f3cdc..206f8d09 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -214,6 +214,7 @@ void cFlatDisplayMenu::Clear(void) { void cFlatDisplayMenu::SetTitle(const char *Title) { TopBarSetTitle(Title); + LastTitle = Title; if( Config.TopBarMenuIconShow ) { cString icon = ""; @@ -248,6 +249,8 @@ void cFlatDisplayMenu::SetTitle(const char *Title) { if( Timer->HasFlags(tfActive) ) timerActiveCount++; } + LastTimerCount = timerCount; + LastTimerActiveCount = timerActiveCount; cString newTitle = cString::sprintf("%s (%d/%d)", Title, timerActiveCount, timerCount); TopBarSetTitle(*newTitle); } @@ -3361,13 +3364,26 @@ void cFlatDisplayMenu::Flush(void) { TopBarUpdate(); if( Config.MenuFullOsd && !MenuFullOsdIsDrawn ) { - dsyslog("menuItemLastHeight: %d ItemsHeight() - menuItemLastHeight: %d", menuItemLastHeight, ItemsHeight() - menuItemLastHeight ); menuPixmap->DrawRectangle(cRect(0, menuItemLastHeight - Config.decorBorderMenuItemSize, menuItemWidth + Config.decorBorderMenuItemSize*2, menuPixmap->ViewPort().Height() - menuItemLastHeight + marginItem), Theme.Color(clrItemSelableBg)); //menuPixmap->DrawRectangle(cRect(0, menuPixmap->ViewPort().Height() - 5, menuItemWidth + Config.decorBorderMenuItemSize*2, 5), Theme.Color(clrItemSelableBg)); MenuFullOsdIsDrawn = true; } - + if( Config.MenuTimerShowCount && menuCategory == mcTimer ) { + int timerCount = 0, timerActiveCount = 0; + for(cTimer *Timer = Timers.First(); Timer; Timer = Timers.Next(Timer)) { + timerCount++; + if( Timer->HasFlags(tfActive) ) + timerActiveCount++; + } + if( LastTimerCount != timerCount || LastTimerActiveCount != timerActiveCount ) { + LastTimerCount = timerCount; + LastTimerActiveCount = timerActiveCount; + cString newTitle = cString::sprintf("%s (%d/%d)", *LastTitle, timerActiveCount, timerCount); + TopBarSetTitleWithoutClear(*newTitle); + dsyslog("UPDATE UPDATE UPDATE"); + } + } osd->Flush(); } diff --git a/displaymenu.h b/displaymenu.h index 51b073ce..3cf18011 100644 --- a/displaymenu.h +++ b/displaymenu.h @@ -23,6 +23,9 @@ class cFlatDisplayMenu : public cFlatBaseRender, public cSkinDisplayMenu { eMenuCategory menuCategory; int VideoDiskUsageState; + int LastTimerCount, LastTimerActiveCount; + cString LastTitle; + int chLeft, chTop, chWidth, chHeight; cPixmap *contentHeadPixmap; |
