From 46c882c04d5200cc97262b15db2e4841b305664d Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 26 Aug 2007 18:00:00 +0200 Subject: =?UTF-8?q?Version=201.5.9=20-=20Fixed=20handling=20locale=20direc?= =?UTF-8?q?tories=20with=20a=20large=20number=20of=20entries=20(thanks=20t?= =?UTF-8?q?o=20=20=20Anssi=20Hannula).=20-=20Updated=20Turkish=20language?= =?UTF-8?q?=20texts=20(thanks=20to=20Oktay=20Yolge=C3=A7en).=20-=20Fixed?= =?UTF-8?q?=20stripping=20the=20context=20in=20I18nTranslate()=20(reported?= =?UTF-8?q?=20by=20Christian=20=20=20Wieninger).=20-=20Fixed=20detecting?= =?UTF-8?q?=20whether=20a=20particular=20locale=20is=20actually=20supporte?= =?UTF-8?q?d.=20-=20Added=20a=20note=20about=20LANG=20having=20to=20be=20s?= =?UTF-8?q?et=20to=20a=20valid=20locale=20in=20INSTALL=20=20=20(suggested?= =?UTF-8?q?=20by=20Matthias=20Fechner).=20-=20Fixed=20some=20compiler=20wa?= =?UTF-8?q?rnings=20with=20gcc-4.2.0=20(thanks=20to=20Matthias=20Schwarzot?= =?UTF-8?q?t).=20-=20Fixed=20setting=20the=20locale=20file=20name=20in=20i?= =?UTF-8?q?18n-to-gettext.pl=20(thanks=20to=20Matthias=20=20=20Schwarzott)?= =?UTF-8?q?.=20-=20Changed=20the=20default=20for=20LOCDIR=20in=20Makefile?= =?UTF-8?q?=20and=20Make.config.template=20to=20=20=20"./locale",=20so=20t?= =?UTF-8?q?hat=20internationalization=20works=20by=20default=20when=20runn?= =?UTF-8?q?ing=20VDR=20=20=20from=20within=20its=20source=20directory=20(s?= =?UTF-8?q?uggested=20by=20Anssi=20Hannula).=20-=20Added=20the=20new=20i18?= =?UTF-8?q?n=20macro=20trVDR(),=20which=20can=20be=20used=20by=20plugins?= =?UTF-8?q?=20to=20mark=20=20=20texts=20they=20want=20to=20reuse=20from=20?= =?UTF-8?q?VDR's=20core=20translations=20(suggested=20by=20Matthias=20=20?= =?UTF-8?q?=20Becker).=20-=20VDR=20now=20uses=20the=20default=20configurat?= =?UTF-8?q?ion=20directory=20as=20defined=20in=20the=20CONFDIR=20=20=20var?= =?UTF-8?q?able=20in=20the=20Makefile=20(thanks=20to=20Thomas=20Schmidt).?= =?UTF-8?q?=20-=20The=20SVDRP=20command=20LSTC=20can=20now=20list=20the=20?= =?UTF-8?q?channels=20with=20group=20separators=20if=20the=20=20=20option?= =?UTF-8?q?=20':groups'=20is=20given=20(thanks=20to=20Andreas=20Mair).=20-?= =?UTF-8?q?=20Added=20a=20missing=20error=20report=20to=20cCuttingThread::?= =?UTF-8?q?Action()=20(thanks=20to=20Udo=20=20=20Richter).=20-=20There=20c?= =?UTF-8?q?an=20now=20be=20more=20than=20one=20OSD=20at=20the=20same=20tim?= =?UTF-8?q?e.=20At=20any=20given=20time,=20=20=20however,=20only=20one=20o?= =?UTF-8?q?f=20them=20can=20be=20active=20(and=20thus=20visible).=20This?= =?UTF-8?q?=20is=20to=20=20=20allow=20displaying=20things=20like=20subtitl?= =?UTF-8?q?es=20in=20an=20easy=20way.=20A=20cOsd=20therefore=20=20=20now?= =?UTF-8?q?=20has=20a=20"Level",=20and=20only=20the=20OSD=20with=20the=20s?= =?UTF-8?q?mallest=20level=20will=20be=20=20=20displayed.=20The=20level=20?= =?UTF-8?q?0=20OSD=20is=20special,=20and=20there=20can=20only=20be=20one?= =?UTF-8?q?=20with=20=20=20this=20level.=20If=20there=20is=20more=20than?= =?UTF-8?q?=20one=20OSD=20with=20a=20particular=20level,=20only=20=20=20th?= =?UTF-8?q?e=20one=20that=20was=20created=20first=20will=20be=20displayed.?= =?UTF-8?q?=20=20=20Plugins=20that=20provide=20an=20OSD=20need=20to=20adju?= =?UTF-8?q?st=20their=20cOsdProvider::CreateOsd()=20=20=20function=20to=20?= =?UTF-8?q?hand=20through=20the=20Level.=20-=20Fixed=20checking=20for=20tt?= =?UTF-8?q?DolbyLast=20in=20cDevice::SetCurrentAudioTrack()=20(thanks=20?= =?UTF-8?q?=20=20to=20Marco=20Schl=C3=BC=C3=9Fler).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTORS | 20 +++++++++++++- HISTORY | 37 +++++++++++++++++++++++++ INSTALL | 3 ++ Make.config.template | 6 ++-- Makefile | 5 ++-- PLUGINS.html | 37 ++++++++++++------------- config.h | 10 +++---- cutter.c | 6 ++-- device.c | 4 +-- dvbosd.c | 60 +++++++++++++++++++++++++++------------- dvbosd.h | 4 +-- i18n-to-gettext.pl | 4 +-- i18n.c | 45 +++++++++++++++--------------- i18n.h | 3 +- keys.h | 4 +-- menu.c | 4 +-- osd.c | 45 ++++++++++++++++++++++-------- osd.h | 24 ++++++++++++---- po/tr_TR.po | 78 ++++++++++++++++++++++++++-------------------------- rcu.c | 4 +-- rcu.h | 4 +-- svdrp.c | 15 ++++++---- thread.c | 4 +-- tools.h | 8 +++++- vdr.c | 4 +-- 25 files changed, 282 insertions(+), 156 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 68abd99..bddbeed 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -541,6 +541,7 @@ Tomas Prybil Matthias Fechner for pointing out a bug in parsing 'E' records in epg2html.pl + for suggesting to add a note about LANG having to be set to a valid locale in INSTALL Paul Lacatus for translating OSD texts to the Romanian language @@ -943,6 +944,8 @@ Andreas Mair for enabling fonts to be created with a width that overwrites the default width for suggesting to make cBitmap::SetXpm() checks whether the given Xpm pointer is not NULL + for making the SVDRP command LSTC list the channels with group separators if the + option ':groups' is given Olivier Jacques ) for translating OSD texts to the French language @@ -1056,9 +1059,11 @@ Jon Burgess for reporting a bug in handling the '.update' file in case the video directory is not at the default location -Thomas Schmidt +Thomas Schmidt for reporting a crash when canceling a newly created timer for making 'diseqc.conf' a required file only if Setup.DiSEqC is activated + for making VDR use the default configuration directory as defined in the CONFDIR + varable in the Makefile Michael Walle for reporting a bug in channel switching after Left/Right has been pressed @@ -1413,6 +1418,7 @@ Marco Schl for reporting a missing 'P' in vdr.c's SHUTDOWNCANCELROMPT macro for fixing a problem with characters >0x7F in the modified version of skipspace() for reporting a faulty comment in Make.config.template + for fixing checking for ttDolbyLast in cDevice::SetCurrentAudioTrack() Jürgen Schmitz for reporting a bug in displaying the current channel when switching via the SVDRP @@ -1515,6 +1521,7 @@ Udo Richter for fixing handling detached processes in SystemExec() for fixing handling single byte characters >0x7F in Utf8ToArray() for fixing clearing color buttons in the 'curses' skin + for adding a missing error report to cCuttingThread::Action() Sven Kreiensen for his help in keeping 'channels.conf.terr' up to date @@ -1870,6 +1877,7 @@ Christian Wieninger for reporting a problem with a format string in recording.c on 64bit systems for reporting a problem with the device selection in case of timer conflicts for a patch that fixed part of a crash in i18n character set conversion + for reporting a bug in stripping the context in I18nTranslate() Thiemo Gehrke for suggesting to add a setup option to turn off the automatic timeout of the @@ -2062,6 +2070,10 @@ Anssi Hannula for suggesting to make the "Setup/OSD/Language" menu only show those languages that actually have a locale for suggesting to use setenv() instead of setlocale() to set the language for gettext() + for fixing handling locale directories with a large number of entries + for suggesting to change the default for LOCDIR in Makefile and Make.config.template + to "./locale", so that internationalization works by default when running VDR + from within its source directory Antti Hartikainen for updating 'S13E' in 'sources.conf' @@ -2098,6 +2110,8 @@ Matthias Schwarzott for suggesting to move the "all" target in plugin Makefiles before the "Implicit rules", so that a plain "make" will compile everything for adding DESTDIR and PREFIX handling to the Makefile + for fixing some compiler warnings with gcc-4.2.0 + for fixing setting the locale file name in i18n-to-gettext.pl Martin Ostermann for fixing processing the PDCDescriptor in 'libsi' on big endian systems @@ -2151,3 +2165,7 @@ Tobias Bratfisch Bruno Roussel for translating OSD texts to the French language + +Matthias Becker + for suggesting to add a new i18n macro that can be used by plugins to mark + texts they want to reuse from VDR's core translations diff --git a/HISTORY b/HISTORY index 0677dbc..c89b218 100644 --- a/HISTORY +++ b/HISTORY @@ -5379,3 +5379,40 @@ Video Disk Recorder Revision History vdr.mo. Text files for plugins are now named "vdr-name.mo", when "name" is the name of the plugin. The "newplugin" script has been changed accordingly, and plugin authors should change their Makefiles, too. + +2007-08-26: Version 1.5.9 + +- Fixed handling locale directories with a large number of entries (thanks to + Anssi Hannula). +- Updated Turkish language texts (thanks to Oktay Yolgeçen). +- Fixed stripping the context in I18nTranslate() (reported by Christian + Wieninger). +- Fixed detecting whether a particular locale is actually supported. +- Added a note about LANG having to be set to a valid locale in INSTALL + (suggested by Matthias Fechner). +- Fixed some compiler warnings with gcc-4.2.0 (thanks to Matthias Schwarzott). +- Fixed setting the locale file name in i18n-to-gettext.pl (thanks to Matthias + Schwarzott). +- Changed the default for LOCDIR in Makefile and Make.config.template to + "./locale", so that internationalization works by default when running VDR + from within its source directory (suggested by Anssi Hannula). +- Added the new i18n macro trVDR(), which can be used by plugins to mark + texts they want to reuse from VDR's core translations (suggested by Matthias + Becker). +- VDR now uses the default configuration directory as defined in the CONFDIR + varable in the Makefile (thanks to Thomas Schmidt). +- The SVDRP command LSTC can now list the channels with group separators if the + option ':groups' is given (thanks to Andreas Mair). +- Added a missing error report to cCuttingThread::Action() (thanks to Udo + Richter). +- There can now be more than one OSD at the same time. At any given time, + however, only one of them can be active (and thus visible). This is to + allow displaying things like subtitles in an easy way. A cOsd therefore + now has a "Level", and only the OSD with the smallest level will be + displayed. The level 0 OSD is special, and there can only be one with + this level. If there is more than one OSD with a particular level, only + the one that was created first will be displayed. + Plugins that provide an OSD need to adjust their cOsdProvider::CreateOsd() + function to hand through the Level. +- Fixed checking for ttDolbyLast in cDevice::SetCurrentAudioTrack() (thanks + to Marco Schlüßler). diff --git a/INSTALL b/INSTALL index cbef729..a26e43b 100644 --- a/INSTALL +++ b/INSTALL @@ -113,6 +113,9 @@ in the log file, it is sufficient to just set which only influences the way strings are sorted and leaves error messages in English. +Note that for VDR's internationalized texts to work, the LANG environment +variable must be set to a valid locale! + Automatic restart in case of hangups: ------------------------------------- diff --git a/Make.config.template b/Make.config.template index 86564a2..a4b4812 100644 --- a/Make.config.template +++ b/Make.config.template @@ -6,7 +6,7 @@ # See the main source file 'vdr.c' for copyright information and # how to reach the author. # -# $Id: Make.config.template 1.13 2007/08/12 20:43:46 kls Exp $ +# $Id: Make.config.template 1.15 2007/08/25 08:53:45 kls Exp $ ### The C compiler and options: @@ -26,12 +26,12 @@ endif #DVBDIR = /usr/src/v4l-dvb/linux MANDIR = /usr/local/man BINDIR = /usr/local/bin -# set to ./locale to run VDR from within its source directory: -LOCDIR = /usr/share/vdr/locale +LOCDIR = ./locale PLUGINDIR= ./PLUGINS PLUGINLIBDIR= $(PLUGINDIR)/lib VIDEODIR = /video +CONFDIR = $(VIDEODIR) ### The remote control: diff --git a/Makefile b/Makefile index a46aaef..294ca78 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # See the main source file 'vdr.c' for copyright information and # how to reach the author. # -# $Id: Makefile 1.104 2007/08/15 13:47:16 kls Exp $ +# $Id: Makefile 1.106 2007/08/25 08:52:17 kls Exp $ .DELETE_ON_ERROR: @@ -19,7 +19,7 @@ DESTDIR ?= PREFIX ?= /usr/local MANDIR = $(PREFIX)/share/man BINDIR = $(PREFIX)/bin -LOCDIR = $(PREFIX)/share/vdr/locale +LOCDIR = ./locale LIBS = -ljpeg -lpthread -ldl -lcap -lfreetype -lfontconfig INCLUDES = -I/usr/include/freetype2 @@ -61,6 +61,7 @@ DEFINES += -DLIRC_DEVICE=\"$(LIRC_DEVICE)\" -DRCU_DEVICE=\"$(RCU_DEVICE)\" DEFINES += -D_GNU_SOURCE DEFINES += -DVIDEODIR=\"$(VIDEODIR)\" +DEFINES += -DCONFDIR=\"$(CONFDIR)\" DEFINES += -DPLUGINDIR=\"$(PLUGINLIBDIR)\" DEFINES += -DLOCDIR=\"$(LOCDIR)\" diff --git a/PLUGINS.html b/PLUGINS.html index d18bc42..0b0b495 100644 --- a/PLUGINS.html +++ b/PLUGINS.html @@ -6,7 +6,7 @@

The VDR Plugin System

-
Version 1.5.3
+
Version 1.5.8

Copyright © 2006 Klaus Schmidinger
@@ -14,18 +14,18 @@ Copyright © 2006 Klaus Schmidinger
www.cadsoft.de/vdr

-
  -Important modifications introduced in version 1.5.0 are marked like this. -
-
  +
  Important modifications introduced in version 1.5.1 are marked like this.
-
  +
  Important modifications introduced in version 1.5.3 are marked like this.
-
  +
  Important modifications introduced in version 1.5.7 are marked like this.
+
  +Important modifications introduced in version 1.5.8 are marked like this. +

VDR provides an easy to use plugin interface that allows additional functionality to be added to the program by implementing a dynamically loadable library file. @@ -64,7 +64,7 @@ structures and allows it to hook itself into specific areas to perform special a

  • Housekeeping
  • Main thread hook
  • Activity -
      +
     
  • Wakeup
  • Setup parameters @@ -88,9 +88,7 @@ structures and allows it to hook itself into specific areas to perform special a
  • Devices
  • Audio
  • Remote Control -
     
  • Conditional Access -
  • @@ -687,7 +685,7 @@ be queried, and further prompts may show up. If all prompts have been confirmed, the shutdown will take place. As soon as one prompt is not confirmed, no further plugins will be queried and no shutdown will be done. -
      +
     

    Wakeup

    Wake me up before you go-go

    @@ -912,7 +910,7 @@ const char *MyConfigDir = cPlugin::ConfigDirectory();

    Welcome to Babylon!

    -
      +
      If a plugin displays texts to the user, it should prepare for internationalization of these texts. All that is necessary for this is to mark every text that is presented to the user as translatable, as in @@ -923,9 +921,12 @@ const char *s = tr("Hello world!"); The text given here must be the English version, and the returned pointer is either a translated version (if available) or the original string. -Texts are first searched for in the domain registered for this plugin (if any) -and then in the global VDR texts. So a plugin can make use of texts defined by the -core VDR code. +
      +Texts are searched for in the domain registered for this plugin. +If a plugin wants to make use of texts defined by the core VDR code, it can use +the special trVDR() macro to mark these texts without having them +appear in its own translation file. +

    Sometimes texts are stored in an array, in which case they need to be marked differently, using the trNOOP() macro. The actual translation is then done @@ -943,7 +944,7 @@ for (int i = 0; i < 3; i++)

    -
      +
      The system VDR is running on may use a character encoding where a single character (or symbol) consists of more than one byte (UTF-8, as opposed to, for instance, ISO8859-1, where every character is represented by a single byte in memory). @@ -1605,7 +1606,7 @@ with the full required resolution. Only if this fails shall it use alternate areas. Drawing areas are always rectangular and may not overlap (but do not need to be adjacent).

    -
      +
      Special consideration may have to be given to color usage if the OSD provides 8bpp (256 colors). In that case, fonts may be drawn using anti-aliasing, which requires several blended color values between the foreground and background @@ -2088,7 +2089,6 @@ Put(uint64 Code, bool Repeat = false, bool Release = false); The other parameters have the same meaning as in the first version of this function. -
     

    Conditional Access

    Members only!

    @@ -2123,7 +2123,6 @@ virtual bool Assign(cDevice *Device, bool Query = false);

    See the description of this function in ci.h for details. -

    diff --git a/config.h b/config.h index 5268853..a5efb9b 100644 --- a/config.h +++ b/config.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.h 1.297 2007/08/12 20:38:10 kls Exp $ + * $Id: config.h 1.298 2007/08/19 16:02:50 kls Exp $ */ #ifndef __CONFIG_H @@ -22,13 +22,13 @@ // VDR's own version number: -#define VDRVERSION "1.5.8" -#define VDRVERSNUM 10508 // Version * 10000 + Major * 100 + Minor +#define VDRVERSION "1.5.9" +#define VDRVERSNUM 10509 // Version * 10000 + Major * 100 + Minor // The plugin API's version number: -#define APIVERSION "1.5.8" -#define APIVERSNUM 10508 // Version * 10000 + Major * 100 + Minor +#define APIVERSION "1.5.9" +#define APIVERSNUM 10509 // Version * 10000 + Major * 100 + Minor // When loading plugins, VDR searches them by their APIVERSION, which // may be smaller than VDRVERSION in case there have been no changes to diff --git a/cutter.c b/cutter.c index 5170ae4..b596f3f 100644 --- a/cutter.c +++ b/cutter.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: cutter.c 1.16 2006/07/30 10:22:08 kls Exp $ + * $Id: cutter.c 1.17 2007/08/25 10:33:18 kls Exp $ */ #include "cutter.h" @@ -110,8 +110,10 @@ void cCuttingThread::Action(void) break; } } - else + else { + error = "index"; break; + } // Write one frame: diff --git a/device.c b/device.c index ae9e15e..e23b74b 100644 --- a/device.c +++ b/device.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.c 1.141 2007/06/16 09:31:32 kls Exp $ + * $Id: device.c 1.142 2007/08/26 11:11:42 kls Exp $ */ #include "device.h" @@ -892,7 +892,7 @@ int cDevice::NumAudioTracks(void) const bool cDevice::SetCurrentAudioTrack(eTrackType Type) { - if (ttNone < Type && Type < ttDolbyLast) { + if (ttNone < Type && Type <= ttDolbyLast) { cMutexLock MutexLock(&mutexCurrentAudioTrack); if (IS_DOLBY_TRACK(Type)) SetDigitalAudioDevice(true); diff --git a/dvbosd.c b/dvbosd.c index 469ef1f..87c8dec 100644 --- a/dvbosd.c +++ b/dvbosd.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbosd.c 1.30 2006/01/28 14:24:04 kls Exp $ + * $Id: dvbosd.c 1.31 2007/08/26 09:39:20 kls Exp $ */ #include "dvbosd.h" @@ -26,15 +26,17 @@ private: int osdMem; bool shown; void Cmd(OSD_Command cmd, int color = 0, int x0 = 0, int y0 = 0, int x1 = 0, int y1 = 0, const void *data = NULL); +protected: + virtual void SetActive(bool On); public: - cDvbOsd(int Left, int Top, int OsdDev); + cDvbOsd(int Left, int Top, int OsdDev, uint Level); virtual ~cDvbOsd(); virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas); virtual void Flush(void); }; -cDvbOsd::cDvbOsd(int Left, int Top, int OsdDev) -:cOsd(Left, Top) +cDvbOsd::cDvbOsd(int Left, int Top, int OsdDev, uint Level) +:cOsd(Left, Top, Level) { osdDev = OsdDev; shown = false; @@ -49,23 +51,36 @@ cDvbOsd::cDvbOsd(int Left, int Top, int OsdDev) if (ioctl(osdDev, OSD_GET_CAPABILITY, &cap) == 0) osdMem = cap.val; #endif - // must clear all windows here to avoid flashing effects - doesn't work if done - // in Flush() only for the windows that are actually used... - for (int i = 0; i < MAXNUMWINDOWS; i++) { - Cmd(OSD_SetWindow, 0, i + 1); - Cmd(OSD_Clear); - } } } cDvbOsd::~cDvbOsd() { - if (shown) { - cBitmap *Bitmap; - for (int i = 0; (Bitmap = GetBitmap(i)) != NULL; i++) { - Cmd(OSD_SetWindow, 0, i + 1); - Cmd(OSD_Close); - } + SetActive(false); +} + +void cDvbOsd::SetActive(bool On) +{ + if (On != Active()) { + cOsd::SetActive(On); + if (On) { + // must clear all windows here to avoid flashing effects - doesn't work if done + // in Flush() only for the windows that are actually used... + for (int i = 0; i < MAXNUMWINDOWS; i++) { + Cmd(OSD_SetWindow, 0, i + 1); + Cmd(OSD_Clear); + } + if (GetBitmap(0)) // only flush here if there are already bitmaps + Flush(); + } + else if (shown) { + cBitmap *Bitmap; + for (int i = 0; (Bitmap = GetBitmap(i)) != NULL; i++) { + Cmd(OSD_SetWindow, 0, i + 1); + Cmd(OSD_Close); + } + shown = false; + } } } @@ -108,13 +123,20 @@ void cDvbOsd::Cmd(OSD_Command cmd, int color, int x0, int y0, int x1, int y1, co void cDvbOsd::Flush(void) { + if (!Active()) + return; cBitmap *Bitmap; for (int i = 0; (Bitmap = GetBitmap(i)) != NULL; i++) { Cmd(OSD_SetWindow, 0, i + 1); if (!shown) Cmd(OSD_Open, Bitmap->Bpp(), Left() + Bitmap->X0(), Top() + Bitmap->Y0(), Left() + Bitmap->X0() + Bitmap->Width() - 1, Top() + Bitmap->Y0() + Bitmap->Height() - 1, (void *)1); // initially hidden! int x1 = 0, y1 = 0, x2 = 0, y2 = 0; - if (Bitmap->Dirty(x1, y1, x2, y2)) { + if (!shown || Bitmap->Dirty(x1, y1, x2, y2)) { + if (!shown) { + x1 = y1 = 0; + x2 = Bitmap->Width() - 1; + y2 = Bitmap->Height() - 1; + } //TODO Workaround: apparently the bitmap sent to the driver always has to be a multiple //TODO of 8 bits wide, and (dx * dy) also has to be a multiple of 8. //TODO Fix driver (should be able to handle any size bitmaps!) @@ -173,7 +195,7 @@ cDvbOsdProvider::cDvbOsdProvider(int OsdDev) osdDev = OsdDev; } -cOsd *cDvbOsdProvider::CreateOsd(int Left, int Top) +cOsd *cDvbOsdProvider::CreateOsd(int Left, int Top, uint Level) { - return new cDvbOsd(Left, Top, osdDev); + return new cDvbOsd(Left, Top, osdDev, Level); } diff --git a/dvbosd.h b/dvbosd.h index 752b9fa..ae8afb6 100644 --- a/dvbosd.h +++ b/dvbosd.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbosd.h 1.18 2004/06/12 13:09:52 kls Exp $ + * $Id: dvbosd.h 1.19 2007/08/25 13:49:34 kls Exp $ */ #ifndef __DVBOSD_H @@ -17,7 +17,7 @@ private: int osdDev; public: cDvbOsdProvider(int OsdDev); - virtual cOsd *CreateOsd(int Left, int Top); + virtual cOsd *CreateOsd(int Left, int Top, uint Level); }; #endif //__DVBOSD_H diff --git a/i18n-to-gettext.pl b/i18n-to-gettext.pl index 130122d..e46c644 100755 --- a/i18n-to-gettext.pl +++ b/i18n-to-gettext.pl @@ -10,7 +10,7 @@ # See the main source file 'vdr.c' for copyright information and # how to reach the author. # -# $Id: i18n-to-gettext.pl 1.3 2007/08/15 12:52:00 kls Exp $ +# $Id: i18n-to-gettext.pl 1.4 2007/08/24 13:19:34 kls Exp $ # How to convert an actual plugin: # @@ -323,7 +323,7 @@ i18n: $(I18Nmo) @mkdir -p $(LOCALEDIR) for i in $(I18Ndirs); do\ mkdir -p $(LOCALEDIR)/$$i/LC_MESSAGES;\ - cp $(PODIR)/$$i.mo $(LOCALEDIR)/$$i/LC_MESSAGES/$(PLUGIN).mo;\ + cp $(PODIR)/$$i.mo $(LOCALEDIR)/$$i/LC_MESSAGES/vdr-$(PLUGIN).mo;\ done }; diff --git a/i18n.c b/i18n.c index 15853a0..da699d9 100644 --- a/i18n.c +++ b/i18n.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: i18n.c 1.312 2007/08/19 14:10:46 kls Exp $ + * $Id: i18n.c 1.317 2007/08/24 14:03:47 kls Exp $ * * */ @@ -62,7 +62,7 @@ const char *LanguageCodeList[] = { NULL }; -static char *I18nLocaleDir = LOCDIR; +static const char *I18nLocaleDir = LOCDIR; static cStringList LanguageLocales; static cStringList LanguageNames; @@ -112,21 +112,24 @@ void I18nInitialize(void) for (int i = 0; i < Locales.Size(); i++) { cString FileName = cString::sprintf("%s/%s/LC_MESSAGES/vdr.mo", I18nLocaleDir, Locales[i]); if (access(FileName, F_OK) == 0) { // found a locale with VDR texts - if (i < I18N_MAX_LANGUAGES - 1) { + if (NumLocales < I18N_MAX_LANGUAGES - 1) { SetEnvLanguage(Locales[i]); - NumLocales++; - if (strstr(OldLocale, Locales[i]) == OldLocale) - CurrentLanguage = LanguageLocales.Size(); - LanguageLocales.Append(strdup(Locales[i])); - LanguageNames.Append(strdup(gettext(LanguageName))); - const char *Code = gettext(LanguageCode); - for (const char **lc = LanguageCodeList; *lc; lc++) { - if (ContainsCode(*lc, Code)) { - Code = *lc; - break; + const char *TranslatedLanguageName = gettext(LanguageName); + if (TranslatedLanguageName != LanguageName) { + NumLocales++; + if (strstr(OldLocale, Locales[i]) == OldLocale) + CurrentLanguage = LanguageLocales.Size(); + LanguageLocales.Append(strdup(Locales[i])); + LanguageNames.Append(strdup(TranslatedLanguageName)); + const char *Code = gettext(LanguageCode); + for (const char **lc = LanguageCodeList; *lc; lc++) { + if (ContainsCode(*lc, Code)) { + Code = *lc; + break; + } } - } - LanguageCodes.Append(strdup(Code)); + LanguageCodes.Append(strdup(Code)); + } } else { esyslog("ERROR: too many locales - increase I18N_MAX_LANGUAGES!"); @@ -203,15 +206,11 @@ const char *I18nTranslate(const char *s, const char *Plugin) if (!s) return s; if (CurrentLanguage) { - const char *t = s; - if (Plugin) - t = dgettext(Plugin, s); - if (t == s) - t = gettext(s); - s = t; + const char *t = Plugin ? dgettext(Plugin, s) : gettext(s); + if (t != s) + return t; } - const char *p = strchr(s, '$'); - return p ? p + 1 : s; + return SkipContext(s); } const char *I18nLocale(int Language) diff --git a/i18n.h b/i18n.h index 2d1c79b..cbe42b9 100644 --- a/i18n.h +++ b/i18n.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: i18n.h 1.23 2007/08/19 14:07:17 kls Exp $ + * $Id: i18n.h 1.24 2007/08/24 13:35:18 kls Exp $ */ #ifndef __I18N_H @@ -80,6 +80,7 @@ bool I18nIsPreferredLanguage(int *PreferredLanguages, const char *LanguageCode, #ifdef PLUGIN_NAME_I18N #define tr(s) I18nTranslate(s, "vdr-" PLUGIN_NAME_I18N) +#define trVDR(s) I18nTranslate(s) // to use a text that's in the VDR core's translation file #else #define tr(s) I18nTranslate(s) #endif diff --git a/keys.h b/keys.h index da4b7a4..2adcad8 100644 --- a/keys.h +++ b/keys.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: keys.h 1.12 2007/08/04 14:40:23 kls Exp $ + * $Id: keys.h 1.13 2007/08/24 13:15:48 kls Exp $ */ #ifndef __KEYS_H @@ -82,7 +82,7 @@ enum eKeys { // "Up" and "Down" must be the first two keys! struct tKey { eKeys type; - char *name; + const char *name; }; class cKey : public cListObject { diff --git a/menu.c b/menu.c index 4d94b61..444fd75 100644 --- a/menu.c +++ b/menu.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.c 1.460 2007/08/18 09:03:05 kls Exp $ + * $Id: menu.c 1.461 2007/08/24 13:15:48 kls Exp $ */ #include "menu.h" @@ -1040,7 +1040,7 @@ int cMenuScheduleItem::Compare(const cListObject &ListObject) const return r; } -static char *TimerMatchChars = " tT"; +static const char *TimerMatchChars = " tT"; bool cMenuScheduleItem::Update(bool Force) { diff --git a/osd.c b/osd.c index 5624c26..1c91184 100644 --- a/osd.c +++ b/osd.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: osd.c 1.73 2007/08/17 15:23:50 kls Exp $ + * $Id: osd.c 1.74 2007/08/26 09:44:50 kls Exp $ */ #include "osd.h" @@ -646,18 +646,24 @@ int cOsd::osdLeft = 0; int cOsd::osdTop = 0; int cOsd::osdWidth = 0; int cOsd::osdHeight = 0; -int cOsd::isOpen = 0; +cVector cOsd::Osds; -cOsd::cOsd(int Left, int Top) +cOsd::cOsd(int Left, int Top, uint Level) { - if (isOpen) - esyslog("ERROR: OSD opened without closing previous OSD!"); savedRegion = NULL; numBitmaps = 0; left = Left; top = Top; width = height = 0; - isOpen++; + level = Level; + active = false; + for (int i = 0; i < Osds.Size(); i++) { + if (Osds[i]->level > level) { + Osds.Insert(this, i); + return; + } + } + Osds.Append(this); } cOsd::~cOsd() @@ -665,7 +671,14 @@ cOsd::~cOsd() for (int i = 0; i < numBitmaps; i++) delete bitmaps[i]; delete savedRegion; - isOpen--; + for (int i = 0; i < Osds.Size(); i++) { + if (Osds[i] == this) { + Osds.Remove(i); + if (Osds.Size()) + Osds[0]->SetActive(true); + break; + } + } } void cOsd::SetOsdPosition(int Left, int Top, int Width, int Height) @@ -803,15 +816,23 @@ cOsdProvider::~cOsdProvider() osdProvider = NULL; } -cOsd *cOsdProvider::NewOsd(int Left, int Top) +cOsd *cOsdProvider::NewOsd(int Left, int Top, uint Level) { - if (cOsd::IsOpen()) + if (Level == 0 && cOsd::IsOpen()) esyslog("ERROR: attempt to open OSD while it is already open - using dummy OSD!"); - else if (osdProvider) - return osdProvider->CreateOsd(Left, Top); + else if (osdProvider) { + cOsd *ActiveOsd = cOsd::Osds.Size() ? cOsd::Osds[0] : NULL; + cOsd *Osd = osdProvider->CreateOsd(Left, Top, Level); + if (Osd == cOsd::Osds[0]) { + if (ActiveOsd) + ActiveOsd->SetActive(false); + Osd->SetActive(true); + } + return Osd; + } else esyslog("ERROR: no OSD provider available - using dummy OSD!"); - return new cOsd(Left, Top); // create a dummy cOsd, so that access won't result in a segfault + return new cOsd(Left, Top, 999); // create a dummy cOsd, so that access won't result in a segfault } void cOsdProvider::Shutdown(void) diff --git a/osd.h b/osd.h index 08bc418..604b2d2 100644 --- a/osd.h +++ b/osd.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: osd.h 1.56 2007/07/20 14:50:17 kls Exp $ + * $Id: osd.h 1.57 2007/08/26 09:45:38 kls Exp $ */ #ifndef __OSD_H @@ -15,6 +15,7 @@ #include #include "config.h" #include "font.h" +#include "tools.h" #define MAXNUMCOLORS 256 @@ -247,13 +248,15 @@ class cOsd { friend class cOsdProvider; private: static int osdLeft, osdTop, osdWidth, osdHeight; - static int isOpen; + static cVector Osds; cBitmap *savedRegion; cBitmap *bitmaps[MAXOSDAREAS]; int numBitmaps; int left, top, width, height; + uint level; + bool active; protected: - cOsd(int Left, int Top); + cOsd(int Left, int Top, uint Level); ///< Initializes the OSD with the given coordinates. ///< By default it is assumed that the full area will be able to display ///< full 32 bit graphics (ARGB with eight bit for each color and the alpha @@ -269,6 +272,14 @@ protected: ///< and should require only the minimum necessary color depth. This is ///< because a derived cOsd class may or may not be able to handle more ///< than one area. + ///< There can be any number of cOsd objects at the same time, but only + ///< one of them will be active at any given time. The active OSD is the + ///< one with the lowest value of Level. If there are several cOsd objects + ///< with the same Level, the one that was created first will be active. + bool Active(void) { return active; } + virtual void SetActive(bool On) { active = On; } + ///< Sets this OSD to be the active one. + ///< A derived class must call cOsd::SetActive(On). public: virtual ~cOsd(); ///< Shuts down the OSD. @@ -281,7 +292,8 @@ public: ///< This may be useful for plugins that determine the scaling of the ///< video image and need to scale the OSD accordingly to fit on the ///< screen. - static int IsOpen(void) { return isOpen; } + static int IsOpen(void) { return Osds.Size() && Osds[0]->level == 0; } + ///< Returns true if there is currently a level 0 OSD open. int Left(void) { return left; } int Top(void) { return top; } int Width(void) { return width; } @@ -379,14 +391,14 @@ class cOsdProvider { private: static cOsdProvider *osdProvider; protected: - virtual cOsd *CreateOsd(int Left, int Top) = 0; + virtual cOsd *CreateOsd(int Left, int Top, uint Level) = 0; ///< Returns a pointer to a newly created cOsd object, which will be located ///< at the given coordinates. public: cOsdProvider(void); //XXX maybe parameter to make this one "sticky"??? (frame-buffer etc.) virtual ~cOsdProvider(); - static cOsd *NewOsd(int Left, int Top); + static cOsd *NewOsd(int Left, int Top, uint Level = 0); ///< Returns a pointer to a newly created cOsd object, which will be located ///< at the given coordinates. When the cOsd object is no longer needed, the ///< caller must delete it. If the OSD is already in use, or there is no OSD diff --git a/po/tr_TR.po b/po/tr_TR.po index 1eecb50..487c426 100644 --- a/po/tr_TR.po +++ b/po/tr_TR.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2007-08-19 13:53+0200\n" -"PO-Revision-Date: 2007-08-12 14:17+0200\n" +"PO-Revision-Date: 2007-08-24 14:37+0200\n" "Last-Translator: Oktay Yolgeçen \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -25,7 +25,7 @@ msgstr "Kanal kullan #: device.c:636 msgid "Can't start Transfer Mode!" -msgstr "Transfer mode başlatılamıyor!" +msgstr "Transfer modu başlatılamıyor!" #: eitscan.c:159 msgid "Starting EPG scan" @@ -59,7 +59,7 @@ msgstr "Kumandan #: interface.c:80 msgid "Do not press any key..." -msgstr "Tuşlara basmayınız..." +msgstr "Tuşlara basma..." #: interface.c:86 msgid "Phase 2: Learning specific key codes" @@ -68,7 +68,7 @@ msgstr "Faz 2: Belirli tu #: interface.c:90 #, c-format msgid "Press key for '%s'" -msgstr "'%s' için tuş seçiniz" +msgstr "'%s' için tuş seç" #: interface.c:106 msgid "Press 'Up' to confirm" @@ -84,7 +84,7 @@ msgstr "(Geri d #: interface.c:142 msgid "(press 'Down' to end key definition)" -msgstr "(Sona erdirmek için 'Aşağı' bas)" +msgstr "(Bitirmek için 'Aşağı' bas)" #: interface.c:146 msgid "(press 'Menu' to skip this key)" @@ -200,11 +200,11 @@ msgstr " #: keys.c:48 msgid "Key$Volume+" -msgstr "Ses+" +msgstr "Volüm+" #: keys.c:49 msgid "Key$Volume-" -msgstr "Ses-" +msgstr "Volüm-" #: keys.c:50 skinclassic.c:549 msgid "Key$Mute" @@ -240,39 +240,39 @@ msgstr "Komutlar" #: keys.c:58 msgid "Key$User1" -msgstr "" +msgstr "Kullanıcı1" #: keys.c:59 msgid "Key$User2" -msgstr "" +msgstr "Kullanıcı2" #: keys.c:60 msgid "Key$User3" -msgstr "" +msgstr "Kullanıcı3" #: keys.c:61 msgid "Key$User4" -msgstr "" +msgstr "Kullanıcı4" #: keys.c:62 msgid "Key$User5" -msgstr "" +msgstr "Kullanıcı5" #: keys.c:63 msgid "Key$User6" -msgstr "" +msgstr "Kullanıcı6" #: keys.c:64 msgid "Key$User7" -msgstr "" +msgstr "Kullanıcı7" #: keys.c:65 msgid "Key$User8" -msgstr "" +msgstr "Kullanıcı8" #: keys.c:66 msgid "Key$User9" -msgstr "" +msgstr "Kullanıcı9" #: menu.c:69 msgid "Free To Air" @@ -547,7 +547,7 @@ msgstr "L #: menu.c:1754 msgid "CAM not responding!" -msgstr "" +msgstr "CAM yanıt vermiyor!" #: menu.c:1784 msgid "Recording info" @@ -639,35 +639,35 @@ msgstr "Mesaj g #: menu.c:2217 msgid "Setup.OSD$Use small font" -msgstr "Küçük harf kullan" +msgstr "Küçük font kullan" #: menu.c:2218 msgid "Setup.OSD$Anti-alias" -msgstr "" +msgstr "Anti-alias" #: menu.c:2219 msgid "Setup.OSD$Default font" -msgstr "" +msgstr "Olağan font" #: menu.c:2220 msgid "Setup.OSD$Small font" -msgstr "" +msgstr "Küçük font" #: menu.c:2221 msgid "Setup.OSD$Fixed font" -msgstr "" +msgstr "Çakılı font" #: menu.c:2222 msgid "Setup.OSD$Default font size (pixel)" -msgstr "" +msgstr "Olağan font boyutu (pixel)" #: menu.c:2223 msgid "Setup.OSD$Small font size (pixel)" -msgstr "" +msgstr "Küçük font boyutu (pixel)" #: menu.c:2224 msgid "Setup.OSD$Fixed font size (pixel)" -msgstr "" +msgstr "Çakılı font boyutu (pixel)" #: menu.c:2225 msgid "Setup.OSD$Channel info position" @@ -837,15 +837,15 @@ msgstr " #: menu.c:2560 msgid "CAM reset" -msgstr "" +msgstr "CAM sıfırlandı" #: menu.c:2561 msgid "CAM present" -msgstr "" +msgstr "CAM mevcut" #: menu.c:2562 msgid "CAM ready" -msgstr "" +msgstr "CAM hazır" #: menu.c:2585 menu.c:2815 msgid "CAM" @@ -869,7 +869,7 @@ msgstr "CAM men #: menu.c:2624 msgid "CAM is in use - really reset?" -msgstr "" +msgstr "CAM kullanılıyor - gerçekden sıfırla?" #: menu.c:2626 msgid "Can't reset CAM!" @@ -901,7 +901,7 @@ msgstr "Ola #: menu.c:2666 msgid "Setup.Recording$Pause priority" -msgstr "Olağan duraklama prioritesi" +msgstr "Duraklama prioritesi" #: menu.c:2667 msgid "Setup.Recording$Pause lifetime (d)" @@ -973,11 +973,11 @@ msgstr "SVDRP zaman a #: menu.c:2715 msgid "Setup.Miscellaneous$Zap timeout (s)" -msgstr "Kanal değiştirme zaman aşımı (sn)" +msgstr "Zaping zaman aşımı (sn)" #: menu.c:2716 msgid "Setup.Miscellaneous$Channel entry timeout (ms)" -msgstr "" +msgstr "Kanal giriş zaman aşımı (ms)" #: menu.c:2717 msgid "Setup.Miscellaneous$Initial channel" @@ -1149,7 +1149,7 @@ msgstr "Kapat #: shutdown.c:152 msgid "Editing - shut down anyway?" -msgstr "" +msgstr "Kesim aktif - buna rağmen kapat?" #: shutdown.c:162 msgid "Recording - shut down anyway?" @@ -1167,11 +1167,11 @@ msgstr "buna ra #: shutdown.c:184 #, c-format msgid "Plugin %s wakes up in %ld min, continue?" -msgstr "" +msgstr "Eklenti %s %ld dakikada açılıyor, devam et?" #: shutdown.c:195 msgid "Editing - restart anyway?" -msgstr "" +msgstr "Kesim aktif - buna rağmen yeniden başlat?" #: shutdown.c:205 msgid "Recording - restart anyway?" @@ -1184,7 +1184,7 @@ msgstr "buna ra #. TRANSLATORS: note the trailing blank! #: skinclassic.c:553 msgid "Volume " -msgstr "Ses " +msgstr "Volüm " #: skinclassic.c:702 msgid "Classic VDR" @@ -1242,7 +1242,7 @@ msgstr "Kay #: vdr.c:1034 msgid "VDR will shut down later - press Power to force" -msgstr "" +msgstr "VDR daha sonra kapanacak - zorlamak için Kapat'a bas" #: vdr.c:1046 msgid "Press any key to cancel shutdown" @@ -1262,9 +1262,9 @@ msgstr "Kesim bitti" #: vdr.c:1175 msgid "Press any key to cancel restart" -msgstr "" +msgstr "Yeniden başlatmayı iptal etmek için herhangi bir tuşa bas" #: vdr.c:1195 #, c-format msgid "VDR will shut down in %s minutes" -msgstr "" +msgstr "VDR %s dakikada kapanacak" diff --git a/rcu.c b/rcu.c index d81c0b6..34b4387 100644 --- a/rcu.c +++ b/rcu.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: rcu.c 1.15 2006/12/02 11:12:28 kls Exp $ + * $Id: rcu.c 1.16 2007/08/24 13:15:48 kls Exp $ */ #include "rcu.h" @@ -257,7 +257,7 @@ void cRcuRemote::SetNumber(int n, bool Hex) data = m; } -void cRcuRemote::SetString(char *s) +void cRcuRemote::SetString(const char *s) { const char *chars = mode == modeH ? "0123456789ABCDEF" : "0123456789-EHLP "; int n = 0; diff --git a/rcu.h b/rcu.h index 7592dc2..8824f66 100644 --- a/rcu.h +++ b/rcu.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: rcu.h 1.6 2005/12/31 15:09:25 kls Exp $ + * $Id: rcu.h 1.7 2007/08/24 13:15:48 kls Exp $ */ #ifndef __RCU_H @@ -31,7 +31,7 @@ private: void SetMode(unsigned char Mode); void SetNumber(int n, bool Hex = false); void SetPoints(unsigned char Dp, bool On); - void SetString(char *s); + void SetString(const char *s); bool DetectCode(unsigned char *Code); virtual void Action(void); virtual void ChannelSwitch(const cDevice *Device, int ChannelNumber); diff --git a/svdrp.c b/svdrp.c index 3694ebb..933375f 100644 --- a/svdrp.c +++ b/svdrp.c @@ -10,7 +10,7 @@ * and interact with the Video Disk Recorder - or write a full featured * graphical interface that sits on top of an SVDRP connection. * - * $Id: svdrp.c 1.102 2007/06/23 13:14:59 kls Exp $ + * $Id: svdrp.c 1.103 2007/08/25 09:28:26 kls Exp $ */ #include "svdrp.h" @@ -216,10 +216,12 @@ const char *HelpPages[] = { "HITK [ ]\n" " Hit the given remote control key. Without option a list of all\n" " valid key names is given.", - "LSTC [ | ]\n" + "LSTC [ :groups | | ]\n" " List channels. Without option, all channels are listed. Otherwise\n" " only the given channel is listed. If a name is given, all channels\n" - " containing the given string as part of their name are listed.", + " containing the given string as part of their name are listed.\n" + " If ':groups' is given, all channels are listed including group\n" + " separators. The channel number of a group separator is always 0.", "LSTE [ ] [ now | next | at