diff options
author | Andreas Mair <amair.sob@googlemail.com> | 2012-06-06 17:33:01 +0200 |
---|---|---|
committer | Andreas Mair <amair.sob@googlemail.com> | 2012-06-06 17:33:01 +0200 |
commit | 51fc8602d62d81b3a717a85b748f79bccf90621a (patch) | |
tree | fc205a6e0ab98fe326a621272c4d29330d479f79 | |
parent | 5772879e19b1588bbb541a6f7565caf5b9dbd5d6 (diff) | |
download | vdr-plugin-skinenigmang-51fc8602d62d81b3a717a85b748f79bccf90621a.tar.gz vdr-plugin-skinenigmang-51fc8602d62d81b3a717a85b748f79bccf90621a.tar.bz2 |
Added: Display free video disk space in main and recordings menu with VDR 1.7.28+.
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | enigma.c | 35 |
2 files changed, 34 insertions, 2 deletions
@@ -2,6 +2,7 @@ VDR Skin 'EnigmaNG' Revision History ------------------------------------------ 2012-xx-xx: Version 0.1.3 +- Added: Display free video disk space in main and recordings menu with VDR 1.7.28+. - Fixed: Main menu info area with VDR 1.7.28+. - Added: Setup options to set width of signal information and progress bar in channel info OSD. @@ -25,6 +25,7 @@ #include <vdr/osd.h> #include <vdr/themes.h> #include <vdr/plugin.h> +#include <vdr/videodir.h> #ifndef DISABLE_SIGNALINFO #include <sys/ioctl.h> @@ -1077,6 +1078,9 @@ private: const cFont *pFontInfoTimerText; const cFont *pFontFixed; +#if VDRVERSNUM >= 10728 + int lastDiskUsageState; +#endif char *strTitle; char *strLastDate; char *strTheme; @@ -1113,6 +1117,7 @@ private: bool fScrollOther; bool fScrollbarShown; + void DrawTitle(void); void DrawScrollbar(int Total, int Offset, int Shown, int Top, int Left, int Height, bool CanScrollUp, bool CanScrollDown); void SetTextScrollbar(void); void SetupAreas(void); @@ -1146,6 +1151,9 @@ public: cSkinEnigmaDisplayMenu::cSkinEnigmaDisplayMenu(void) { +#if VDRVERSNUM >= 10728 + lastDiskUsageState = -1; +#endif struct EnigmaOsdSize OsdSize; EnigmaConfig.GetOsdSize(&OsdSize); @@ -1721,6 +1729,24 @@ void cSkinEnigmaDisplayMenu::Clear(void) } +void cSkinEnigmaDisplayMenu::DrawTitle(void) +{ +#if VDRVERSNUM >= 10728 + bool WithDisk = MenuCategory() == mcMain || MenuCategory() == mcRecording; + idTitle = TE_MARQUEE(osd, idTitle, fScrollTitle, + xTitleLeft + xIndent, yTitleTop + (yTitleBottom - yTitleTop - pFontOsdTitle->Height()) / 2, + WithDisk ? (const char*)cString::sprintf("%s - %s", strTitle, *cVideoDiskUsage::String()) : strTitle, + Theme.Color(clrTitleFg), Theme.Color(clrTitleBg), + pFontOsdTitle, nBPP, xTitleRight - xTitleLeft - xIndent - 1); +#else + idTitle = TE_MARQUEE(osd, idTitle, fScrollTitle, + xTitleLeft + xIndent, yTitleTop + (yTitleBottom - yTitleTop - pFontOsdTitle->Height()) / 2, + strTitle, + Theme.Color(clrTitleFg), Theme.Color(clrTitleBg), + pFontOsdTitle, nBPP, xTitleRight - xTitleLeft - xIndent - 1); +#endif +} + void cSkinEnigmaDisplayMenu::SetTitle(const char *Title) { debug("cSkinEnigmaDisplayMenu::SetTitle(%s)", Title); @@ -1754,7 +1780,7 @@ void cSkinEnigmaDisplayMenu::SetTitle(const char *Title) fLocked = true; TE_LOCK; } - idTitle = TE_MARQUEE(osd, idTitle, fScrollTitle, xTitleLeft + xIndent, yTitleTop + (yTitleBottom - yTitleTop - pFontOsdTitle->Height()) / 2, strTitle, Theme.Color(clrTitleFg), Theme.Color(clrTitleBg), pFontOsdTitle, nBPP, xTitleRight - xTitleLeft - xIndent - 1); + DrawTitle(); if (fLockNeeded && !fLocked) TE_UNLOCK; } else { bool old_isMainMenu = isMainMenu; @@ -1800,7 +1826,7 @@ void cSkinEnigmaDisplayMenu::SetTitle(const char *Title) fLocked = true; TE_LOCK; } - idTitle = TE_MARQUEE(osd, idTitle, fScrollTitle, xTitleLeft + xIndent, yTitleTop + (yTitleBottom - yTitleTop - pFontOsdTitle->Height()) / 2, strTitle, Theme.Color(clrTitleFg), Theme.Color(clrTitleBg), pFontOsdTitle, nBPP, xTitleRight - xTitleLeft - xIndent - 1); + DrawTitle(); if (fLockNeeded && !fLocked) TE_UNLOCK; } } @@ -2998,6 +3024,11 @@ void cSkinEnigmaDisplayMenu::Flush(void) if (fLockNeeded && !fLocked) TE_LOCK; //debug("cSkinEnigmaDisplayMenu::Flush()"); +#if VDRVERSNUM >= 10728 + if (cVideoDiskUsage::HasChanged(lastDiskUsageState)) + DrawTitle(); +#endif + if (fShowLogo) { time_t t = time(NULL); cString time = TimeString(t); |