summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranbr <vdr07@deltab.de>2017-01-28 12:08:49 +0100
committeranbr <vdr07@deltab.de>2017-01-28 12:08:49 +0100
commit586585d8465bca9b78accb0c250a489f8a60acb9 (patch)
tree3b8cc9a07ffe594850e59e225c16fc91df33c4a5
parentdda51eecf59675024160018fa94a828cea1d7404 (diff)
downloadvdr-plugin-targavfd-586585d8465bca9b78accb0c250a489f8a60acb9.tar.gz
vdr-plugin-targavfd-586585d8465bca9b78accb0c250a489f8a60acb9.tar.bz2
Update plugin interface for vdr 2.3.2 (Closes: #2463)
-rw-r--r--HISTORY2
-rw-r--r--ffont.c1
-rw-r--r--ffont.h2
-rw-r--r--watch.c90
4 files changed, 62 insertions, 33 deletions
diff --git a/HISTORY b/HISTORY
index fef32ba..646fafe 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,8 @@
VDR Plugin 'targavfd' Revision History
-------------------------------------
+- Update plugin interface for vdr 2.3.2 (Request #2463)
+
2014-06-14: Version 0.3.0
- New render mode - multiple pages
- New option, show replay progress as bargraph (Request #666)
diff --git a/ffont.c b/ffont.c
index 952f891..37a41ad 100644
--- a/ffont.c
+++ b/ffont.c
@@ -58,6 +58,7 @@ cVFDFont::cVFDFont(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 e205081..0e4c6ad 100644
--- a/ffont.h
+++ b/ffont.h
@@ -61,6 +61,7 @@ class cVFDFont : public cFont {
private:
int height;
int bottom;
+ int width;
FT_Library library; ///< Handle to library
FT_Face face; ///< Handle to face object
mutable cList<cVFDGlyph> glyphCacheMonochrome;
@@ -74,6 +75,7 @@ private:
public:
cVFDFont(const char *Name, int CharHeight, int CharWidth = 0);
virtual ~cVFDFont();
+ 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 6414c29..7f79e78 100644
--- a/watch.c
+++ b/watch.c
@@ -138,7 +138,6 @@ void cVFDWatch::shutdown(int nExitMode) {
}
if(this->isopen()) {
- cTimer* t = Timers.GetNextActiveTimer();
switch(nExitMode) {
case eOnExitMode_NEXTTIMER:
@@ -147,6 +146,17 @@ void cVFDWatch::shutdown(int nExitMode) {
int nTop = (theSetup.m_cHeight - pFont->Height())/2;
this->clear();
+
+ 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
if(t) {
struct tm l;
cString topic;
@@ -822,7 +832,17 @@ void cVFDWatch::Channel(int ChannelNumber)
chName = NULL;
}
- 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;
@@ -837,44 +857,48 @@ void cVFDWatch::Channel(int ChannelNumber)
}
bool cVFDWatch::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;
}