summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY3
-rw-r--r--watch.c36
-rw-r--r--watch.h4
3 files changed, 21 insertions, 22 deletions
diff --git a/HISTORY b/HISTORY
index 0ec1cf5..8289658 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,9 @@
VDR Plugin 'imonlcd' Revision History
-------------------------------------
+- Update plugin interface for vdr 2.3.3
+- Drop legacy code prior vdr 1.7.3
+
2017-01-29: Version 1.0.2
- Update plugin interface for vdr 2.3.2
- Fix display wrong time for HD recording if they greater than one hour (Bug #1568)
diff --git a/watch.c b/watch.c
index 7f3d6df..e9d0fb8 100644
--- a/watch.c
+++ b/watch.c
@@ -601,7 +601,11 @@ void ciMonWatch::Replaying(const cControl * Control, const char * szName, const
m_eVideoMode = eVideoMPG;
m_eAudioMode = eAudioMPG;
- m_pControl = (cControl *) Control;
+#if APIVERSNUM >= 20302
+ m_pControl = Control;
+#else
+ m_pControl = (cControl *)Control;
+#endif
m_eWatchMode = eReplayNormal;
if(replayTitle) {
delete replayTitle;
@@ -723,9 +727,8 @@ eReplayState ciMonWatch::ReplayMode() const
{
bool Play = false, Forward = false;
int Speed = -1;
- if (m_pControl
- && ((cControl *)m_pControl)->GetReplayMode(Play,Forward,Speed))
- {
+ if (m_pControl
+ && m_pControl->GetReplayMode(Play,Forward,Speed)) {
// 'Play' tells whether we are playing or pausing, 'Forward' tells whether
// we are going forward or backward and 'Speed' is -1 if this is normal
// play/pause mode, 0 if it is single speed fast/slow forward/back mode
@@ -748,11 +751,12 @@ eReplayState ciMonWatch::ReplayMode() const
bool ciMonWatch::ReplayPosition(int &current, int &total, double& dFrameRate) const
{
- if (m_pControl && ((cControl *)m_pControl)->GetIndex(current, total, false)) {
+ if (m_pControl
+ && m_pControl->GetIndex(current, total, false)) {
+
+ dFrameRate = m_pControl->FramesPerSecond();
total = (total == 0) ? 1 : total;
-#if VDRVERSNUM >= 10703
- dFrameRate = ((cControl *)m_pControl)->FramesPerSecond();
-#endif
+
return true;
}
return false;
@@ -773,22 +777,14 @@ const char * ciMonWatch::FormatReplayTime(int current, int total, double dFrameR
if (total > 1) {
if(g) {
-#if VDRVERSNUM >= 10703
snprintf(s, sizeof(s), "%s (%s)", (const char*)IndexToHMSF(current,false,dFrameRate), (const char*)IndexToHMSF(total,false,dFrameRate));
-#else
- snprintf(s, sizeof(s), "%s (%s)", (const char*)IndexToHMSF(current), (const char*)IndexToHMSF(total));
-#endif
} else {
snprintf(s, sizeof(s), "%02d:%02d (%02d:%02d)", cm, cs, tm, ts);
}
}
else {
if(g) {
-#if VDRVERSNUM >= 10703
snprintf(s, sizeof(s), "%s", (const char*)IndexToHMSF(current,false,dFrameRate));
-#else
- snprintf(s, sizeof(s), "%s", (const char*)IndexToHMSF(current));
-#endif
} else {
snprintf(s, sizeof(s), "%02d:%02d", cm, cs);
}
@@ -797,12 +793,8 @@ const char * ciMonWatch::FormatReplayTime(int current, int total, double dFrameR
}
bool ciMonWatch::ReplayTime(int &current, int &total) {
- double dFrameRate;
-#if VDRVERSNUM >= 10701
- dFrameRate = DEFAULTFRAMESPERSECOND;
-#else
- dFrameRate = FRAMESPERSEC;
-#endif
+ double dFrameRate = DEFAULTFRAMESPERSECOND;
+
if(ReplayPosition(current,total,dFrameRate)
&& theSetup.m_nRenderMode == eRenderMode_DualLine) {
const char * sz = FormatReplayTime(current,total,dFrameRate);
diff --git a/watch.h b/watch.h
index 22bce2c..e6ce9aa 100644
--- a/watch.h
+++ b/watch.h
@@ -98,7 +98,11 @@ private:
unsigned int m_nIconsForceOff;
unsigned int m_nIconsForceMask;
+#if APIVERSNUM >= 20302
const cControl *m_pControl;
+#else
+ cControl *m_pControl;
+#endif
tChannelID chID;
tEventID chEventID;