From patchwork Fri Feb 18 18:42:37 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anssi Kolehmainen X-Patchwork-Id: 11785 Received: from fep19.inet.fi ([194.251.242.244]) by www.linuxtv.org with esmtp (Exim 4.34) id 1D2D5K-0002o8-2l for vdr@linuxtv.org; Fri, 18 Feb 2005 19:42:38 +0100 Received: from ampere.aketzu.iki.fi ([80.221.27.174]) by fep19.inet.fi with ESMTP id <20050218184238.MUOQ15275.fep19.inet.fi@ampere.aketzu.iki.fi> for ; Fri, 18 Feb 2005 20:42:38 +0200 Received: from [80.221.27.174] (hki1-3-4-ae.hoasnet.inet.fi [80.221.27.174]) by ampere.aketzu.iki.fi (Postfix) with ESMTP id 316F932803A for ; Fri, 18 Feb 2005 20:42:38 +0200 (EET) Message-ID: <4216371D.7010900@aketzu.iki.fi> Date: Fri, 18 Feb 2005 20:42:37 +0200 From: Anssi Kolehmainen User-Agent: Debian Thunderbird 1.0 (X11/20050116) X-Accept-Language: en-us, en MIME-Version: 1.0 To: vdr@linuxtv.org X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Subject: [vdr] Patch for yaepg-0.0.2 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Feb 2005 18:42:38 -0000 Status: O X-Status: X-Keywords: X-UID: 169 Hi, In YLE channels (in Finland) there are gaps between programs (in EPG-data) and yaepg draws only first program and then 'No Info' bar even when there are more programs. Attached is a small patch for yaepg-0.0.2 which adds code to search for next program. It also changes granularity for text box drawing from 5 minutes to 1 minute because YLE has some 4:30min programs (which are drawn as thin lines if granularity is 5min). Finally it changes font from fontYaepg to fontSml which looks much better with my Nova-T and xine-lib. Anssi Kolehmainen diff -u yaepg-0.0.2-original/yaepg.c yaepg-0.0.2-nullspace/yaepg.c --- yaepg-0.0.2-original/yaepg.c 2004-11-08 03:41:20.000000000 +0200 +++ yaepg-0.0.2-nullspace/yaepg.c 2005-02-18 20:28:55.000000000 +0200 @@ -16,12 +16,12 @@ static const tColor highlight = (tColor) 0xFF505050; static const tColor lightgrey = (tColor) 0xFFAAAAAA; -#define fontChanBox fontYaepg -#define fontTimeBox fontYaepg -#define fontEventBox fontYaepg -#define fontInfoBox fontYaepg -#define fontDateBox fontYaepg -#define fontTitleBox fontYaepg +#define fontChanBox fontSml +#define fontTimeBox fontSml +#define fontEventBox fontSml +#define fontInfoBox fontSml +#define fontDateBox fontSml +#define fontTitleBox fontSml /* * Lots of hard-coding here based on the font size. Should be made more dynamic @@ -33,7 +33,7 @@ #define TBOX_DEF_XALIGN TBOX_TXT_CENTER #define TBOX_DEF_YSPACING 0 -#define TBOX_TXT_HEIGHT 20 +#define TBOX_TXT_HEIGHT 21 #define TBOX_TXT_LEFT 0 #define TBOX_TXT_CENTER 1 #define TBOX_TXT_RIGHT 2 @@ -615,8 +615,8 @@ * We use 5 minute granularity for an event's width. We subtract two * pixels for the border. */ - if (tLen >= 300) { - w = (tLen / 300) * 24 -2; + if (tLen >= 60) { + w = (tLen / 60) * 5 -2; } else { w = 4; @@ -627,7 +627,7 @@ * over one for the left side of the border. The right border is taken * care of above. */ - xOff = (((e->StartTime() - t) + iOutputResH / 2) / 300) * 24; + xOff = (((e->StartTime() - t) + iOutputResH / 2) / 60) * 5; if (xOff <= 0) { xOff = 1; } @@ -1456,7 +1456,7 @@ cSchedulesLock SchedulesLock; const cSchedules* Schedules = cSchedules::Schedules(SchedulesLock); cy = 22; - time_t grTime, t0 = mktime(&timebox[0]->tmTime); + time_t grTime, t0 = mktime(&timebox[0]->tmTime), nextEvent; const cSchedule *currSched; const cEvent *currEvent; for (i = 0; i < iChannelCount; i++) { @@ -1482,6 +1482,13 @@ else { currEvent = NULL; } + + //Try to find next event since some channels have empty time between programs + nextEvent=grTime; + while (currSched && currEvent==NULL && (nextEvent-grTime) < 60*60*2) { + nextEvent +=60*5; + currEvent = currSched->GetEventAround(nextEvent); + } if (currEvent == NULL) { /*