Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > d86b5295c5577708848c16d0c598128c > files > 3

vdr-skinenigmang-0.1.2-11.fc18.src.rpm

From 51fc8602d62d81b3a717a85b748f79bccf90621a Mon Sep 17 00:00:00 2001
From: Andreas Mair
Date: Wed, 06 Jun 2012 15:33:01 +0000
Subject: Added: Display free video disk space in main and recordings menu with VDR 1.7.28+.

---
diff --git a/HISTORY b/HISTORY
index ba88423..951f4d9 100644
--- a/HISTORY
+++ b/HISTORY
@@ -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.
 
diff --git a/enigma.c b/enigma.c
index 6282017..7c2133b 100644
--- a/enigma.c
+++ b/enigma.c
@@ -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);
--
cgit v0.9.0.2-39-g756e