summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrwastl <mrwastl@users.sourceforge.net>2010-05-05 00:20:33 +0200
committermrwastl <mrwastl@users.sourceforge.net>2010-05-05 00:20:33 +0200
commit9b7c321b381c7a85eb7a05e4c41c21cb45ea8fa6 (patch)
treef1abbc324a0995249c079bc4105ba166b56df593
parentf0ce22b6b9cfda828ef000d652a0f4e2dc24334d (diff)
downloadvdr-plugin-graphlcd-9b7c321b381c7a85eb7a05e4c41c21cb45ea8fa6.tar.gz
vdr-plugin-graphlcd-9b7c321b381c7a85eb7a05e4c41c21cb45ea8fa6.tar.bz2
ported DEFAULTFRAMESPERSECOND-patch from 0.1.x to 0.2.0
-rw-r--r--common.c5
-rw-r--r--skinconfig.c16
2 files changed, 21 insertions, 0 deletions
diff --git a/common.c b/common.c
index 8b03502..431600a 100644
--- a/common.c
+++ b/common.c
@@ -36,8 +36,13 @@ GLCD::cType DurationType(int Index, const std::string &Format)
char *res = result;
enum { normal, format } state = normal;
int n = 0;
+#if VDRVERSNUM >= 10701
+ int f = (Index % DEFAULTFRAMESPERSECOND) + 1;
+ int s = (Index / DEFAULTFRAMESPERSECOND);
+#else
int f = (Index % FRAMESPERSEC) + 1;
int s = (Index / FRAMESPERSEC);
+#endif
int m = s / 60 % 60;
int h = s / 3600;
s %= 60;
diff --git a/skinconfig.c b/skinconfig.c
index 423429d..9e4b2ce 100644
--- a/skinconfig.c
+++ b/skinconfig.c
@@ -359,13 +359,25 @@ GLCD::cType cGraphLCDSkinConfig::GetToken(const GLCD::tSkinToken & Token)
case tokPresentEndDateTime:
return TimeType(event.startTime + event.duration, Token.Attrib.Text);
case tokPresentDuration:
+#if VDRVERSNUM >= 10701
+ return DurationType(event.duration * DEFAULTFRAMESPERSECOND, Token.Attrib.Text);
+#else
return DurationType(event.duration * FRAMESPERSEC, Token.Attrib.Text);
+#endif
case tokPresentProgress:
+#if VDRVERSNUM >= 10701
+ return DurationType((time(NULL) - event.startTime) * DEFAULTFRAMESPERSECOND, Token.Attrib.Text);
+#else
return DurationType((time(NULL) - event.startTime) * FRAMESPERSEC, Token.Attrib.Text);
+#endif
case tokPresentRemaining:
if ((time(NULL) - event.startTime) < event.duration)
{
+#if VDRVERSNUM >= 10701
+ return DurationType((event.duration - (time(NULL) - event.startTime)) * DEFAULTFRAMESPERSECOND, Token.Attrib.Text);
+#else
return DurationType((event.duration - (time(NULL) - event.startTime)) * FRAMESPERSEC, Token.Attrib.Text);
+#endif
}
return false;
case tokPresentTitle:
@@ -392,7 +404,11 @@ GLCD::cType cGraphLCDSkinConfig::GetToken(const GLCD::tSkinToken & Token)
case tokFollowingEndDateTime:
return TimeType(event.startTime + event.duration, Token.Attrib.Text);
case tokFollowingDuration:
+#if VDRVERSNUM >= 10701
+ return DurationType(event.duration * DEFAULTFRAMESPERSECOND, Token.Attrib.Text);
+#else
return DurationType(event.duration * FRAMESPERSEC, Token.Attrib.Text);
+#endif
case tokFollowingTitle:
return event.title;
case tokFollowingShortText: