diff options
author | andreas 'randy' weinberger <vdr@smue.org> | 2010-11-23 21:45:02 +0100 |
---|---|---|
committer | andreas 'randy' weinberger <vdr@smue.org> | 2010-11-23 21:45:02 +0100 |
commit | 07df0b7d65164254613e77c93ff75e045be0955a (patch) | |
tree | e3c1ddbfe5c5eece8d8bedb1a2834ad118ace4e3 /display.c | |
parent | 8291136596cf2a6a97d587f09e1378518f6734b6 (diff) | |
download | vdr-plugin-graphlcd-07df0b7d65164254613e77c93ff75e045be0955a.tar.gz vdr-plugin-graphlcd-07df0b7d65164254613e77c93ff75e045be0955a.tar.bz2 |
fixed vdr 1.6.0 combatibility0.1.8
Diffstat (limited to 'display.c')
-rw-r--r-- | display.c | 34 |
1 files changed, 33 insertions, 1 deletions
@@ -1344,15 +1344,30 @@ void cGraphLCDDisplay::DisplayProgramme() } } +#if VDRVERSNUM >= 10701 bool cGraphLCDDisplay::IndexIsGreaterAsOneHour(int Index, double framesPerSecond) const { return (((Index / framesPerSecond) / 3600) > 0); } +#else +bool cGraphLCDDisplay::IndexIsGreaterAsOneHour(int Index) const +{ + int h = (Index / FRAMESPERSEC) / 3600; + return h > 0; +} +#endif +#if VDRVERSNUM >= 10701 const char * cGraphLCDDisplay::IndexToMS(int Index, double framesPerSecond) const { static char buffer[16]; int s = (Index / framesPerSecond); +#else +const char * cGraphLCDDisplay::IndexToMS(int Index) const +{ + static char buffer[16]; + int s = (Index / FRAMESPERSEC); +#endif int m = s / 60; s %= 60; snprintf(buffer, sizeof(buffer), "%02d:%02d", m, s); @@ -1531,7 +1546,8 @@ void cGraphLCDDisplay::DisplayReplay(tReplayState & replay) } else { - if ((replay.total > 1 && IndexIsGreaterAsOneHour(replay.total, replay.framesPerSecond)) || +#if VDRVERSNUM >= 10701 + if ((replay.total > 1 && IndexIsGreaterAsOneHour(replay.total, replay.framesPerSecond)) || IndexIsGreaterAsOneHour(replay.current, replay.framesPerSecond)) // Check if any index bigger as one hour { szCurrent = (const char *) IndexToHMSF(replay.current, false, replay.framesPerSecond); @@ -1545,6 +1561,22 @@ void cGraphLCDDisplay::DisplayReplay(tReplayState & replay) if (replay.total > 1) // Don't draw totaltime for endless streams szTotal = (const char *) IndexToMS(replay.total, replay.framesPerSecond); } +#else + if ((replay.total > 1 && IndexIsGreaterAsOneHour(replay.total)) || + IndexIsGreaterAsOneHour(replay.current)) // Check if any index bigger as one hour + { + szCurrent = (const char *) IndexToHMSF(replay.current); + if (replay.total > 1) // Don't draw totaltime for endless streams + szTotal = (const char *) IndexToHMSF(replay.total); + } + else + { + // Show only minutes and seconds on short replays + szCurrent = (const char *) IndexToMS(replay.current); + if (replay.total > 1) // Don't draw totaltime for endless streams + szTotal = (const char *) IndexToMS(replay.total); + } +#endif } // Get width of drawable strings nWidthPreMsg = normalFont->Width(szPreMsg); |