#!/bin/sh /usr/share/dpatch/dpatch-run ## graphlcd-1.3.18 patch for graphlcd-0.1.1 by Thomas Günther ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Changes for VDR >= 1.3.18. @DPATCH@ --- graphlcd-0.1.1/display.c 2004-09-26 17:53:19.000000000 +0200 +++ graphlcd-0.1.1/display.c 2005-02-12 03:14:21.000000000 +0100 @@ -377,7 +377,11 @@ } if (GraphLCDSetup.ShowVolume && !update && iLastVolChange > 0) { +#if VDRVERSNUM < 10318 if (time_ms() - iLastVolChange > 2000) +#else + if (timeMs.Elapsed() - iLastVolChange > 2000) +#endif { iLastVolChange = 0; update = true; @@ -408,7 +412,11 @@ if (!update && IsLogoActive() && logo->Cnt() > 1 +#if VDRVERSNUM < 10318 && (time_ms() - logo->LastChange() >= logo->Delay())) +#else + && ((int)timeMs.Elapsed() - logo->LastChange() >= logo->Delay())) +#endif update = true; // update Display every minute or due to an update @@ -455,7 +463,11 @@ if (!update && IsLogoActive() && logo->Cnt() > 1 +#if VDRVERSNUM < 10318 && (time_ms() - logo->LastChange() >= logo->Delay())) +#else + && ((int)timeMs.Elapsed() - logo->LastChange() >= logo->Delay())) +#endif update = true; // update Display every second or due to an update @@ -578,7 +590,13 @@ break; } #if VDRVERSNUM >= 10300 +#if VDRVERSNUM >= 10318 + char strTmp[64]; + strcpy(strTmp, (const char *) ch->GetChannelID().ToString()); + char * strId = strstr(strTmp, "-") + 1; +#else char * strId = strstr(ch->GetChannelID().ToString(), "-") + 1; +#endif logo = logoList->GetLogo(currentChannelNr, strId, picType); #else char strId[16]; @@ -586,7 +604,11 @@ logo = logoList->GetLogo(currentChannelNr, strId, picType); #endif if (logo) +#if VDRVERSNUM < 10318 logo->First(time_ms()); +#else + logo->First(timeMs.Elapsed()); +#endif } else { @@ -1014,7 +1036,11 @@ case eReplayAudioCD: logo = logoList->GetLogo(-6, "REPLAY-AUDIOCD",picType);break; } if (logo) +#if VDRVERSNUM < 10318 logo->First(time_ms()); +#else + logo->First(timeMs.Elapsed()); +#endif } else { @@ -1108,7 +1134,11 @@ if (iLastVolChange != -1) { +#if VDRVERSNUM < 10318 iLastVolChange = time_ms(); +#else + iLastVolChange = timeMs.Elapsed(); +#endif Update(); } else @@ -1233,7 +1263,11 @@ strncpy(month, (char*)(tr("JanFebMarAprMayJunJulAugSepOctNovDec") + 3*tm->tm_mon), 3); month[3]=0; +#if VDRVERSNUM < 10318 snprintf(buffer, sizeof(buffer), "%s %2d.%s %d:%02d", WeekDayName(tm->tm_wday), tm->tm_mday, month, tm->tm_hour, tm->tm_min); +#else + snprintf(buffer, sizeof(buffer), "%s %2d.%s %d:%02d", *WeekDayName(tm->tm_wday), tm->tm_mday, month, tm->tm_hour, tm->tm_min); +#endif TextLen = normalFont->WidthS(buffer); if(TextLen>max(FrameWidth-2*TEXT_OFFSET_X,1)) { @@ -1350,7 +1384,11 @@ { if(logo->Cnt() > 1) { +#if VDRVERSNUM < 10318 int t = time_ms(); +#else + int t = timeMs.Elapsed(); +#endif if(t - logo->LastChange() >= logo->Delay()) { if(!logo->Next(t)) @@ -1416,11 +1454,19 @@ xPos -= symbols->WidthC('C')+1; pGraLib->Char(xPos, yPos, pLCDDevice->GetSizeX()-1, 'C', symbols, colorBlack, colorWhite); } +#if VDRVERSNUM < 10318 if(ch->Dpid1()) { +#else + if(ch->Dpid(0)) { +#endif xPos -= symbols->WidthC('D')+1; pGraLib->Char(xPos, yPos, pLCDDevice->GetSizeX()-1, 'D', symbols, colorBlack, colorWhite); } +#if VDRVERSNUM < 10318 if(ch->Apid2()) { +#else + if(ch->Apid(1)) { +#endif xPos -= symbols->WidthC('A')+1; pGraLib->Char(xPos, yPos, pLCDDevice->GetSizeX()-1, 'A', symbols, colorBlack, colorWhite); } @@ -1465,7 +1511,11 @@ if (iVolume == 0) { pGraLib->Char(xPos, yPos, pLCDDevice->SizeX()-1, 'M', symbols, colorBlack, colorWhite); yPos += symbols->HeightC('S')+SYMBOL_SPACE; +#if VDRVERSNUM < 10318 } else if (ch->Apid2()) { +#else + } else if (ch->Apid(1)) { +#endif pGraLib->Char(xPos, yPos, pLCDDevice->SizeX()-1, 'A', symbols, colorBlack, colorWhite); yPos += symbols->HeightC('A')+SYMBOL_SPACE; } else { @@ -1475,8 +1525,13 @@ // blank or dolby +#if VDRVERSNUM < 10318 pGraLib->Char(xPos, yPos, pLCDDevice->SizeX()-1, ch->Dpid1() ?'D':' ', symbols, colorBlack, colorWhite); yPos += symbols->HeightC(ch->Dpid1() ?'D':' ')+SYMBOL_SPACE; +#else + pGraLib->Char(xPos, yPos, pLCDDevice->SizeX()-1, ch->Dpid(0) ?'D':' ', symbols, colorBlack, colorWhite); + yPos += symbols->HeightC(ch->Dpid(0) ?'D':' ')+SYMBOL_SPACE; +#endif // blank or teletext pGraLib->Char(xPos, yPos, pLCDDevice->SizeX()-1, ch->Tpid() ?'T':' ', symbols, colorBlack, colorWhite); @@ -1536,14 +1591,26 @@ if(iVolume == 0) { pGraLib->Char(xPos, yPos, pLCDDevice->SizeX()-1, 'M', symbols, colorBlack, colorWhite); yPos += symbols->HeightC('S')+SYMBOL_SPACE; +#if VDRVERSNUM < 10318 } else if(ch->Apid2() && ch->Dpid1()) { +#else + } else if(ch->Apid(1) && ch->Dpid(0)) { +#endif // if Apid2 and Dpid1 are set then use combined symbol pGraLib->Char(xPos, yPos, pLCDDevice->SizeX()-1, 'B', symbols, colorBlack, colorWhite); yPos += symbols->HeightC('B')+SYMBOL_SPACE; +#if VDRVERSNUM < 10318 } else if(ch->Apid2()) { +#else + } else if(ch->Apid(1)) { +#endif pGraLib->Char(xPos, yPos, pLCDDevice->SizeX()-1, 'A', symbols, colorBlack, colorWhite); yPos += symbols->HeightC('A')+SYMBOL_SPACE; +#if VDRVERSNUM < 10318 } else if(ch->Dpid1()) { +#else + } else if(ch->Dpid(0)) { +#endif pGraLib->Char(xPos, yPos, pLCDDevice->SizeX()-1, 'D', symbols, colorBlack, colorWhite); yPos += symbols->HeightC('D')+SYMBOL_SPACE; } else { @@ -1586,8 +1653,13 @@ xPos -= symbols->WidthC(ch->Tpid() ?'T':' ')+SYMBOL_SPACE; // blank or dolby +#if VDRVERSNUM < 10318 pGraLib->Char(xPos, yPos, pLCDDevice->SizeX()-1, ch->Dpid1()?'D':' ', symbols, colorBlack, colorWhite); xPos -= symbols->WidthC(ch->Dpid1()?'D':' ')+SYMBOL_SPACE; +#else + pGraLib->Char(xPos, yPos, pLCDDevice->SizeX()-1, ch->Dpid(0)?'D':' ', symbols, colorBlack, colorWhite); + xPos -= symbols->WidthC(ch->Dpid(0)?'D':' ')+SYMBOL_SPACE; +#endif if(pLCDDevice->SizeY() > MAXY_M) { // with 128 pixel width only 3 symbols... // blank or crypt @@ -1599,7 +1671,11 @@ if (iVolume == 0) { pGraLib->Char(xPos, yPos, pLCDDevice->SizeX()-1, 'M', symbols, colorBlack, colorWhite); xPos -= symbols->WidthC('S')+SYMBOL_SPACE; +#if VDRVERSNUM < 10318 } else if (ch->Apid2()) { +#else + } else if (ch->Apid(1)) { +#endif pGraLib->Char(xPos, yPos, pLCDDevice->SizeX()-1, 'A', symbols, colorBlack, colorWhite); xPos -= symbols->WidthC('A')+SYMBOL_SPACE; } else { @@ -1622,13 +1698,21 @@ } // dolby +#if VDRVERSNUM < 10318 if(ch->Dpid1()) { +#else + if(ch->Dpid(0)) { +#endif xPos -= symbols->WidthC('D')+SYMBOL_SPACE; pGraLib->Char(xPos, yPos, pLCDDevice->SizeX()-1, 'D', symbols, colorBlack, colorWhite); } // 2chan +#if VDRVERSNUM < 10318 if(ch->Apid2()) { +#else + if(ch->Apid(1)) { +#endif xPos -= symbols->WidthC('A')+SYMBOL_SPACE; pGraLib->Char(xPos, yPos, pLCDDevice->SizeX()-1, 'A', symbols, colorBlack, colorWhite); } @@ -2283,7 +2367,11 @@ if (GraphLCDSetup.ShowVolume) { if (iLastVolChange > 0) { +#if VDRVERSNUM < 10318 if (time_ms() - iLastVolChange < 2000) { +#else + if (timeMs.Elapsed() - iLastVolChange < 2000) { +#endif RecH = (pLCDDevice->SizeY() / 5) + 2 * FRAME_SPACE_YB + 4 * FRAME_SPACE_YB; RecW = pLCDDevice->SizeX() / 2; pGraLib->RoundRectangle((pLCDDevice->SizeX()-RecW)/2, // draw frame --- graphlcd-0.1.1/display.h 2004-04-27 21:14:08.000000000 +0200 +++ graphlcd-0.1.1/display.h 2005-02-12 03:11:48.000000000 +0100 @@ -42,6 +42,7 @@ #include #include +#include #define LCDMAXCARDS 4 @@ -97,6 +98,9 @@ ThreadState State; ThreadState LastState; +#if VDRVERSNUM >= 10318 + cTimeMs timeMs; +#endif time_t CurrTime, LastTime, LastTimeCheckSym, --- graphlcd-0.1.1/widgets.c 2004-04-06 19:06:38.000000000 +0200 +++ graphlcd-0.1.1/widgets.c 2005-02-12 03:09:00.000000000 +0100 @@ -25,7 +25,11 @@ bool cScroller::NeedsUpdate() { if (active && +#if VDRVERSNUM < 10318 time_ms() - lastUpdate > GraphLCDSetup.ScrollTime) +#else + (int)timeMs.Elapsed() - lastUpdate > GraphLCDSetup.ScrollTime) +#endif { update = true; return true; @@ -48,7 +52,11 @@ else active = false; update = false; +#if VDRVERSNUM < 10318 lastUpdate = time_ms() + 2000; +#else + lastUpdate = timeMs.Elapsed() + 2000; +#endif } void cScroller::Draw(cGraphLCDGraphLib * lib) @@ -81,7 +89,11 @@ } } position += increment; +#if VDRVERSNUM < 10318 lastUpdate = time_ms(); +#else + lastUpdate = timeMs.Elapsed(); +#endif update = false; } lib->Text(x, y, xmax, text, font, true, colorBlack, colorWhite, position); --- graphlcd-0.1.1/widgets.h 2004-04-06 15:18:09.000000000 +0200 +++ graphlcd-0.1.1/widgets.h 2005-02-12 03:13:04.000000000 +0100 @@ -34,6 +34,9 @@ #include "font.h" #include "graphlib.h" +#include +#include + class cScroller { private: @@ -47,6 +50,9 @@ int position; int increment; time_t lastUpdate; +#if VDRVERSNUM >= 10318 + cTimeMs timeMs; +#endif public: cScroller(); const string & Text() const { return text; }