summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranbr <vdr07@deltab.de>2017-01-28 11:13:10 (GMT)
committeranbr <vdr07@deltab.de>2017-01-28 11:13:10 (GMT)
commit39ab2e50bc4ad3881c4966facb97011e6b46202f (patch)
tree2dad55b0fc17026dcb9364f317ea1a66ef321afa
parent3fa6528d6d68d9f549c7007e8427d53af8168117 (diff)
downloadvdr-plugin-imonlcd-39ab2e50bc4ad3881c4966facb97011e6b46202f.tar.gz
vdr-plugin-imonlcd-39ab2e50bc4ad3881c4966facb97011e6b46202f.tar.bz2
Update plugin interface for vdr 2.3.2
-rw-r--r--HISTORY1
-rw-r--r--ffont.c1
-rw-r--r--ffont.h2
-rw-r--r--watch.c91
4 files changed, 60 insertions, 35 deletions
diff --git a/HISTORY b/HISTORY
index bc9533c..ff81641 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,7 @@
VDR Plugin 'imonlcd' Revision History
-------------------------------------
+- Update plugin interface for vdr 2.3.2
- Fix display wrong time for HD recording if they greater than one hour (Bug #1568)
2013-03-23: Version 1.0.1
diff --git a/ffont.c b/ffont.c
index 175ed58..e694aad 100644
--- a/ffont.c
+++ b/ffont.c
@@ -58,6 +58,7 @@ ciMonFont::ciMonFont(const char *Name, int CharHeight, int CharWidth)
{
height = 0;
bottom = 0;
+ width = CharWidth;
int error = FT_Init_FreeType(&library);
if (!error) {
error = FT_New_Face(library, Name, 0, &face);
diff --git a/ffont.h b/ffont.h
index 614e6b7..68deb7c 100644
--- a/ffont.h
+++ b/ffont.h
@@ -59,6 +59,7 @@ class ciMonFont : public cFont {
private:
int height;
int bottom;
+ int width;
FT_Library library; ///< Handle to library
FT_Face face; ///< Handle to face object
mutable cList<ciMonGlyph> glyphCacheMonochrome;
@@ -70,6 +71,7 @@ private:
public:
ciMonFont(const char *Name, int CharHeight, int CharWidth = 0);
virtual ~ciMonFont();
+ virtual int Width(void) const { return width; }
virtual int Width(uint c) const;
virtual int Width(const char *s) const;
virtual int Height(void) const { return height; }
diff --git a/watch.c b/watch.c
index 9f7b5b0..2157e08 100644
--- a/watch.c
+++ b/watch.c
@@ -140,8 +140,16 @@ void ciMonWatch::shutdown(int nExitMode) {
}
if(this->isopen()) {
- cTimer* t = Timers.GetNextActiveTimer();
-
+ const cTimer* t = NULL;
+#if APIVERSNUM >= 20302
+ cStateKey lock;
+ if (const cTimers *Timers = cTimers::GetTimersRead(lock)) {
+ t = Timers->GetNextActiveTimer();
+ lock.Remove();
+ }
+#else
+ t = Timers.GetNextActiveTimer();
+#endif
switch(nExitMode) {
case eOnExitMode_NEXTTIMER: {
isyslog("iMonLCD: closing, show only next timer.");
@@ -849,7 +857,17 @@ void ciMonWatch::Channel(int ChannelNumber)
m_eVideoMode = eVideoNone;
m_eAudioMode = eAudioNone;
- cChannel * ch = Channels.GetByNumber(ChannelNumber);
+ const cChannel * ch = NULL;
+#if APIVERSNUM >= 20302
+ cStateKey lock;
+ if (const cChannels *Channels = cChannels::GetChannelsRead(lock)) {
+ ch = Channels->GetByNumber(ChannelNumber);
+ lock.Remove();
+ }
+#else
+ ch = Channels.GetByNumber(ChannelNumber);
+#endif
+
if(ch) {
chID = ch->GetChannelID();
chPresentTime = 0;
@@ -868,49 +886,52 @@ void ciMonWatch::Channel(int ChannelNumber)
}
bool ciMonWatch::Program() {
-
bool bChanged = false;
const cEvent * p = NULL;
- cSchedulesLock schedulesLock;
- const cSchedules * schedules = cSchedules::Schedules(schedulesLock);
- if (chID.Valid() && schedules)
- {
- const cSchedule * schedule = schedules->GetSchedule(chID);
- if (schedule)
- {
- if ((p = schedule->GetPresentEvent()) != NULL)
- {
- if(chPresentTime && chEventID == p->EventID()) {
- return false;
- }
+#if APIVERSNUM >= 20302
+ cStateKey lock;
+ const cSchedules * schedules = cSchedules::GetSchedulesRead(lock);
+#else
+ cSchedulesLock lock;
+ const cSchedules * schedules = cSchedules::Schedules(lock);
+#endif
+ if (chID.Valid() && schedules) {
+ const cSchedule * schedule = schedules->GetSchedule(chID);
+ if (schedule) {
- bChanged = true;
- chEventID = p->EventID();
- chPresentTime = p->StartTime();
- chFollowingTime = p->EndTime();
+ if ((p = schedule->GetPresentEvent()) != NULL) {
- if(chPresentTitle) {
- delete chPresentTitle;
- chPresentTitle = NULL;
- }
- if (!isempty(p->Title())) {
- chPresentTitle = new cString(p->Title());
- }
+ if(chPresentTime && chEventID != p->EventID()) {
+ bChanged = true;
+ chEventID = p->EventID();
+ chPresentTime = p->StartTime();
+ chFollowingTime = p->EndTime();
- if(chPresentShortTitle) {
- delete chPresentShortTitle;
- chPresentShortTitle = NULL;
- }
- if (!isempty(p->ShortText())) {
- chPresentShortTitle = new cString(p->ShortText());
- }
+ if(chPresentTitle) {
+ delete chPresentTitle;
+ chPresentTitle = NULL;
+ }
+ if (!isempty(p->Title())) {
+ chPresentTitle = new cString(p->Title());
}
+
+ if(chPresentShortTitle) {
+ delete chPresentShortTitle;
+ chPresentShortTitle = NULL;
+ }
+ if (!isempty(p->ShortText())) {
+ chPresentShortTitle = new cString(p->ShortText());
+ }
+ }
}
+ }
+#if APIVERSNUM >= 20302
+ lock.Remove();
+#endif
}
return bChanged;
}
-
void ciMonWatch::Volume(int nVolume, bool bAbsolute)
{
cMutexLooker m(mutex);