summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandreas 'randy' weinberger <vdr@smue.org>2010-11-23 21:45:02 +0100
committerandreas 'randy' weinberger <vdr@smue.org>2010-11-23 21:45:02 +0100
commit07df0b7d65164254613e77c93ff75e045be0955a (patch)
treee3c1ddbfe5c5eece8d8bedb1a2834ad118ace4e3
parent8291136596cf2a6a97d587f09e1378518f6734b6 (diff)
downloadvdr-plugin-graphlcd-07df0b7d65164254613e77c93ff75e045be0955a.tar.gz
vdr-plugin-graphlcd-07df0b7d65164254613e77c93ff75e045be0955a.tar.bz2
fixed vdr 1.6.0 combatibility0.1.8
-rw-r--r--display.c34
-rw-r--r--display.h5
-rw-r--r--state.c2
3 files changed, 39 insertions, 2 deletions
diff --git a/display.c b/display.c
index af64461..37361f0 100644
--- a/display.c
+++ b/display.c
@@ -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);
diff --git a/display.h b/display.h
index 09e297a..a9a1354 100644
--- a/display.h
+++ b/display.h
@@ -131,10 +131,15 @@ private:
void UpdateIn(long usec);
bool CheckAndUpdateSymbols();
+#if VDRVERSNUM >= 10701
/** Check if replay index bigger as one hour */
bool IndexIsGreaterAsOneHour(int Index, double framesPerSecond) const;
/** Translate replay index to string with minute and second MM:SS */
const char *IndexToMS(int Index, double framesPerSecond) const;
+#else
+ bool IndexIsGreaterAsOneHour(int Index) const;
+ const char *IndexToMS(int Index) const;
+#endif
/** Compare Scroller with new Textbuffer*/
bool IsScrollerTextChanged(const std::vector<cScroller> & scroller, const std::vector <std::string> & lines) const;
/** Returns true if Logo loaded and active*/
diff --git a/state.c b/state.c
index 771e113..6f29e9d 100644
--- a/state.c
+++ b/state.c
@@ -45,7 +45,7 @@ cGraphLCDState::cGraphLCDState(cGraphLCDDisplay * Display)
replay.framesPerSecond = DEFAULTFRAMESPERSECOND;
#else
replay.currentLast = FRAMESPERSEC;
- replay.framesPerSecond = FRAMESPERSECOND;
+ replay.framesPerSecond = FRAMESPERSEC;
#endif
replay.total = 0;
replay.totalLast = 1;