diff options
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; |