From 9b7c321b381c7a85eb7a05e4c41c21cb45ea8fa6 Mon Sep 17 00:00:00 2001 From: mrwastl Date: Wed, 5 May 2010 00:20:33 +0200 Subject: ported DEFAULTFRAMESPERSECOND-patch from 0.1.x to 0.2.0 --- common.c | 5 +++++ skinconfig.c | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) 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: -- cgit v1.2.3