summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Neumann <fnu@yavdr.org>2017-06-04 11:27:08 +0200
committerFrank Neumann <fnu@yavdr.org>2017-06-04 11:27:08 +0200
commitc8537f7c94658acea25df5be4c281310d0dd1259 (patch)
tree4b3412f6547bfefb3618c25393cdb0a9fe3e0154
parent756bbf36c3b18732fd1a8800b01fad6a9a67df8d (diff)
downloadvdr-plugin-text2skin-c8537f7c94658acea25df5be4c281310d0dd1259.tar.gz
vdr-plugin-text2skin-c8537f7c94658acea25df5be4c281310d0dd1259.tar.bz2
Drop legacy code prior VDR 2.2.0.
-rw-r--r--common.c45
-rw-r--r--display.c28
-rw-r--r--render.c36
-rw-r--r--status.c8
-rw-r--r--text2skin.c4
5 files changed, 2 insertions, 119 deletions
diff --git a/common.c b/common.c
index 36faac4..20eeac0 100644
--- a/common.c
+++ b/common.c
@@ -145,38 +145,6 @@ const cRecording *GetRecordingByFileName(const char *FileName)
#endif
}
-#if VDRVERSNUM < 20000
-
-int GetFrontendSTR(void)
-{
- uint16_t value = 0;
- cString dev = cString::sprintf(FRONTEND_DEVICE, cDevice::ActualDevice()->CardIndex(), 0);
-
- int fe = open(dev, O_RDONLY | O_NONBLOCK);
- if (fe < 0)
- return 0;
- CHECK(ioctl(fe, FE_READ_SIGNAL_STRENGTH, &value));
- close(fe);
-
- return value / 655;
-}
-
-int GetFrontendSNR(void)
-{
- uint16_t value = 0;
- cString dev = cString::sprintf(FRONTEND_DEVICE, cDevice::ActualDevice()->CardIndex(), 0);
-
- int fe = open(dev, O_RDONLY | O_NONBLOCK);
- if (fe < 0)
- return 0;
- CHECK(ioctl(fe, FE_READ_SNR, &value));
- close(fe);
-
- return value / 655;
-}
-#endif
-
-#if VDRVERSNUM >= 20000
int GetFrontendSTR(void)
{
int SignalStrength = cDevice::ActualDevice()->SignalStrength();
@@ -194,7 +162,6 @@ int GetFrontendSNR(void)
return SignalQuality;
}
-#endif
bool GetFrontendHasLock(void)
{
@@ -334,29 +301,17 @@ int GetRecordingCuttedLength(const char *FileName, double FramesPerSecond, bool
int totalLength = GetRecordingLength(FileName, FramesPerSecond, IsPesRecording);
const double diffIFrame = FramesPerSecond / 2; // approx. 1/2 sec.
-#if VDRVERSNUM >= 10703
marks.Load(FileName, FramesPerSecond, IsPesRecording);
-#else
- marks.Load(FileName);
-#endif
if (marks.Count()) {
int start = 1; // first frame
bool isStart = true;
-#if APIVERSNUM >= 10721
for (cMark *m = marks.First(); m; m = marks.GetNext(m->Position())) {
if (isStart)
start = m->Position();
else
length += (double)(m->Position() - start + 1 + diffIFrame) / (60 * FramesPerSecond); // [min]
-#else
- for (cMark *m = marks.First(); m; m = marks.GetNext(m->position)) {
- if (isStart)
- start = m->position;
- else
- length += (double)(m->position - start + 1 + diffIFrame) / (60 * FramesPerSecond); // [min]
-#endif
isStart = !isStart;
}
diff --git a/display.c b/display.c
index bc10bd1..7800729 100644
--- a/display.c
+++ b/display.c
@@ -250,27 +250,19 @@ cxType cText2SkinDisplayChannel::GetTokenData(const txToken &Token)
return false;
case tVideoSizeWidth: {
-#if VDRVERSNUM >= 10707
int width, height;
double aspect;
cDevice *dev = cDevice::PrimaryDevice();
dev->GetVideoSize(width, height, aspect);
return (cxType)width;
-#else
- return 0;
-#endif
}
case tVideoSizeHeight: {
-#if VDRVERSNUM >= 10707
int width, height;
double aspect;
cDevice *dev = cDevice::PrimaryDevice();
dev->GetVideoSize(width, height, aspect);
return (cxType)height;
-#else
- return 0;
-#endif
}
case tHasTeletext:
@@ -1313,29 +1305,17 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token)
case tRecordingPriority:
return mRecording != NULL
-#if APIVERSNUM >= 10721
? (cxType)mRecording->Priority()
-#else
- ? (cxType)mRecording->priority
-#endif
: (cxType)false;
case tRecordingLifetime:
return mRecording != NULL
-#if APIVERSNUM >= 10721
? (cxType)mRecording->Lifetime()
-#else
- ? (cxType)mRecording->lifetime
-#endif
: (cxType)false;
case tRecordingDateTime:
return mRecording != NULL
-#if APIVERSNUM >= 10721
? (cxType)TimeType(mRecording->Start(), Token.Attrib.Text)
-#else
- ? (cxType)TimeType(mRecording->start, Token.Attrib.Text)
-#endif
: (cxType)false;
case tRecordingTitle:
@@ -1426,20 +1406,12 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token)
case tRecordingLength:
return mRecording != NULL
-#if VDRVERSNUM >= 10703
? (cxType)GetRecordingLength(mRecording->FileName(), mRecording->FramesPerSecond(), mRecording->IsPesRecording())
-#else
- ? (cxType)GetRecordingLength(mRecording->FileName(), FRAMESPERSEC, true)
-#endif
: (cxType)false;
case tRecordingCuttedLength:
return mRecording != NULL
-#if VDRVERSNUM >= 10703
? (cxType)GetRecordingCuttedLength(mRecording->FileName(), mRecording->FramesPerSecond(), mRecording->IsPesRecording())
-#else
- ? (cxType)GetRecordingCuttedLength(mRecording->FileName(), FRAMESPERSEC, true)
-#endif
: (cxType)false;
default:
diff --git a/render.c b/render.c
index 309c4b6..b250342 100644
--- a/render.c
+++ b/render.c
@@ -603,25 +603,14 @@ void cText2SkinRender::DrawProgressbar(const txPoint &Pos, const txSize &Size, i
if (Marks) {
bool start = true;
for (const cMark *m = Marks->First(); m; m = Marks->Next(m)) {
-#if APIVERSNUM >= 10721
txPoint pt(Pos.x + m->Position() * Size.w / Total, Pos.y);
-#else
- txPoint pt(Pos.x + m->position * Size.w / Total, Pos.y);
-#endif
if (Selected && start) {
const cMark *m2 = Marks->Next(m);
DrawRectangle(txPoint(pt.x, Pos.y + Size.h / 3),
-#if APIVERSNUM >= 10721
txSize(((m2 ? m2->Position() : Total) - m->Position())
* Size.w / Total + 1, Size.h - Size.h * 2 / 3 + 1), Selected);
}
DrawMark(pt, Size, start, m->Position() == Current, false, Mark, Cur);
-#else
- txSize(((m2 ? m2->position : Total) - m->position)
- * Size.w / Total + 1, Size.h - Size.h * 2 / 3 + 1), Selected);
- }
- DrawMark(pt, Size, start, m->position == Current, false, Mark, Cur);
-#endif
start = !start;
}
}
@@ -631,26 +620,15 @@ void cText2SkinRender::DrawProgressbar(const txPoint &Pos, const txSize &Size, i
if (Marks) {
bool start = true;
for (const cMark *m = Marks->First(); m; m = Marks->Next(m)) {
-#if APIVERSNUM >= 10721
txPoint pt(Pos.x, Pos.y + m->Position() * Size.h / Total);
-#else
- txPoint pt(Pos.x, Pos.y + m->position * Size.h / Total);
-#endif
if (Selected && start) {
const cMark *m2 = Marks->Next(m);
DrawRectangle(txPoint(Pos.x + Size.w / 3, pt.y),
txSize(Size.w - Size.w * 2 / 3 + 1,
-#if APIVERSNUM >= 10721
((m2 ? m2->Position() : Total) - m->Position())
* Size.h / Total + 1), Selected);
}
DrawMark(pt, Size, start, m->Position() == Current, true, Mark, Cur);
-#else
- ((m2 ? m2->position : Total) - m->position)
- * Size.h / Total + 1), Selected);
- }
- DrawMark(pt, Size, start, m->position == Current, true, Mark, Cur);
-#endif
start = !start;
}
}
@@ -841,11 +819,7 @@ cxType cText2SkinRender::GetTokenData(const txToken &Token)
switch (Token.Type) {
case tFreeDiskSpace: {
int FreeMB;
-#if APIVERSNUM > 20101
cVideoDirectory::VideoDiskSpace(&FreeMB);
-#else
- VideoDiskSpace(&FreeMB);
-#endif
Dprintf("FreeMB: %d, attrib type is %d\n", FreeMB,Token.Attrib.Type);
return Token.Attrib.Type == aString && Token.Attrib.Text.length() > 0
? (cxType)DurationType(FreeMB * 60 / MB_PER_MINUTE,
@@ -855,31 +829,21 @@ cxType cText2SkinRender::GetTokenData(const txToken &Token)
case tUsedDiskSpace: {
int FreeMB, UsedMB;
-#if APIVERSNUM > 20101
cVideoDirectory::VideoDiskSpace(&FreeMB, &UsedMB);
-#else
- VideoDiskSpace(&FreeMB, &UsedMB);
-#endif
return (cxType)UsedMB;
}
case tTotalDiskSpace: {
int FreeMB, UsedMB;
-#if APIVERSNUM > 20101
cVideoDirectory::VideoDiskSpace(&FreeMB, &UsedMB);
-#else
- VideoDiskSpace(&FreeMB, &UsedMB);
-#endif
return (cxType)FreeMB+UsedMB;
}
-#if VDRVERSNUM >= 10728
case tDiskUsage: {
cVideoDiskUsage::ForceCheck();
string DiskUsage = string(cString::sprintf("%s", *cVideoDiskUsage::String()));
return DiskUsage;
}
-#endif
case tVdrVersion: {
return VDRVERSION;
diff --git a/status.c b/status.c
index 14606cd..f562c8a 100644
--- a/status.c
+++ b/status.c
@@ -88,12 +88,8 @@ void cText2SkinStatus::Replaying(const cControl* /*Control*/, const char *Name,
mReplayIsShuffle = false;
}
-#if VDRVERSNUM >= 10703
// Workaround: Control->FramesPerSecond() not possible because its not const
mReplayFramesPerSecond = mReplay != NULL ? mReplay->FramesPerSecond() : DEFAULTFRAMESPERSECOND;
-#else
- mReplayFramesPerSecond = FRAMESPERSEC;
-#endif
if (mRender != NULL) {
if (mReplayMode != oldMode)
@@ -332,11 +328,7 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token)
case tReplayDateTime:
return mReplay != NULL
-#if APIVERSNUM >= 10721
? (cxType)TimeType(mReplay->Start(), Token.Attrib.Text)
-#else
- ? (cxType)TimeType(mReplay->start, Token.Attrib.Text)
-#endif
: (cxType)false;
case tReplayShortText:
diff --git a/text2skin.c b/text2skin.c
index 56732e5..988316d 100644
--- a/text2skin.c
+++ b/text2skin.c
@@ -12,8 +12,8 @@
#include "loader.h"
#include "status.h"
-#if APIVERSNUM < 10600
-#error "VDR-1.6.0 API version or greater is required!"
+#if APIVERSNUM < 20200
+#error "VDR-2.2.0 API version or greater is required!"
#endif
const char *cText2SkinPlugin::VERSION = "1.3.4+git";