From a616d4b8597cfb69af7a8f0e0a96da2143970ffe Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 12 Jun 2005 18:00:00 +0200 Subject: =?UTF-8?q?Version=201.3.26=20-=20Updated=20the=20Estonian=20OSD?= =?UTF-8?q?=20texts=20(thanks=20to=20Arthur=20Konovalov).=20-=20Updated=20?= =?UTF-8?q?the=20Finnish=20OSD=20texts=20(thanks=20to=20Rolf=20Ahrenberg).?= =?UTF-8?q?=20-=20Fixed=20handling=20'summary.vdr'=20files=20with=20more?= =?UTF-8?q?=20than=20two=20empty=20lines=20(thanks=20to=20=20=20Christian?= =?UTF-8?q?=20Jacobsen=20for=20reporting=20this=20one).=20-=20Improved=20r?= =?UTF-8?q?esetting=20CAM=20connections=20(thanks=20to=20Marco=20Schl?= =?UTF-8?q?=C3=BC=C3=9Fler).=20-=20Implemented=20cVideoRepacker=20in=20rem?= =?UTF-8?q?ux.c=20to=20make=20sure=20every=20PES=20packet=20contains=20=20?= =?UTF-8?q?=20only=20data=20from=20one=20frame=20(thanks=20to=20Reinhard?= =?UTF-8?q?=20Nissl).=20=20=20NOTE:=20currently=20this=20doesn't=20work=20?= =?UTF-8?q?with=20MPEG1,=20so=20if=20you=20use=20MPEG1=20you=20may=20want?= =?UTF-8?q?=20=20=20to=20change=20line=201158=20in=20remux.c=20to?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ts2pes[numTracks++] = new cTS2PES(VPid, resultBuffer, IPACKS); as it was before. - EPG events without a title now display "No title" instead of "(null)" (thanks to Rolf Ahrenberg). - A device can now detach all receivers for a given PID, as is necessary, e.g., for the bitstreamout plugin (thanks to Werner Fink). - Added the year (two digits) to recording dates in LSTR, and thus also in menus (suggested by Jan Ekholm). - Fixed the call to Channels.Unlock() in cEITScanner::Process() (thanks to Reinhard Nissl). - Fixed handling timers with a day given as MTWTF--@6, i.e. a repeating timer with first day not as full date, but just day of month (thanks to Henrik Niehaus for reporting this one). - Removed an unnecessary #include from osd.c (thanks to Wolfgang Rohdewald). - Fixed dropping EPG events that have a zero start time or duration, in case it's an NVOD event (thanks to Chris Warren). - Fixed handling page up/down in menu lists in case there are several non selectable items in a row (thanks to Udo Richter for reporting this one). - Added cOsdMenu::SetCols() to allow adjusting the menu columns. - Modified cEITScanner::Process() so that it works on systems with only budget cards or a mix of DVB-S, DVB-C or DVB-T cards. --- osdbase.c | 82 +++++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 59 insertions(+), 23 deletions(-) (limited to 'osdbase.c') diff --git a/osdbase.c b/osdbase.c index ec04adb..7d03dbd 100644 --- a/osdbase.c +++ b/osdbase.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: osdbase.c 1.15 2005/01/07 16:16:41 kls Exp $ + * $Id: osdbase.c 1.17 2005/06/12 10:44:22 kls Exp $ */ #include "osdbase.h" @@ -74,11 +74,7 @@ cOsdMenu::cOsdMenu(const char *Title, int c0, int c1, int c2, int c3, int c4) hasHotkeys = false; title = NULL; SetTitle(Title); - cols[0] = c0; - cols[1] = c1; - cols[2] = c2; - cols[3] = c3; - cols[4] = c4; + SetCols(c0, c1, c2, c3, c4); first = 0; current = marked = -1; subMenu = NULL; @@ -116,6 +112,15 @@ const char *cOsdMenu::hk(const char *s) return s; } +void cOsdMenu::SetCols(int c0, int c1, int c2, int c3, int c4) +{ + cols[0] = c0; + cols[1] = c1; + cols[2] = c2; + cols[3] = c3; + cols[4] = c4; +} + void cOsdMenu::SetHasHotkeys(void) { hasHotkeys = true; @@ -258,7 +263,8 @@ void cOsdMenu::CursorUp(void) { if (current > 0) { int tmpCurrent = current; - while (--tmpCurrent >= 0 && !SelectableItem(tmpCurrent)); + while (--tmpCurrent >= 0 && !SelectableItem(tmpCurrent)) + ; if (tmpCurrent < 0) return; if (tmpCurrent >= first) @@ -282,7 +288,8 @@ void cOsdMenu::CursorDown(void) if (current < last) { int tmpCurrent = current; - while (++tmpCurrent <= last && !SelectableItem(tmpCurrent)); + while (++tmpCurrent <= last && !SelectableItem(tmpCurrent)) + ; if (tmpCurrent > last) return; if (tmpCurrent <= lastOnScreen) @@ -306,33 +313,62 @@ void cOsdMenu::CursorDown(void) void cOsdMenu::PageUp(void) { + int oldCurrent = current; + int oldFirst = first; current -= displayMenuItems; first -= displayMenuItems; + int last = Count() - 1; + if (current < 0) + current = 0; if (first < 0) - first = current = 0; - if (!SelectableItem(current)) { - current -= (current > 0) ? 1 : -1; - first = min(first, current - 1); + first = 0; + int tmpCurrent = current; + while (!SelectableItem(tmpCurrent) && --tmpCurrent >= 0) + ; + if (tmpCurrent < 0) { + tmpCurrent = current; + while (++tmpCurrent <= last && !SelectableItem(tmpCurrent)) + ; + } + current = tmpCurrent <= last ? tmpCurrent : -1; + if (current >= 0) { + if (current < first) + first = current; + else if (current - first >= displayMenuItems) + first = current - displayMenuItems + 1; + } + if (current != oldCurrent || first != oldFirst) { + Display(); + DisplayCurrent(true); } - Display(); - DisplayCurrent(true); } void cOsdMenu::PageDown(void) { + int oldCurrent = current; + int oldFirst = first; current += displayMenuItems; first += displayMenuItems; - int count = Count(); - if (current > count - 1) { - current = count - 1; - first = max(0, count - displayMenuItems); + int last = Count() - 1; + int tmpCurrent = current; + while (!SelectableItem(tmpCurrent) && ++tmpCurrent <= last) + ; + if (tmpCurrent > last) { + tmpCurrent = current; + while (--tmpCurrent >= 0 && !SelectableItem(tmpCurrent)) + ; } - if (!SelectableItem(current)) { - current += (current < count - 1) ? 1 : -1; - first = max(first, current - displayMenuItems); + current = tmpCurrent > 0 ? tmpCurrent : -1; + if (current >= 0) { + if (current < first) + first = current; + else if (current - first >= displayMenuItems) + first = current - displayMenuItems + 1; + } + if (current != oldCurrent || first != oldFirst) { + Display(); + DisplayCurrent(true); } - Display(); - DisplayCurrent(true); } void cOsdMenu::Mark(void) -- cgit v1.2.3