diff options
author | mrwastl <mrwastl@users.sourceforge.net> | 2011-10-04 23:06:07 +0200 |
---|---|---|
committer | mrwastl <mrwastl@users.sourceforge.net> | 2011-10-04 23:06:07 +0200 |
commit | cd447f97099fb494716a7e9c2aad1716f456ba63 (patch) | |
tree | a7cb495a4fd68d5d13ccc0cee96fa561afe00fc5 /skinconfig.c | |
parent | 2d3832dd913f678f40a748faa4aeb1429bec4df1 (diff) | |
download | vdr-plugin-graphlcd-cd447f97099fb494716a7e9c2aad1716f456ba63.tar.gz vdr-plugin-graphlcd-cd447f97099fb494716a7e9c2aad1716f456ba63.tar.bz2 |
fixed wrong recordinglength with vdr-1.7.x (thx to copperhead for pointing out this one)
Diffstat (limited to 'skinconfig.c')
-rw-r--r-- | skinconfig.c | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/skinconfig.c b/skinconfig.c index 51ecc69..1c351e1 100644 --- a/skinconfig.c +++ b/skinconfig.c @@ -437,25 +437,13 @@ 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 + return DurationType(event.duration, Token.Attrib.Text); 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 + return DurationType(time(NULL) - event.startTime, Token.Attrib.Text); 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 DurationType(event.duration - (time(NULL) - event.startTime), Token.Attrib.Text); } return false; case tokPresentTitle: @@ -482,11 +470,7 @@ 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 + return DurationType(event.duration, Token.Attrib.Text); case tokFollowingTitle: return event.title; case tokFollowingShortText: @@ -567,20 +551,28 @@ GLCD::cType cGraphLCDSkinConfig::GetToken(const GLCD::tSkinToken & Token) else if (Token.Id > tokPrivateReplayStart && Token.Id < tokPrivateReplayEnd) { tReplayState replay = mState->GetReplayState(); + double framesPerSec = +#if VDRVERSNUM >= 10701 + replay.control->FramesPerSecond() +#else + (double)FRAMESPERSEC +#endif + ; + switch (Token.Id) { case tokReplayTitle: return replay.name; case tokReplayPositionIndex: - return DurationType(replay.current, Token.Attrib.Text); + return DurationType(replay.current, Token.Attrib.Text, framesPerSec); case tokReplayDurationIndex: - return DurationType(replay.total, Token.Attrib.Text); + return DurationType(replay.total, Token.Attrib.Text, framesPerSec); case tokReplayPosition: return replay.current; case tokReplayDuration: return replay.total; case tokReplayRemaining: - return DurationType(replay.total - replay.current, Token.Attrib.Text); + return DurationType(replay.total - replay.current, Token.Attrib.Text, framesPerSec); case tokIsPlaying: case tokReplayIsPlaying: return replay.play && replay.speed == -1; |