From d34026c18b6cf0eddd7293ad9af57affacb73365 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Mon, 10 Sep 2012 16:05:00 +0200 Subject: Version 1.7.30 VDR developer version 1.7.30 is now available at MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ftp://ftp.tvdr.de/vdr/Developer/vdr-1.7.30.tar.bz2 A 'diff' against the previous version is available at ftp://ftp.tvdr.de/vdr/Developer/vdr-1.7.29-1.7.30.diff MD5 checksums: c6d75f2962bc3e22d9313c0ee4fa113a vdr-1.7.30.tar.bz2 a63098efcc58bc697d6b890097d9c370 vdr-1.7.29-1.7.30.diff WARNING: ======== This is a developer version. Even though I use it in my productive environment. I strongly recommend that you only use it under controlled conditions and for testing and debugging. The default skin "LCARS" displays the signal strengths and qualities of all devices in its main menu. For devices that have an stb0899 frontend chip (like the TT-budget S2-3200) retrieving this information from the driver is rather slow, which results in a sluggish response to user input in the main menu. To speed this up you may want to apply the patches from ftp://ftp.tvdr.de/vdr/Developer/Driver-Patches to the LinuxDVB driver source. From the HISTORY file: - Fixed sorting recordings in the top level video directory. - Fixed handling control characters in SI data in case of UTF-8 encoded strings (thanks to Mehdi Karamnejad for reporting a problem with garbled UTF-8 EPG data and helping to debug it). - Updated the Finnish OSD texts (thanks to Rolf Ahrenberg). - When checking whether a video directory is empty, file names that start with a dot ('.') are now ignored and will be implicitly removed if the directory contains no other files. This fixes the leftover ".sort" files that were introduced in version 1.7.29. - Added IsUpdate() to the EPG handler interface (thanks to Jörg Wendel). - Fixed detecting transfer mode on full featured DVB cards (thanks to Stefan Huelswitt for reporting a problem with updating CA descriptors in such cases). - Fixed a race condition when zapping in transfer mode (reported by Reinhard Nissl). This involves a slight change in the semantics of the cReceiver::Activate() function, which is now called with 'false' after the receiver has been detached from the device. - The new function cDevice::ReadFilter() can be used by devices to implement their own way of retrieving section filter data (thanks to Deti Fliegl). - The new function cDevice::HasInternalCam() can be implemented by devices that provide encrypted channels in an already decrypted form, without requiring explicit handling of a CAM (thanks to Tobias Grimm). - VDR can now be built according to the FHS ("File system Hierarchy Standard") by activating the line #USEFHS = 1 in a copy of the file Make.config.template (thanks to Dennis Bendlin, as well as Christopher Reimer and Udo Richter for contributing to the patch). - By default (without FHS support) the config directory is now set to the value given in the -v option if only -v and no -c is given. - Fixed a long delay at the end when replaying a recording that has stopped recording less than an hour ago (typically time shift mode or a freshly edited recording). - Fixed getting the file size and number of frames of ongoing recordings (only the timestamp of the recording's directory was checked, while it should have been that of the index file). - Fixed sluggish response when manipulating editing marks while a cutting thread is running (reported by Torsten Lang). - The new setup options "OSD/Color key [0123]" can be used to adjust the sequence of the color buttons displayed in the menus to that of the color keys on your remote control (based on a patch from Oliver Schinagl). Authors of plugins that implement skins may want to adapt their SetButtons() function in order to make use of this new feature. See, for instance, the function cSkinClassicDisplayMenu::SetButtons() in skinclassic.c for details. --- CONTRIBUTORS | 24 ++++++++- HISTORY | 44 +++++++++++++++++ INSTALL | 9 ++++ MANUAL | 8 +++ Make.config.template | 15 +++++- Makefile | 34 +++++++++---- PLUGINS.html | 73 ++++++++++++++++++++-------- config.c | 14 +++++- config.h | 11 +++-- device.c | 29 +++++++---- device.h | 12 ++++- eit.c | 4 +- epg.c | 11 ++++- epg.h | 7 ++- i18n.c | 11 ++--- libsi/si.c | 134 ++++++++++++++++++++++++++------------------------- menu.c | 24 +++++++-- menu.h | 3 +- plugin.c | 39 +++++++++++++-- plugin.h | 10 +++- po/ar.po | 14 +++++- po/ca_ES.po | 14 +++++- po/cs_CZ.po | 14 +++++- po/da_DK.po | 14 +++++- po/de_DE.po | 14 +++++- po/el_GR.po | 14 +++++- po/es_ES.po | 14 +++++- po/et_EE.po | 14 +++++- po/fi_FI.po | 16 +++++- po/fr_FR.po | 14 +++++- po/hr_HR.po | 14 +++++- po/hu_HU.po | 14 +++++- po/it_IT.po | 14 +++++- po/lt_LT.po | 14 +++++- po/mk_MK.po | 14 +++++- po/nl_NL.po | 14 +++++- po/nn_NO.po | 14 +++++- po/pl_PL.po | 14 +++++- po/pt_PT.po | 14 +++++- po/ro_RO.po | 14 +++++- po/ru_RU.po | 14 +++++- po/sk_SK.po | 14 +++++- po/sl_SI.po | 14 +++++- po/sr_SR.po | 14 +++++- po/sv_SE.po | 14 +++++- po/tr_TR.po | 14 +++++- po/uk_UA.po | 14 +++++- po/zh_CN.po | 14 +++++- receiver.h | 4 +- recording.c | 52 +++++++++++++++++--- recording.h | 9 +++- sections.c | 4 +- skinclassic.c | 13 +++-- skinlcars.c | 30 +++++++----- skinlcars.h | 2 +- skinsttng.c | 13 +++-- tools.c | 21 +++++++- vdr.1 | 10 +++- vdr.c | 48 ++++++++++++++---- videodir.c | 7 ++- videodir.h | 3 +- 61 files changed, 912 insertions(+), 214 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 6512bfc..515c3e1 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -87,6 +87,8 @@ Deti Fliegl for fixing setting the OSD size in the 'Confirm' interface call for fixing handling improper buffer lengths in the EIT parser for a patch that was used to implement StopSectionHandler() + for adding cDevice::ReadFilter() to allow devices to implement their own way of + retrieving section filter data Dave Chapman for implementing support for the teletext PID @@ -139,7 +141,7 @@ Andre Valentin Jrgen Tvedt for translating OSD texts to the Norwegian language -Stefan Huelswitt +Stefan Huelswitt for fixing the repeat function with LIRC for making the position of the channel display configurable for making the width and height of the OSD configurable @@ -225,6 +227,8 @@ Stefan Huelswitt cStatus::MsgSetVolume() bug to react properly for improving the 'i18n' target in the Makefile to avoid unnecessary work for a patch that was used to implement the --localedir option + for reporting a problem with updating CA descriptors in transfer mode on full + featured DVB cards Ulrich Rder for pointing out that there are channels that have a symbol rate higher than 27500 @@ -1317,6 +1321,7 @@ Reinhard Nissl receive channels for reporting that the Transfer Mode indicator bitmap in the LCARS skin may not fit with small font sizes + for reporting a race condition when zapping in transfer mode Richard Robson for reporting freezing replay if a timer starts while in Transfer Mode from the @@ -1751,6 +1756,7 @@ Udo Richter editing mark for adding the option --outputonly to the dvbsddevice plugin for adding a missing template specification to the c'tor of cSortedTimers + for contributing to a patch that implements FHS support Sven Kreiensen for his help in keeping 'channels.conf.terr' up to date @@ -2342,6 +2348,9 @@ Tobias Grimm for avoiding a gcc 4.6 compiler error in the skincurses plugin. for suggesting to move setting LC_NUMERIC further up to make sure any floating point numbers use a decimal point + for implementing cDevice::HasInternalCam(), which can be implemented by devices that + provide encrypted channels in an already decrypted form, without requiring explicit + handling of a CAM Helge Lenz for reporting a bug in setting the 'Delta' parameter when calling the shutdown @@ -2467,6 +2476,7 @@ Ulf Kiener Jrg Wendel for reporting that cPlugin::Active() was called too often for adding HandledExternally() to the EPG handler interface + for adding IsUpdate() to the EPG handler interface Peter Pinnau for reporting that 'uint32_t' requires including stdint.h in font.h on some systems @@ -2766,6 +2776,7 @@ Luis Fernandes Christopher Reimer for reporting a problem with external Dolby Digital processing via the '-a' option in live mode and with TS recordings + for contributing to a patch that implements FHS support Stefan Huskamp for suggesting to make entering characters via the number keys @@ -2875,6 +2886,8 @@ Torsten Lang is stored on the video directory file system within the cRecording data for suppressing setting the "broken link" or "TEI" flags when cutting recordings if the editing point merges two seamlessly fitting parts of the same stream + for reporting a sluggish response when manipulating editing marks while a cutting + thread is running Christian Ruppert for some improvements to the Makefiles @@ -2917,3 +2930,12 @@ Dirk Heiser Ludi Kaleni for suggesting to add the source character to channel names whenever they are displayed + +Mehdi Karamnejad + for reporting a problem with garbled UTF-8 EPG data and helping to debug it + +Dennis Bendlin + for a patch that implements FHS support + +Oliver Schinagl + for a patch that was used to implement the setup options "OSD/Color key [0123]" diff --git a/HISTORY b/HISTORY index f7ca2aa..6dfb717 100644 --- a/HISTORY +++ b/HISTORY @@ -7190,3 +7190,47 @@ Video Disk Recorder Revision History - The new setup option "Miscellaneous/Show channel names with source" can be used to turn on adding the source character to channel names whenever they are displayed (suggested by Ludi Kaleni). + +2012-09-09: Version 1.7.30 + +- Fixed sorting recordings in the top level video directory. +- Fixed handling control characters in SI data in case of UTF-8 encoded strings + (thanks to Mehdi Karamnejad for reporting a problem with garbled UTF-8 EPG data + and helping to debug it). +- Updated the Finnish OSD texts (thanks to Rolf Ahrenberg). +- When checking whether a video directory is empty, file names that start with a + dot ('.') are now ignored and will be implicitly removed if the directory contains + no other files. This fixes the leftover ".sort" files that were introduced in + version 1.7.29. +- Added IsUpdate() to the EPG handler interface (thanks to Jrg Wendel). +- Fixed detecting transfer mode on full featured DVB cards (thanks to Stefan Huelswitt + for reporting a problem with updating CA descriptors in such cases). +- Fixed a race condition when zapping in transfer mode (reported by Reinhard Nissl). + This involves a slight change in the semantics of the cReceiver::Activate() function, + which is now called with 'false' *after* the receiver has been detached from the + device. +- The new function cDevice::ReadFilter() can be used by devices to implement their + own way of retrieving section filter data (thanks to Deti Fliegl). +- The new function cDevice::HasInternalCam() can be implemented by devices that + provide encrypted channels in an already decrypted form, without requiring explicit + handling of a CAM (thanks to Tobias Grimm). +- VDR can now be built according to the FHS ("File system Hierarchy Standard") by + activating the line + #USEFHS = 1 + in a copy of the file Make.config.template (thanks to Dennis Bendlin, as well as + Christopher Reimer and Udo Richter for contributing to the patch). +- By default (without FHS support) the config directory is now set to the value + given in the -v option if only -v and no -c is given. +- Fixed a long delay at the end when replaying a recording that has stopped recording + less than an hour ago (typically time shift mode or a freshly edited recording). +- Fixed getting the file size and number of frames of ongoing recordings (only the + timestamp of the recording's directory was checked, while it should have been that + of the index file). +- Fixed sluggish response when manipulating editing marks while a cutting thread + is running (reported by Torsten Lang). +- The new setup options "OSD/Color key [0123]" can be used to adjust the sequence + of the color buttons displayed in the menus to that of the color keys on your + remote control (based on a patch from Oliver Schinagl). + Authors of plugins that implement skins may want to adapt their SetButtons() + function in order to make use of this new feature. See, for instance, the function + cSkinClassicDisplayMenu::SetButtons() in skinclassic.c for details. diff --git a/INSTALL b/INSTALL index e155f9b..50c941e 100644 --- a/INSTALL +++ b/INSTALL @@ -386,6 +386,15 @@ As a starting point you can copy the 'channels.conf' file that comes with the VDR archive into your video directory (or into your config directory, respectively, in case you have redirected it with the -c option). +If you prefer to have your system set up according to the FHS +("File system Hierarchy Standard") and thus have your files spread +all over the place ;-), you can do this by copying the file Make.config.template +to Make.config in the VDR source directory, and activating the line + +#USEFHS = 1 + +in that file. + Setting up DiSEqC: ------------------ diff --git a/MANUAL b/MANUAL index 5d3c9a5..56a304d 100644 --- a/MANUAL +++ b/MANUAL @@ -601,6 +601,14 @@ Version 1.6 characters in a text input field. You may want to set this to "no" if you are using an actual keyboard to control VDR. + Color key 0 = 0 By default, VDR assumes that the sequence of the color + Color key 1 = 1 keys on the remote control is red-green-yellow-blue. If + Color key 2 = 2 your remote control has these keys in a different sequence, + Color key 3 = 3 you can adjust these parameters to reorder the corresponding + color buttons in the menus accordingly. Note that this does + not change the functionality of the individual keys; it only + changes the sequence in which the color buttons are displayed. + EPG: EPG scan timeout = 5 The time (in hours) of user inactivity after which the diff --git a/Make.config.template b/Make.config.template index d51e20c..ef463b1 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 2.8 2012/03/20 11:20:13 kls Exp $ +# $Id: Make.config.template 2.9 2012/09/01 10:31:33 kls Exp $ ### The C compiler and options: @@ -28,11 +28,22 @@ PREFIX = $(DESTDIR)/usr/local MANDIR = $(PREFIX)/man BINDIR = $(PREFIX)/bin +# By default locale and plugin files are built under the source directory: LOCDIR = ./locale PLUGINDIR = ./PLUGINS PLUGINLIBDIR = $(PLUGINDIR)/lib +# By default VDR requires only one single directory to operate: VIDEODIR = /video -CONFDIR = $(VIDEODIR) +# Activate the following line to build VDR according to the FHS ("File system Hierarchy Standard"): +#USEFHS = 1 +ifdef USEFHS +VIDEODIR = /srv/vdr/video +CONFDIR = /var/lib/vdr +CACHEDIR = /var/cache/vdr +RESDIR = $(PREFIX)/share/vdr +LOCDIR = $(PREFIX)/share/locale +PLUGINLIBDIR = $(PREFIX)/lib/vdr +endif ### The remote control: diff --git a/Makefile b/Makefile index a0458d4..ba5a458 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 2.27 2012/04/15 13:21:31 kls Exp $ +# $Id: Makefile 2.29 2012/09/07 14:11:37 kls Exp $ .DELETE_ON_ERROR: @@ -27,8 +27,9 @@ INCLUDES ?= $(shell pkg-config --cflags freetype2 fontconfig) PLUGINDIR= ./PLUGINS PLUGINLIBDIR= $(PLUGINDIR)/lib -VIDEODIR = /video -CONFDIR = $(VIDEODIR) +# By default VDR requires only one single directory to operate: +VIDEODIR = /video +# See Make.config.template if you want to build VDR according to the FHS ("File system Hierarchy Standard") DOXYGEN ?= /usr/bin/doxygen DOXYFILE = Doxyfile @@ -70,9 +71,17 @@ DEFINES += -D_GNU_SOURCE DEFINES += -DVIDEODIR=\"$(VIDEODIR)\" DEFINES += -DCONFDIR=\"$(CONFDIR)\" +DEFINES += -DCACHEDIR=\"$(CACHEDIR)\" +DEFINES += -DRESDIR=\"$(RESDIR)\" DEFINES += -DPLUGINDIR=\"$(PLUGINLIBDIR)\" DEFINES += -DLOCDIR=\"$(LOCDIR)\" +# Default values for directories: + +CONFDIRDEF = $(firstword $(CONFDIR) $(VIDEODIR)) +CACHEDIRDEF = $(firstword $(CACHEDIR) $(VIDEODIR)) +RESDIRDEF = $(firstword $(RESDIR) $(CONFDIRDEF)) + # The version numbers of VDR and the plugin API (taken from VDR's "config.h"): VDRVERSION = $(shell sed -ne '/define VDRVERSION/s/^.*"\(.*\)".*$$/\1/p' config.h) @@ -109,8 +118,10 @@ $(SILIB): vdr.pc: Makefile Make.global @echo "bindir=$(BINDIR)" > $@ @echo "includedir=$(INCDIR)" >> $@ - @echo "configdir=$(CONFDIR)" >> $@ + @echo "configdir=$(CONFDIRDEF)" >> $@ @echo "videodir=$(VIDEODIR)" >> $@ + @echo "cachedir=$(CACHEDIRDEF)" >> $@ + @echo "resdir=$(RESDIRDEF)" >> $@ @echo "plugindir=$(PLUGINLIBDIR)" >> $@ @echo "localedir=$(LOCDIR)" >> $@ @echo "apiversion=$(APIVERSION)" >> $@ @@ -183,7 +194,7 @@ clean-plugins: # Install the files: -install: install-bin install-conf install-doc install-plugins install-i18n install-includes install-pc +install: install-bin install-dirs install-conf install-doc install-plugins install-i18n install-includes install-pc # VDR binary: @@ -193,12 +204,15 @@ install-bin: vdr # Configuration files: -install-conf: +install-dirs: @mkdir -p $(DESTDIR)$(VIDEODIR) - @if [ ! -d $(DESTDIR)$(CONFDIR) ]; then\ - mkdir -p $(DESTDIR)$(CONFDIR);\ - cp *.conf $(DESTDIR)$(CONFDIR);\ - fi + @mkdir -p $(DESTDIR)$(CONFDIRDEF) + @mkdir -p $(DESTDIR)$(CACHEDIRDEF) + @mkdir -p $(DESTDIR)$(RESDIRDEF) + +install-conf: + @cp *.conf $(DESTDIR)$(CONFDIRDEF) + # Documentation: diff --git a/PLUGINS.html b/PLUGINS.html index a6b29f2..859ca70 100644 --- a/PLUGINS.html +++ b/PLUGINS.html @@ -82,7 +82,7 @@ structures and allows it to hook itself into specific areas to perform special a
  • Wakeup
  • Setup parameters
  • The Setup menu -
  • Configuration files +
  • Additional files
  • Internationalization
  • Custom services
  • SVDRP commands @@ -885,39 +885,70 @@ You can first assign the temporary values to the global variables and then do th your setup parameters and use that one to copy all parameters with one single statement (like VDR does with its cSetup class). -

    Configuration files

    +

    Additional files

    I want my own stuff!

    -There may be situations where a plugin requires configuration files of its own, maybe -for data that can't be stored in the simple setup parameters -of VDR, or maybe because it needs to launch other programs that simply need a separate -configuration file. While the plugin is free to store such files anywhere it -sees fit, it might be a good idea to put them in a common place, preferably -where other configuration data already exists. VDR provides the function + +There may be situations where a plugin requires files of its own. While the plugin is +free to store such files anywhere it sees fit, it might be a good idea to put them in a common +place, preferably where such data already exists. + +

    + +configuration files, maybe for data that can't be stored in the simple +setup parameters of VDR, or maybe because it needs to +launch other programs that simply need a separate configuration file. + +

    + +cache files, to store data so that future requests for that data can be served faster. The data +that is stored within a cache might be values that have been computed earlier or duplicates of +original values that are stored elsewhere. + +

    + +resource files, for providing additional files, like pictures, movie clips or channel logos. + +

    + +Threfore VDR provides the functions

    +
     const char *ConfigDirectory(const char *PluginName = NULL);
    +const char *CacheDirectory(const char *PluginName = NULL);
    +const char *ResourceDirectory(const char *PluginName = NULL);
    +
     

    -which returns a string containing the directory that VDR uses for its own configuration -files (defined through the -c option in the call to VDR), extended by + +each of which returns a string containing the directory that VDR uses for its own +files (defined through the options in the call to VDR), extended by + "/plugins". So assuming the VDR configuration directory is /video (the default if no -c or -v option is given), a call to ConfigDirectory() will return /video/plugins. The first call to ConfigDirectory() will automatically make sure that the plugins subdirectory will exist. If, for some reason, this cannot be achieved, NULL will be returned. + +The behavoir of CacheDirectory() and ResourceDirectory() is similar. +

    The additional plugins directory is used to keep files from plugins apart from those of VDR itself, making sure there will be no name clashes. If a plugin -needs only one extra configuration file, it is suggested that this file be named -name.conf, where name shall be the name of the plugin. + +needs only one extra file, it is suggested that this file be named name.*, +where name shall be the name of the plugin. +

    If a plugin needs more than one such file, it is suggested that the plugin stores these in a subdirectory of its own, named after the plugin. To easily get such a name -the ConfigDirectory() function can be given an additional string that will -be appended to the returned directory name, as in + +the functions can be given an additional string that will be appended to the returned +directory name, as in +

     const char *MyConfigDir = ConfigDirectory(Name());
    @@ -928,13 +959,16 @@ plugin's name. Again, VDR will make sure that the requested directory will exist
     (or return NULL in case of an error).
     

    -The returned string is statically allocated and will be overwritten by subsequent -calls to ConfigDirectory()! + +The returned strings are statically allocated and will be overwritten by subsequent calls! +

    -The ConfigDirectory() function is a static member function of the cPlugin -class. This allows it to be called even from outside any member function of the derived -plugin class, by writing + +The ConfigDirectory(), CacheDirectory() and ResourceDirectory() +functions are static member functions of the cPlugin class. This allows them to be +called even from outside any member function of the derived plugin class, by writing +

     const char *MyConfigDir = cPlugin::ConfigDirectory();
    @@ -1888,6 +1922,7 @@ the functions
     
     

     virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask);
    +virtual int ReadFilter(int Handle, void *Buffer, size_t Length);
     virtual void CloseFilter(int Handle);
     

    diff --git a/config.c b/config.c index 56454df..3fb4d6d 100644 --- a/config.c +++ b/config.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.c 2.26 2012/06/17 12:27:07 kls Exp $ + * $Id: config.c 2.27 2012/09/09 12:58:23 kls Exp $ */ #include "config.h" @@ -418,6 +418,10 @@ cSetup::cSetup(void) RecordingDirs = 1; FoldersInTimerMenu = 1; NumberKeysForChars = 1; + ColorKey0 = 0; + ColorKey1 = 1; + ColorKey2 = 2; + ColorKey3 = 3; VideoDisplayFormat = 1; VideoFormat = 0; UpdateChannels = 5; @@ -614,6 +618,10 @@ bool cSetup::Parse(const char *Name, const char *Value) else if (!strcasecmp(Name, "RecordingDirs")) RecordingDirs = atoi(Value); else if (!strcasecmp(Name, "FoldersInTimerMenu")) FoldersInTimerMenu = atoi(Value); else if (!strcasecmp(Name, "NumberKeysForChars")) NumberKeysForChars = atoi(Value); + else if (!strcasecmp(Name, "ColorKey0")) ColorKey0 = atoi(Value); + else if (!strcasecmp(Name, "ColorKey1")) ColorKey1 = atoi(Value); + else if (!strcasecmp(Name, "ColorKey2")) ColorKey2 = atoi(Value); + else if (!strcasecmp(Name, "ColorKey3")) ColorKey3 = atoi(Value); else if (!strcasecmp(Name, "VideoDisplayFormat")) VideoDisplayFormat = atoi(Value); else if (!strcasecmp(Name, "VideoFormat")) VideoFormat = atoi(Value); else if (!strcasecmp(Name, "UpdateChannels")) UpdateChannels = atoi(Value); @@ -713,6 +721,10 @@ bool cSetup::Save(void) Store("RecordingDirs", RecordingDirs); Store("FoldersInTimerMenu", FoldersInTimerMenu); Store("NumberKeysForChars", NumberKeysForChars); + Store("ColorKey0", ColorKey0); + Store("ColorKey1", ColorKey1); + Store("ColorKey2", ColorKey2); + Store("ColorKey3", ColorKey3); Store("VideoDisplayFormat", VideoDisplayFormat); Store("VideoFormat", VideoFormat); Store("UpdateChannels", UpdateChannels); diff --git a/config.h b/config.h index acdf77a..a58b75c 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 2.49 2012/06/17 11:14:50 kls Exp $ + * $Id: config.h 2.51 2012/09/09 12:57:33 kls Exp $ */ #ifndef __CONFIG_H @@ -22,13 +22,13 @@ // VDR's own version number: -#define VDRVERSION "1.7.29" -#define VDRVERSNUM 10729 // Version * 10000 + Major * 100 + Minor +#define VDRVERSION "1.7.30" +#define VDRVERSNUM 10730 // Version * 10000 + Major * 100 + Minor // The plugin API's version number: -#define APIVERSION "1.7.29" -#define APIVERSNUM 10729 // Version * 10000 + Major * 100 + Minor +#define APIVERSION "1.7.30" +#define APIVERSNUM 10730 // 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 @@ -288,6 +288,7 @@ public: int RecordingDirs; int FoldersInTimerMenu; int NumberKeysForChars; + int ColorKey0, ColorKey1, ColorKey2, ColorKey3; int VideoDisplayFormat; int VideoFormat; int UpdateChannels; diff --git a/device.c b/device.c index 872b1aa..6518e82 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 2.62 2012/06/10 13:13:18 kls Exp $ + * $Id: device.c 2.67 2012/09/02 09:26:36 kls Exp $ */ #include "device.h" @@ -241,6 +241,7 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool LiveView int NumCamSlots = CamSlots.Count(); int SlotPriority[NumCamSlots]; int NumUsableSlots = 0; + bool InternalCamNeeded = false; if (Channel->Ca() >= CA_ENCRYPTED_MIN) { for (cCamSlot *CamSlot = CamSlots.First(); CamSlot; CamSlot = CamSlots.Next(CamSlot)) { SlotPriority[CamSlot->Index()] = MAXPRIORITY + 1; // assumes it can't be used @@ -254,7 +255,7 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool LiveView } } if (!NumUsableSlots) - return NULL; // no CAM is able to decrypt this channel + InternalCamNeeded = true; // no CAM is able to decrypt this channel } bool NeedsDetachReceivers = false; @@ -268,11 +269,14 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool LiveView for (int i = 0; i < numDevices; i++) { if (Channel->Ca() && Channel->Ca() <= CA_DVB_MAX && Channel->Ca() != device[i]->CardIndex() + 1) continue; // a specific card was requested, but not this one - if (NumUsableSlots && !CamSlots.Get(j)->Assign(device[i], true)) + bool HasInternalCam = device[i]->HasInternalCam(); + if (InternalCamNeeded && !HasInternalCam) + continue; // no CAM is able to decrypt this channel and the device uses vdr handled CAMs + if (NumUsableSlots && !HasInternalCam && !CamSlots.Get(j)->Assign(device[i], true)) continue; // CAM slot can't be used with this device bool ndr; if (device[i]->ProvidesChannel(Channel, Priority, &ndr)) { // this device is basically able to do the job - if (NumUsableSlots && device[i]->CamSlot() && device[i]->CamSlot() != CamSlots.Get(j)) + if (NumUsableSlots && !HasInternalCam && device[i]->CamSlot() && device[i]->CamSlot() != CamSlots.Get(j)) ndr = true; // using a different CAM slot requires detaching receivers // Put together an integer number that reflects the "impact" using // this device would have on the overall system. Each condition is represented @@ -287,18 +291,18 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool LiveView imp <<= 4; imp |= GetClippedNumProvidedSystems(4, device[i]) - 1; // avoid cards which support multiple delivery systems imp <<= 1; imp |= device[i] == cTransferControl::ReceiverDevice(); // avoid the Transfer Mode receiver device imp <<= 8; imp |= device[i]->Priority() - IDLEPRIORITY; // use the device with the lowest priority (- IDLEPRIORITY to assure that values -100..99 can be used) - imp <<= 8; imp |= (NumUsableSlots ? SlotPriority[j] : IDLEPRIORITY) - IDLEPRIORITY; // use the CAM slot with the lowest priority (- IDLEPRIORITY to assure that values -100..99 can be used) + imp <<= 8; imp |= ((NumUsableSlots && !HasInternalCam) ? SlotPriority[j] : IDLEPRIORITY) - IDLEPRIORITY;// use the CAM slot with the lowest priority (- IDLEPRIORITY to assure that values -100..99 can be used) imp <<= 1; imp |= ndr; // avoid devices if we need to detach existing receivers - imp <<= 1; imp |= NumUsableSlots ? 0 : device[i]->HasCi(); // avoid cards with Common Interface for FTA channels + imp <<= 1; imp |= (NumUsableSlots || InternalCamNeeded) ? 0 : device[i]->HasCi(); // avoid cards with Common Interface for FTA channels imp <<= 1; imp |= device[i]->AvoidRecording(); // avoid SD full featured cards - imp <<= 1; imp |= NumUsableSlots ? !ChannelCamRelations.CamDecrypt(Channel->GetChannelID(), j + 1) : 0; // prefer CAMs that are known to decrypt this channel + imp <<= 1; imp |= (NumUsableSlots && !HasInternalCam) ? !ChannelCamRelations.CamDecrypt(Channel->GetChannelID(), j + 1) : 0; // prefer CAMs that are known to decrypt this channel imp <<= 1; imp |= device[i]->IsPrimaryDevice(); // avoid the primary device if (imp < Impact) { // This device has less impact than any previous one, so we take it. Impact = imp; d = device[i]; NeedsDetachReceivers = ndr; - if (NumUsableSlots) + if (NumUsableSlots && !HasInternalCam) s = CamSlots.Get(j); } } @@ -593,6 +597,11 @@ int cDevice::OpenFilter(u_short Pid, u_char Tid, u_char Mask) return -1; } +int cDevice::ReadFilter(int Handle, void *Buffer, size_t Length) +{ + return safe_read(Handle, Buffer, Length); +} + void cDevice::CloseFilter(int Handle) { close(Handle); @@ -1195,7 +1204,7 @@ bool cDevice::Replaying(void) const bool cDevice::Transferring(void) const { - return ActualDevice() != PrimaryDevice(); + return cTransferControl::ReceiverDevice() != NULL; } bool cDevice::AttachPlayer(cPlayer *Player) @@ -1666,11 +1675,11 @@ void cDevice::Detach(cReceiver *Receiver) cMutexLock MutexLock(&mutexReceiver); for (int i = 0; i < MAXRECEIVERS; i++) { if (receiver[i] == Receiver) { - Receiver->Activate(false); Lock(); receiver[i] = NULL; Receiver->device = NULL; Unlock(); + Receiver->Activate(false); for (int n = 0; n < Receiver->numPids; n++) DelPid(Receiver->pids[n]); } diff --git a/device.h b/device.h index f279fda..1f94521 100644 --- a/device.h +++ b/device.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.h 2.39 2012/04/04 09:48:21 kls Exp $ + * $Id: device.h 2.41 2012/08/26 13:25:44 kls Exp $ */ #ifndef __DEVICE_H @@ -393,6 +393,10 @@ public: ///< Opens a file handle for the given filter data. ///< A derived device that provides section data must ///< implement this function. + virtual int ReadFilter(int Handle, void *Buffer, size_t Length); + ///< Reads data from a handle for the given filter. + ///< A derived class need not implement this function, because this + ///< is done by the default implementation. virtual void CloseFilter(int Handle); ///< Closes a file handle that has previously been opened ///< by OpenFilter(). If this is as simple as calling close(Handle), @@ -411,6 +415,12 @@ private: public: virtual bool HasCi(void); ///< Returns true if this device has a Common Interface. + virtual bool HasInternalCam(void) { return false; } + ///< Returns true if this device handles encrypted channels itself + ///< without VDR assistance. This can be e.g. if the device is a + ///< client that gets the stream from another VDR instance that has + ///< already decrypted the stream. In this case ProvidesChannel() + ///< shall check whether the channel can be decrypted. void SetCamSlot(cCamSlot *CamSlot); ///< Sets the given CamSlot to be used with this device. cCamSlot *CamSlot(void) const { return camSlot; } diff --git a/eit.c b/eit.c index 12e1d24..a236b89 100644 --- a/eit.c +++ b/eit.c @@ -8,7 +8,7 @@ * Robert Schneider and Rolf Hakenes . * Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg . * - * $Id: eit.c 2.20 2012/06/04 10:26:10 kls Exp $ + * $Id: eit.c 2.21 2012/08/25 11:13:00 kls Exp $ */ #include "eit.h" @@ -74,6 +74,8 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo if (!pEvent || handledExternally) { if (OnlyRunningStatus) continue; + if (handledExternally && !EpgHandlers.IsUpdate(SiEitEvent.getEventId(), StartTime, Tid, getVersionNumber())) + continue; // If we don't have that event yet, we create a new one. // Otherwise we copy the information into the existing event anyway, because the data might have changed. pEvent = newEvent = new cEvent(SiEitEvent.getEventId()); diff --git a/epg.c b/epg.c index d47c4a3..8ebfb6e 100644 --- a/epg.c +++ b/epg.c @@ -7,7 +7,7 @@ * Original version (as used in VDR before 1.3.0) written by * Robert Schneider and Rolf Hakenes . * - * $Id: epg.c 2.17 2012/06/04 10:26:10 kls Exp $ + * $Id: epg.c 2.18 2012/08/25 11:10:29 kls Exp $ */ #include "epg.h" @@ -1340,6 +1340,15 @@ bool cEpgHandlers::HandledExternally(const cChannel *Channel) return false; } +bool cEpgHandlers::IsUpdate(tEventID EventID, time_t StartTime, uchar TableID, uchar Version) +{ + for (cEpgHandler *eh = First(); eh; eh = Next(eh)) { + if (eh->IsUpdate(EventID, StartTime, TableID, Version)) + return true; + } + return false; +} + void cEpgHandlers::SetEventID(cEvent *Event, tEventID EventID) { for (cEpgHandler *eh = First(); eh; eh = Next(eh)) { diff --git a/epg.h b/epg.h index 98cb776..b9a2093 100644 --- a/epg.h +++ b/epg.h @@ -7,7 +7,7 @@ * Original version (as used in VDR before 1.3.0) written by * Robert Schneider and Rolf Hakenes . * - * $Id: epg.h 2.13 2012/06/04 10:26:10 kls Exp $ + * $Id: epg.h 2.14 2012/08/25 11:15:18 kls Exp $ */ #ifndef __EPG_H @@ -250,6 +250,10 @@ public: ///< source. Incoming EIT data is processed as usual, but any new EPG event ///< will not be added to the respective schedule. It's up to the EPG ///< handler to take care of this. + virtual bool IsUpdate(tEventID EventID, time_t StartTime, uchar TableID, uchar Version) { return false; } + ///< VDR can't perform the update check (version, tid) for externally handled events, + ///< therefore the EPG handlers have to take care of this. Otherwise the parsing of + ///< non-updates will waste a lot of resources. virtual bool SetEventID(cEvent *Event, tEventID EventID) { return false; } virtual bool SetTitle(cEvent *Event, const char *Title) { return false; } virtual bool SetShortText(cEvent *Event, const char *ShortText) { return false; } @@ -277,6 +281,7 @@ public: bool IgnoreChannel(const cChannel *Channel); bool HandleEitEvent(cSchedule *Schedule, const SI::EIT::Event *EitEvent, uchar TableID, uchar Version); bool HandledExternally(const cChannel *Channel); + bool IsUpdate(tEventID EventID, time_t StartTime, uchar TableID, uchar Version); void SetEventID(cEvent *Event, tEventID EventID); void SetTitle(cEvent *Event, const char *Title); void SetShortText(cEvent *Event, const char *ShortText); diff --git a/i18n.c b/i18n.c index bc4aaf6..f010b6b 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 2.4 2011/08/15 10:01:45 kls Exp $ + * $Id: i18n.c 2.5 2012/09/01 10:53:43 kls Exp $ */ /* @@ -63,7 +63,7 @@ const char *LanguageCodeList[] = { NULL }; -static const char *I18nLocaleDir = LOCDIR; +static cString I18nLocaleDir; static cStringList LanguageLocales; static cStringList LanguageNames; @@ -102,8 +102,7 @@ static void SetEnvLanguage(const char *Locale) void I18nInitialize(const char *LocaleDir) { - if (LocaleDir) - I18nLocaleDir = LocaleDir; + I18nLocaleDir = LocaleDir; LanguageLocales.Append(strdup(I18N_DEFAULT_LOCALE)); LanguageNames.Append(strdup(SkipContext(LanguageName))); LanguageCodes.Append(strdup(LanguageCodeList[0])); @@ -113,7 +112,7 @@ void I18nInitialize(const char *LocaleDir) if (Locales.Size() > 0) { char *OldLocale = strdup(setlocale(LC_MESSAGES, NULL)); for (int i = 0; i < Locales.Size(); i++) { - cString FileName = cString::sprintf("%s/%s/LC_MESSAGES/vdr.mo", I18nLocaleDir, Locales[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 (NumLocales < I18N_MAX_LANGUAGES - 1) { SetEnvLanguage(Locales[i]); @@ -142,7 +141,7 @@ void I18nInitialize(const char *LocaleDir) } SetEnvLanguage(LanguageLocales[CurrentLanguage]); free(OldLocale); - dsyslog("found %d locales in %s", NumLocales - 1, I18nLocaleDir); + dsyslog("found %d locales in %s", NumLocales - 1, *I18nLocaleDir); } // Prepare any known language codes for which there was no locale: for (const char **lc = LanguageCodeList; *lc; lc++) { diff --git a/libsi/si.c b/libsi/si.c index 4db917b..cd889bc 100644 --- a/libsi/si.c +++ b/libsi/si.c @@ -6,7 +6,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: si.c 2.6 2011/12/10 15:47:15 kls Exp $ + * $Id: si.c 2.7 2012/08/21 08:10:00 kls Exp $ * * ***************************************************************************/ @@ -405,6 +405,21 @@ bool convertCharacterTable(const char *from, size_t fromLength, char *to, size_t return false; } +// A similar version is used in VDR/tools.c: +static int Utf8CharLen(const char *s) +{ + if (SystemCharacterTableIsSingleByte) + return 1; +#define MT(s, m, v) ((*(s) & (m)) == (v)) // Mask Test + if (MT(s, 0xE0, 0xC0) && MT(s + 1, 0xC0, 0x80)) + return 2; + if (MT(s, 0xF0, 0xE0) && MT(s + 1, 0xC0, 0x80) && MT(s + 2, 0xC0, 0x80)) + return 3; + if (MT(s, 0xF8, 0xF0) && MT(s + 1, 0xC0, 0x80) && MT(s + 2, 0xC0, 0x80) && MT(s + 3, 0xC0, 0x80)) + return 4; + return 1; +} + // originally from libdtv, Copyright Rolf Hakenes void String::decodeText(char *buffer, int size) { const unsigned char *from=data.getData(0); @@ -413,82 +428,71 @@ void String::decodeText(char *buffer, int size) { if (len <= 0) { *to = '\0'; return; - } + } bool singleByte; const char *cs = getCharacterTable(from, len, &singleByte); - // FIXME Need to make this UTF-8 aware (different control codes). - // However, there's yet to be found a broadcaster that actually - // uses UTF-8 for the SI data... (kls 2007-06-10) - for (int i = 0; i < len; i++) { - if (*from == 0) - break; - if ( ((' ' <= *from) && (*from <= '~')) - || (*from == '\n') - || (0xA0 <= *from) - ) - *to++ = *from; - else if (*from == 0x8A) - *to++ = '\n'; - from++; - if (to - buffer >= size - 1) - break; + if (singleByte && SystemCharacterTableIsSingleByte || !convertCharacterTable((const char *)from, len, to, size, cs)) { + if (len >= size) + len = size - 1; + strncpy(to, (const char *)from, len); + to[len] = 0; } - *to = '\0'; - if (!singleByte || !SystemCharacterTableIsSingleByte) { - char convBuffer[size]; - if (convertCharacterTable(buffer, strlen(buffer), convBuffer, sizeof(convBuffer), cs)) - strncpy(buffer, convBuffer, strlen(convBuffer) + 1); + else + len = strlen(to); // might have changed + // Handle control codes: + while (len > 0) { + int l = Utf8CharLen(to); + if (l <= 2) { + unsigned char *p = (unsigned char *)to; + if (l == 2 && *p == 0xC2) // UTF-8 sequence + p++; + bool Move = true; + switch (*p) { + case 0x8A: *to = '\n'; break; + case 0xA0: *to = ' '; break; + default: Move = false; + } + if (l == 2 && Move) { + memmove(p, p + 1, len - 1); // we also copy the terminating 0! + l = 1; + } + } + to += l; + len -= l; } } void String::decodeText(char *buffer, char *shortVersion, int sizeBuffer, int sizeShortVersion) { - const unsigned char *from=data.getData(0); + decodeText(buffer, sizeBuffer); + if (!*buffer) { + *shortVersion = '\0'; + return; + } + // Handle control codes: char *to=buffer; - char *toShort=shortVersion; + int len=strlen(to); int IsShortName=0; - int len=getLength(); - if (len <= 0) { - *to = '\0'; - *toShort = '\0'; - return; + while (len > 0) { + int l = Utf8CharLen(to); + unsigned char *p = (unsigned char *)to; + if (l == 2 && *p == 0xC2) // UTF-8 sequence + p++; + if (*p == 0x86 || *p == 0x87) { + IsShortName += (*p == 0x86) ? 1 : -1; + memmove(to, to + l, len - l + 1); // we also copy the terminating 0! + l = 0; } - bool singleByte; - const char *cs = getCharacterTable(from, len, &singleByte); - // FIXME Need to make this UTF-8 aware (different control codes). - // However, there's yet to be found a broadcaster that actually - // uses UTF-8 for the SI data... (kls 2007-06-10) - for (int i = 0; i < len; i++) { - if ( ((' ' <= *from) && (*from <= '~')) - || (*from == '\n') - || (0xA0 <= *from) - ) - { - *to++ = *from; - if (IsShortName) - *toShort++ = *from; + if (l && IsShortName) { + if (l < sizeShortVersion) { + for (int i = 0; i < l; i++) + *shortVersion++ = to[i]; + sizeShortVersion -= l; + } } - else if (*from == 0x8A) - *to++ = '\n'; - else if (*from == 0x86) - IsShortName++; - else if (*from == 0x87) - IsShortName--; - else if (*from == 0) - break; - from++; - if (to - buffer >= sizeBuffer - 1 || toShort - shortVersion >= sizeShortVersion - 1) - break; - } - *to = '\0'; - *toShort = '\0'; - if (!singleByte || !SystemCharacterTableIsSingleByte) { - char convBuffer[sizeBuffer]; - if (convertCharacterTable(buffer, strlen(buffer), convBuffer, sizeof(convBuffer), cs)) - strncpy(buffer, convBuffer, strlen(convBuffer) + 1); - char convShortVersion[sizeShortVersion]; - if (convertCharacterTable(shortVersion, strlen(shortVersion), convShortVersion, sizeof(convShortVersion), cs)) - strncpy(shortVersion, convShortVersion, strlen(convShortVersion) + 1); + to += l; + len -= l; } + *shortVersion = '\0'; } Descriptor *Descriptor::getDescriptor(CharArray da, DescriptorTagDomain domain, bool returnUnimplemetedDescriptor) { diff --git a/menu.c b/menu.c index 9f4c54e..1b9346c 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 2.58 2012/06/17 11:12:25 kls Exp $ + * $Id: menu.c 2.60 2012/09/09 12:23:00 kls Exp $ */ #include "menu.h" @@ -2510,6 +2510,7 @@ void cMenuSetupBase::Store(void) class cMenuSetupOSD : public cMenuSetupBase { private: const char *useSmallFontTexts[3]; + const char *keyColorTexts[4]; int osdLanguageIndex; int numSkins; int originalSkinIndex; @@ -2560,6 +2561,10 @@ void cMenuSetupOSD::Set(void) useSmallFontTexts[0] = tr("never"); useSmallFontTexts[1] = tr("skin dependent"); useSmallFontTexts[2] = tr("always"); + keyColorTexts[0] = tr("Key$Red"); + keyColorTexts[1] = tr("Key$Green"); + keyColorTexts[2] = tr("Key$Yellow"); + keyColorTexts[3] = tr("Key$Blue"); Clear(); SetSection(tr("OSD")); Add(new cMenuEditStraItem(tr("Setup.OSD$Language"), &osdLanguageIndex, I18nNumLanguagesWithLocale(), &I18nLanguages()->At(0))); @@ -2589,6 +2594,10 @@ void cMenuSetupOSD::Set(void) Add(new cMenuEditBoolItem(tr("Setup.OSD$Recording directories"), &data.RecordingDirs)); Add(new cMenuEditBoolItem(tr("Setup.OSD$Folders in timer menu"), &data.FoldersInTimerMenu)); Add(new cMenuEditBoolItem(tr("Setup.OSD$Number keys for characters"), &data.NumberKeysForChars)); + Add(new cMenuEditStraItem(tr("Setup.OSD$Color key 0"), &data.ColorKey0, 4, keyColorTexts)); + Add(new cMenuEditStraItem(tr("Setup.OSD$Color key 1"), &data.ColorKey1, 4, keyColorTexts)); + Add(new cMenuEditStraItem(tr("Setup.OSD$Color key 2"), &data.ColorKey2, 4, keyColorTexts)); + Add(new cMenuEditStraItem(tr("Setup.OSD$Color key 3"), &data.ColorKey3, 4, keyColorTexts)); SetCurrent(Get(current)); Display(); } @@ -4455,6 +4464,7 @@ cReplayControl::cReplayControl(bool PauseLive) { currentReplayControl = this; displayReplay = NULL; + marksModified = false; visible = modeOnly = shown = displayFrames = false; lastCurrent = lastTotal = -1; lastPlay = lastForward = false; @@ -4472,6 +4482,10 @@ cReplayControl::~cReplayControl() Hide(); cStatus::MsgReplaying(this, NULL, fileName, false); Stop(); + if (marksModified) { + marks.Save(); + marksModified = false; + } if (currentReplayControl == this) currentReplayControl = NULL; } @@ -4729,7 +4743,7 @@ void cReplayControl::MarkToggle(void) Goto(Current, true); } ShowTimed(2); - marks.Save(); + marksModified = true; } } @@ -4766,7 +4780,7 @@ void cReplayControl::MarkMove(bool Forward) } m->SetPosition(p); Goto(m->Position(), true); - marks.Save(); + marksModified = true; } } } @@ -4775,6 +4789,10 @@ void cReplayControl::EditCut(void) { if (*fileName) { Hide(); + if (marksModified) { + marks.Save(); + marksModified = false; + } if (!cCutter::Active()) { if (!marks.Count()) Skins.Message(mtError, tr("No editing marks defined!")); diff --git a/menu.h b/menu.h index ba93c5d..10ffc7a 100644 --- a/menu.h +++ b/menu.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.h 2.11 2012/06/13 11:23:11 kls Exp $ + * $Id: menu.h 2.12 2012/09/07 08:48:34 kls Exp $ */ #ifndef __MENU_H @@ -260,6 +260,7 @@ class cReplayControl : public cDvbPlayerControl { private: cSkinDisplayReplay *displayReplay; cMarks marks; + bool marksModified; bool visible, modeOnly, shown, displayFrames; int lastCurrent, lastTotal; bool lastPlay, lastForward; diff --git a/plugin.c b/plugin.c index 52256ee..db16d08 100644 --- a/plugin.c +++ b/plugin.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: plugin.c 2.3 2012/03/11 13:56:02 kls Exp $ + * $Id: plugin.c 2.4 2012/09/01 13:10:27 kls Exp $ */ #include "plugin.h" @@ -25,7 +25,9 @@ // --- cPlugin --------------------------------------------------------------- -char *cPlugin::configDirectory = NULL; +cString cPlugin::configDirectory; +cString cPlugin::cacheDirectory; +cString cPlugin::resourceDirectory; cPlugin::cPlugin(void) { @@ -132,8 +134,7 @@ cString cPlugin::SVDRPCommand(const char *Command, const char *Option, int &Repl void cPlugin::SetConfigDirectory(const char *Dir) { - free(configDirectory); - configDirectory = strdup(Dir); + configDirectory = Dir; } const char *cPlugin::ConfigDirectory(const char *PluginName) @@ -141,7 +142,35 @@ const char *cPlugin::ConfigDirectory(const char *PluginName) static cString buffer; if (!cThread::IsMainThread()) esyslog("ERROR: plugin '%s' called cPlugin::ConfigDirectory(), which is not thread safe!", PluginName ? PluginName : ""); - buffer = cString::sprintf("%s/plugins%s%s", configDirectory, PluginName ? "/" : "", PluginName ? PluginName : ""); + buffer = cString::sprintf("%s/plugins%s%s", *configDirectory, PluginName ? "/" : "", PluginName ? PluginName : ""); + return MakeDirs(buffer, true) ? *buffer : NULL; +} + +void cPlugin::SetCacheDirectory(const char *Dir) +{ + cacheDirectory = Dir; +} + +const char *cPlugin::CacheDirectory(const char *PluginName) +{ + static cString buffer; + if (!cThread::IsMainThread()) + esyslog("ERROR: plugin '%s' called cPlugin::CacheDirectory(), which is not thread safe!", PluginName ? PluginName : ""); + buffer = cString::sprintf("%s/plugins%s%s", *cacheDirectory, PluginName ? "/" : "", PluginName ? PluginName : ""); + return MakeDirs(buffer, true) ? *buffer : NULL; +} + +void cPlugin::SetResourceDirectory(const char *Dir) +{ + resourceDirectory = Dir; +} + +const char *cPlugin::ResourceDirectory(const char *PluginName) +{ + static cString buffer; + if (!cThread::IsMainThread()) + esyslog("ERROR: plugin '%s' called cPlugin::ResourceDirectory(), which is not thread safe!", PluginName ? PluginName : ""); + buffer = cString::sprintf("%s/plugins%s%s", *resourceDirectory, PluginName ? "/" : "", PluginName ? PluginName : ""); return MakeDirs(buffer, true) ? *buffer : NULL; } diff --git a/plugin.h b/plugin.h index 684b822..3502741 100644 --- a/plugin.h +++ b/plugin.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: plugin.h 2.1 2012/03/11 13:55:56 kls Exp $ + * $Id: plugin.h 2.2 2012/09/01 13:08:54 kls Exp $ */ #ifndef __PLUGIN_H @@ -21,7 +21,9 @@ class cPlugin { friend class cDll; friend class cPluginManager; private: - static char *configDirectory; + static cString configDirectory; + static cString cacheDirectory; + static cString resourceDirectory; const char *name; bool started; void SetName(const char *s); @@ -57,6 +59,10 @@ public: static void SetConfigDirectory(const char *Dir); static const char *ConfigDirectory(const char *PluginName = NULL); + static void SetCacheDirectory(const char *Dir); + static const char *CacheDirectory(const char *PluginName = NULL); + static void SetResourceDirectory(const char *Dir); + static const char *ResourceDirectory(const char *PluginName = NULL); }; class cDll : public cListObject { diff --git a/po/ar.po b/po/ar.po index ddfc50a..8347285 100644 --- a/po/ar.po +++ b/po/ar.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.7.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2008-10-16 11:16-0400\n" "Last-Translator: Osama Alrawab \n" "Language-Team: Arabic \n" @@ -870,6 +870,18 @@ msgstr "مدة معلومات القناة" msgid "Setup.OSD$Number keys for characters" msgstr "زر اغلاق القاائمة" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "الدليل الالكتونى للقنوات" diff --git a/po/ca_ES.po b/po/ca_ES.po index ce13921..ce863de 100644 --- a/po/ca_ES.po +++ b/po/ca_ES.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2008-03-02 19:02+0100\n" "Last-Translator: Luca Olivetti \n" "Language-Team: Catalan \n" @@ -852,6 +852,18 @@ msgstr "" msgid "Setup.OSD$Number keys for characters" msgstr "" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "Guia de Programes" diff --git a/po/cs_CZ.po b/po/cs_CZ.po index 9619361..96f6b14 100644 --- a/po/cs_CZ.po +++ b/po/cs_CZ.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.7.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2010-05-06 11:00+0200\n" "Last-Translator: Radek Šťastný \n" "Language-Team: Czech \n" @@ -851,6 +851,18 @@ msgstr "Složky v menu časovače" msgid "Setup.OSD$Number keys for characters" msgstr "" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "EPG" diff --git a/po/da_DK.po b/po/da_DK.po index 5a463b9..3615bc7 100644 --- a/po/da_DK.po +++ b/po/da_DK.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2007-08-12 14:17+0200\n" "Last-Translator: Mogens Elneff \n" "Language-Team: Danish \n" @@ -849,6 +849,18 @@ msgstr "" msgid "Setup.OSD$Number keys for characters" msgstr "" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "EPG" diff --git a/po/de_DE.po b/po/de_DE.po index 20a5476..aaa92ea 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2010-01-16 16:46+0100\n" "Last-Translator: Klaus Schmidinger \n" "Language-Team: German \n" @@ -849,6 +849,18 @@ msgstr "Verzeichnisse im Timer-Men msgid "Setup.OSD$Number keys for characters" msgstr "Nummerntasten fr Zeichen" +msgid "Setup.OSD$Color key 0" +msgstr "Farbtaste 0" + +msgid "Setup.OSD$Color key 1" +msgstr "Farbtaste 1" + +msgid "Setup.OSD$Color key 2" +msgstr "Farbtaste 2" + +msgid "Setup.OSD$Color key 3" +msgstr "Farbtaste 3" + msgid "EPG" msgstr "EPG" diff --git a/po/el_GR.po b/po/el_GR.po index d27af7e..42bd8be 100644 --- a/po/el_GR.po +++ b/po/el_GR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2007-08-12 14:17+0200\n" "Last-Translator: Dimitrios Dimitrakos \n" "Language-Team: Greek \n" @@ -849,6 +849,18 @@ msgstr "" msgid "Setup.OSD$Number keys for characters" msgstr "" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr " " diff --git a/po/es_ES.po b/po/es_ES.po index f38ce2f..2bda405 100644 --- a/po/es_ES.po +++ b/po/es_ES.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2008-03-02 19:02+0100\n" "Last-Translator: Luca Olivetti \n" "Language-Team: Spanish \n" @@ -850,6 +850,18 @@ msgstr "" msgid "Setup.OSD$Number keys for characters" msgstr "" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "Gua de Programacin" diff --git a/po/et_EE.po b/po/et_EE.po index b136d37..ddf9a80 100644 --- a/po/et_EE.po +++ b/po/et_EE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2007-08-12 14:17+0200\n" "Last-Translator: Arthur Konovalov \n" "Language-Team: Estonian \n" @@ -849,6 +849,18 @@ msgstr "Kaustad taimeri menüüs" msgid "Setup.OSD$Number keys for characters" msgstr "Teksti sisestamine numbriklahvidega" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "EPG" diff --git a/po/fi_FI.po b/po/fi_FI.po index aa76eef..11a74ad 100644 --- a/po/fi_FI.po +++ b/po/fi_FI.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2007-08-15 15:52+0200\n" "Last-Translator: Rolf Ahrenberg \n" "Language-Team: Finnish \n" @@ -852,6 +852,18 @@ msgstr "Näytä kansiot ajastinvalikossa" msgid "Setup.OSD$Number keys for characters" msgstr "Käytä numeronäppäimiä tekstisyötteessä" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "Ohjelmaopas" @@ -1123,7 +1135,7 @@ msgid "Setup.Miscellaneous$Channels wrap" msgstr "Kanavien rullaus" msgid "Setup.Miscellaneous$Show channel names with source" -msgstr "" +msgstr "Näytä lähde kanavien nimissä" msgid "Setup.Miscellaneous$Emergency exit" msgstr "Käytä hätäsammutusta" diff --git a/po/fr_FR.po b/po/fr_FR.po index 451cf56..5d65eaa 100644 --- a/po/fr_FR.po +++ b/po/fr_FR.po @@ -13,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2008-02-27 18:14+0100\n" "Last-Translator: Jean-Claude Repetto \n" "Language-Team: French \n" @@ -855,6 +855,18 @@ msgstr "" msgid "Setup.OSD$Number keys for characters" msgstr "" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "Guide des programmes" diff --git a/po/hr_HR.po b/po/hr_HR.po index 6fddf87..b7b8983 100644 --- a/po/hr_HR.po +++ b/po/hr_HR.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2008-03-17 19:00+0100\n" "Last-Translator: Adrian Caval \n" "Language-Team: Croatian \n" @@ -851,6 +851,18 @@ msgstr "" msgid "Setup.OSD$Number keys for characters" msgstr "" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "EPG (elektronski programski vodi)" diff --git a/po/hu_HU.po b/po/hu_HU.po index 71047a3..58cf9ce 100644 --- a/po/hu_HU.po +++ b/po/hu_HU.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2012-01-02 11:54+0200\n" "Last-Translator: Istvn Fley \n" "Language-Team: Hungarian \n" @@ -852,6 +852,18 @@ msgstr "K msgid "Setup.OSD$Number keys for characters" msgstr "Szmgombok a betkn" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "EPG" diff --git a/po/it_IT.po b/po/it_IT.po index 03cfbe1..59b763f 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2012-06-06 22:50+0100\n" "Last-Translator: Diego Pierotto \n" "Language-Team: Italian \n" @@ -856,6 +856,18 @@ msgstr "Cartelle nel menu timer" msgid "Setup.OSD$Number keys for characters" msgstr "Tasti numerici per i caratteri" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "Guida programmi EPG" diff --git a/po/lt_LT.po b/po/lt_LT.po index 98b8a68..d9bf213 100644 --- a/po/lt_LT.po +++ b/po/lt_LT.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.7.16\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2010-10-30 11:55+0200\n" "Last-Translator: Valdemaras Pipiras \n" "Language-Team: Lithuanian \n" @@ -849,6 +849,18 @@ msgstr "Katalogai esantys laikmačių meniu" msgid "Setup.OSD$Number keys for characters" msgstr "Skaičių mygtukai simboliams" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "Elektroninis programų gidas (EPG)" diff --git a/po/mk_MK.po b/po/mk_MK.po index a767aca..46d9419 100644 --- a/po/mk_MK.po +++ b/po/mk_MK.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR-1.7.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2010-03-11 00:54+0100\n" "Last-Translator: Dimitar Petrovski \n" "Language-Team: Macedonian \n" @@ -850,6 +850,18 @@ msgstr "Директориуми во менито за тајмер" msgid "Setup.OSD$Number keys for characters" msgstr "" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "EPG (електронски водич на програми)" diff --git a/po/nl_NL.po b/po/nl_NL.po index a312fdc..df75d23 100644 --- a/po/nl_NL.po +++ b/po/nl_NL.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2008-02-26 17:20+0100\n" "Last-Translator: Johan Schuring \n" "Language-Team: Dutch \n" @@ -853,6 +853,18 @@ msgstr "" msgid "Setup.OSD$Number keys for characters" msgstr "" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "EPG" diff --git a/po/nn_NO.po b/po/nn_NO.po index 2612be2..f221214 100644 --- a/po/nn_NO.po +++ b/po/nn_NO.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2007-08-12 14:17+0200\n" "Last-Translator: Truls Slevigen \n" "Language-Team: Norwegian Nynorsk \n" @@ -850,6 +850,18 @@ msgstr "" msgid "Setup.OSD$Number keys for characters" msgstr "" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "Programoversikt" diff --git a/po/pl_PL.po b/po/pl_PL.po index 166b35b..1913389 100644 --- a/po/pl_PL.po +++ b/po/pl_PL.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2008-03-09 12:59+0100\n" "Last-Translator: Michael Rakowski \n" "Language-Team: Polish \n" @@ -850,6 +850,18 @@ msgstr "" msgid "Setup.OSD$Number keys for characters" msgstr "" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "EPG" diff --git a/po/pt_PT.po b/po/pt_PT.po index da11c07..11fdb4c 100644 --- a/po/pt_PT.po +++ b/po/pt_PT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.7.15\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2010-03-28 22:49+0100\n" "Last-Translator: Cris Silva \n" "Language-Team: Portuguese \n" @@ -850,6 +850,18 @@ msgstr "Pastas no menu de grava msgid "Setup.OSD$Number keys for characters" msgstr "Teclas numricas para caracteres" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "Guia de Programao" diff --git a/po/ro_RO.po b/po/ro_RO.po index 3f6d1e1..40571e5 100644 --- a/po/ro_RO.po +++ b/po/ro_RO.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.7.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2011-03-10 23:52+0100\n" "Last-Translator: Lucian Muresan \n" "Language-Team: Romanian \n" @@ -852,6 +852,18 @@ msgstr "Directoare msgid "Setup.OSD$Number keys for characters" msgstr "Caractere pe tastele numerice" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "EPG" diff --git a/po/ru_RU.po b/po/ru_RU.po index 4ed7801..f159d1e 100644 --- a/po/ru_RU.po +++ b/po/ru_RU.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2008-12-15 14:37+0100\n" "Last-Translator: Oleg Roitburd \n" "Language-Team: Russian \n" @@ -850,6 +850,18 @@ msgstr "" msgid "Setup.OSD$Number keys for characters" msgstr "" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "" diff --git a/po/sk_SK.po b/po/sk_SK.po index 069fd55..fc75998 100644 --- a/po/sk_SK.po +++ b/po/sk_SK.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.7.16\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2011-02-15 16:29+0100\n" "Last-Translator: Milan Hrala \n" "Language-Team: Slovak \n" @@ -849,6 +849,18 @@ msgstr "Zlo msgid "Setup.OSD$Number keys for characters" msgstr "seln tlaidl pre znaky" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "EPG" diff --git a/po/sl_SI.po b/po/sl_SI.po index 5bb6b9b..95a45df 100644 --- a/po/sl_SI.po +++ b/po/sl_SI.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2008-02-28 19:44+0100\n" "Last-Translator: Matjaz Thaler \n" "Language-Team: Slovenian \n" @@ -850,6 +850,18 @@ msgstr "" msgid "Setup.OSD$Number keys for characters" msgstr "" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "Programski vodnik" diff --git a/po/sr_SR.po b/po/sr_SR.po index 4be71c5..0e6f9cd 100644 --- a/po/sr_SR.po +++ b/po/sr_SR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.7.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2011-01-09 15:57+0100\n" "Last-Translator: Milan Cvijanovi \n" "Language-Team: Serbian \n" @@ -867,6 +867,18 @@ msgstr "Direktoriji u tajmer meni-ju " msgid "Setup.OSD$Number keys for characters" msgstr "Number keys for characters" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "EPG (TV Raspored)" diff --git a/po/sv_SE.po b/po/sv_SE.po index 4e99893..aa66721 100644 --- a/po/sv_SE.po +++ b/po/sv_SE.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2008-03-12 18:25+0100\n" "Last-Translator: Magnus Andersson \n" "Language-Team: Swedish \n" @@ -852,6 +852,18 @@ msgstr "" msgid "Setup.OSD$Number keys for characters" msgstr "" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "EPG" diff --git a/po/tr_TR.po b/po/tr_TR.po index d38761a..e4acde3 100644 --- a/po/tr_TR.po +++ b/po/tr_TR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2008-02-28 00:33+0100\n" "Last-Translator: Oktay Yolgeen \n" "Language-Team: Turkish \n" @@ -849,6 +849,18 @@ msgstr "" msgid "Setup.OSD$Number keys for characters" msgstr "" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "EPG" diff --git a/po/uk_UA.po b/po/uk_UA.po index 5ec4a0b..62b5fc6 100644 --- a/po/uk_UA.po +++ b/po/uk_UA.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.7.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2010-04-25 16:35+0200\n" "Last-Translator: Yarema aka Knedlyk \n" "Language-Team: Ukrainian \n" @@ -849,6 +849,18 @@ msgstr "Каталоги в меню таймера" msgid "Setup.OSD$Number keys for characters" msgstr "" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "Телегід (EPG)" diff --git a/po/zh_CN.po b/po/zh_CN.po index 0c1e18b..2277a94 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-17 13:59+0200\n" +"POT-Creation-Date: 2012-09-09 15:20+0200\n" "PO-Revision-Date: 2009-09-23 23:50+0800\n" "Last-Translator: Nan Feng \n" "Language-Team: Chinese (simplified) \n" @@ -852,6 +852,18 @@ msgstr "" msgid "Setup.OSD$Number keys for characters" msgstr "" +msgid "Setup.OSD$Color key 0" +msgstr "" + +msgid "Setup.OSD$Color key 1" +msgstr "" + +msgid "Setup.OSD$Color key 2" +msgstr "" + +msgid "Setup.OSD$Color key 3" +msgstr "" + msgid "EPG" msgstr "电子节目单设置" diff --git a/receiver.h b/receiver.h index eb2f32a..775dabd 100644 --- a/receiver.h +++ b/receiver.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: receiver.h 2.8 2012/06/02 13:20:44 kls Exp $ + * $Id: receiver.h 2.9 2012/09/02 09:27:20 kls Exp $ */ #ifndef __RECEIVER_H @@ -27,7 +27,7 @@ protected: void Detach(void); virtual void Activate(bool On) {} ///< This function is called just before the cReceiver gets attached to - ///< (On == true) or detached from (On == false) a cDevice. It can be used + ///< (On == true) and right after it gets detached from (On == false) a cDevice. It can be used ///< to do things like starting/stopping a thread. ///< It is guaranteed that Receive() will not be called before Activate(true). virtual void Receive(uchar *Data, int Length) = 0; diff --git a/recording.c b/recording.c index d13225b..9c80505 100644 --- a/recording.c +++ b/recording.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recording.c 2.57 2012/06/09 13:57:30 kls Exp $ + * $Id: recording.c 2.60 2012/09/06 09:57:31 kls Exp $ */ #include "recording.h" @@ -831,8 +831,8 @@ char *cRecording::SortName(void) const { char **sb = (RecordingsSortMode == rsmName) ? &sortBufferName : &sortBufferTime; if (!*sb) { - char *s = (RecordingsSortMode == rsmName) ? strdup(FileName() + strlen(VideoDirectory) + 1) - : StripEpisodeName(strdup(FileName() + strlen(VideoDirectory) + 1)); + char *s = (RecordingsSortMode == rsmName) ? strdup(FileName() + strlen(VideoDirectory)) + : StripEpisodeName(strdup(FileName() + strlen(VideoDirectory))); strreplace(s, '/', 'a'); // some locales ignore '/' when sorting int l = strxfrm(NULL, s, 0) + 1; *sb = MALLOC(char, l); @@ -1067,7 +1067,7 @@ int cRecording::NumFrames(void) const { if (numFrames < 0) { int nf = cIndexFile::GetLength(FileName(), IsPesRecording()); - if (time(NULL) - LastModifiedTime(FileName()) < MININDEXAGE) + if (time(NULL) - LastModifiedTime(cIndexFile::IndexFileName(FileName(), IsPesRecording())) < MININDEXAGE) return nf; // check again later for ongoing recordings numFrames = nf; } @@ -1086,7 +1086,7 @@ int cRecording::FileSizeMB(void) const { if (fileSizeMB < 0) { int fs = DirSizeMB(FileName()); - if (time(NULL) - LastModifiedTime(FileName()) < MININDEXAGE) + if (time(NULL) - LastModifiedTime(cIndexFile::IndexFileName(FileName(), IsPesRecording())) < MININDEXAGE) return fs; // check again later for ongoing recordings fileSizeMB = fs; } @@ -1607,6 +1607,9 @@ struct tIndexTs { #define INDEXFILECHECKINTERVAL 500 // ms between checks for existence of the regenerated index file #define INDEXFILETESTINTERVAL 10 // ms between tests for the size of the index file in case of pausing live video +cMutex cIndexFile::indexListMutex; +cVector cIndexFile::indexList; + cIndexFile::cIndexFile(const char *FileName, bool Record, bool IsPesRecording, bool PauseLive) :resumeFile(FileName, IsPesRecording) { @@ -1687,10 +1690,13 @@ cIndexFile::cIndexFile(const char *FileName, bool Record, bool IsPesRecording, b LOG_ERROR_STR(*fileName); } } + if (Record) + AddToIndexList(this); } cIndexFile::~cIndexFile() { + RemoveFromIndexList(this); if (f >= 0) close(f); free(index); @@ -1735,8 +1741,7 @@ bool cIndexFile::CatchUp(int Index) for (int i = 0; i <= MAXINDEXCATCHUP && (Index < 0 || Index >= last); i++) { struct stat buf; if (fstat(f, &buf) == 0) { - if (time(NULL) - buf.st_mtime > MININDEXAGE) { - // apparently the index file is not being written any more + if (!IsInIndexList(this)) { close(f); f = -1; break; @@ -1902,6 +1907,39 @@ int cIndexFile::GetLength(const char *FileName, bool IsPesRecording) return -1; } +void cIndexFile::AddToIndexList(const cIndexFile *IndexFile) +{ + cMutexLock MutexLock(&indexListMutex); + for (int i = 0; i < indexList.Size(); i++) { + if (!indexList[i]) { + indexList[i] = IndexFile; + return; + } + } + indexList.Append(IndexFile); +} + +void cIndexFile::RemoveFromIndexList(const cIndexFile *IndexFile) +{ + cMutexLock MutexLock(&indexListMutex); + for (int i = 0; i < indexList.Size(); i++) { + if (indexList[i] == IndexFile) { + indexList[i] = NULL; + return; + } + } +} + +bool cIndexFile::IsInIndexList(const cIndexFile *IndexFile) +{ + cMutexLock MutexLock(&indexListMutex); + for (int i = 0; i < indexList.Size(); i++) { + if (indexList[i] && !strcmp(indexList[i]->fileName, IndexFile->fileName)) + return true; + } + return false; +} + bool GenerateIndex(const char *FileName) { if (DirectoryOk(FileName)) { diff --git a/recording.h b/recording.h index 8e71230..84a23b3 100644 --- a/recording.h +++ b/recording.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recording.h 2.34 2012/06/09 13:55:22 kls Exp $ + * $Id: recording.h 2.36 2012/09/06 09:59:11 kls Exp $ */ #ifndef __RECORDING_H @@ -275,7 +275,11 @@ private: cResumeFile resumeFile; cIndexFileGenerator *indexFileGenerator; cMutex mutex; - static cString IndexFileName(const char *FileName, bool IsPesRecording); + static cMutex indexListMutex; + static cVector indexList; + static void AddToIndexList(const cIndexFile *IndexFile); + static void RemoveFromIndexList(const cIndexFile *IndexFile); + static bool IsInIndexList(const cIndexFile *IndexFile); void ConvertFromPes(tIndexTs *IndexTs, int Count); void ConvertToPes(tIndexTs *IndexTs, int Count); bool CatchUp(int Index = -1); @@ -295,6 +299,7 @@ public: static int GetLength(const char *FileName, bool IsPesRecording = false); ///< Calculates the recording length (number of frames) without actually reading the index file. ///< Returns -1 in case of error. + static cString IndexFileName(const char *FileName, bool IsPesRecording); }; class cFileName { diff --git a/sections.c b/sections.c index 6b9cbe2..c9ed0c1 100644 --- a/sections.c +++ b/sections.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: sections.c 2.0 2007/10/14 12:52:07 kls Exp $ + * $Id: sections.c 2.1 2012/08/26 12:53:39 kls Exp $ */ #include "sections.h" @@ -198,7 +198,7 @@ void cSectionHandler::Action(void) if (fh) { // Read section data: unsigned char buf[4096]; // max. allowed size for any EIT section - int r = safe_read(fh->handle, buf, sizeof(buf)); + int r = device->ReadFilter(fh->handle, buf, sizeof(buf)); if (!DeviceHasLock) continue; // we do the read anyway, to flush any data that might have come from a different transponder if (r > 3) { // minimum number of bytes necessary to get section length diff --git a/skinclassic.c b/skinclassic.c index 64944de..9aac095 100644 --- a/skinclassic.c +++ b/skinclassic.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: skinclassic.c 2.7 2012/04/23 08:48:03 kls Exp $ + * $Id: skinclassic.c 2.8 2012/09/09 11:39:06 kls Exp $ */ #include "skinclassic.h" @@ -291,16 +291,19 @@ void cSkinClassicDisplayMenu::SetTitle(const char *Title) void cSkinClassicDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue) { const cFont *font = cFont::GetFont(fontOsd); + const char *lutText[] = { Red, Green, Yellow, Blue }; + tColor lutFg[] = { clrButtonRedFg, clrButtonGreenFg, clrButtonYellowFg, clrButtonBlueFg }; + tColor lutBg[] = { clrButtonRedBg, clrButtonGreenBg, clrButtonYellowBg, clrButtonBlueBg }; int w = x3 - x0; int t0 = x0; int t1 = x0 + w / 4; int t2 = x0 + w / 2; int t3 = x3 - w / 4; int t4 = x3; - osd->DrawText(t0, y4, Red, Theme.Color(clrButtonRedFg), Red ? Theme.Color(clrButtonRedBg) : Theme.Color(clrBackground), font, t1 - t0, 0, taCenter); - osd->DrawText(t1, y4, Green, Theme.Color(clrButtonGreenFg), Green ? Theme.Color(clrButtonGreenBg) : Theme.Color(clrBackground), font, t2 - t1, 0, taCenter); - osd->DrawText(t2, y4, Yellow, Theme.Color(clrButtonYellowFg), Yellow ? Theme.Color(clrButtonYellowBg) : Theme.Color(clrBackground), font, t3 - t2, 0, taCenter); - osd->DrawText(t3, y4, Blue, Theme.Color(clrButtonBlueFg), Blue ? Theme.Color(clrButtonBlueBg) : Theme.Color(clrBackground), font, t4 - t3, 0, taCenter); + osd->DrawText(t0, y4, lutText[Setup.ColorKey0], Theme.Color(lutFg[Setup.ColorKey0]), lutText[Setup.ColorKey0] ? Theme.Color(lutBg[Setup.ColorKey0]) : Theme.Color(clrBackground), font, t1 - t0, 0, taCenter); + osd->DrawText(t1, y4, lutText[Setup.ColorKey1], Theme.Color(lutFg[Setup.ColorKey1]), lutText[Setup.ColorKey1] ? Theme.Color(lutBg[Setup.ColorKey1]) : Theme.Color(clrBackground), font, t2 - t1, 0, taCenter); + osd->DrawText(t2, y4, lutText[Setup.ColorKey2], Theme.Color(lutFg[Setup.ColorKey2]), lutText[Setup.ColorKey2] ? Theme.Color(lutBg[Setup.ColorKey2]) : Theme.Color(clrBackground), font, t3 - t2, 0, taCenter); + osd->DrawText(t3, y4, lutText[Setup.ColorKey3], Theme.Color(lutFg[Setup.ColorKey3]), lutText[Setup.ColorKey3] ? Theme.Color(lutBg[Setup.ColorKey3]) : Theme.Color(clrBackground), font, t4 - t3, 0, taCenter); } void cSkinClassicDisplayMenu::SetMessage(eMessageType Type, const char *Text) diff --git a/skinlcars.c b/skinlcars.c index 5937efe..39d0374 100644 --- a/skinlcars.c +++ b/skinlcars.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: skinlcars.c 2.13 2012/06/13 13:27:31 kls Exp $ + * $Id: skinlcars.c 2.14 2012/09/09 12:16:50 kls Exp $ */ // "Star Trek: The Next Generation"(R) is a registered trademark of Paramount Pictures, @@ -975,10 +975,11 @@ void cSkinLCARSDisplayMenu::DrawMenuFrame(void) osd->DrawEllipse (xa08 + lineHeight / 2, yb14, xa09 - 1, yb15 - 1, frameColor, 5); osd->DrawText(xa00, yb10, "VDR", Theme.Color(clrMenuFrameFg), frameColor, tallFont, xa02 - xa00, yb11 - yb10, taTop | taRight | taBorder); // Color buttons: - osd->DrawRectangle(xb00, yb14, xb01 - 1, yb15 - 1, Theme.Color(clrButtonRedBg)); - osd->DrawRectangle(xb04, yb14, xb05 - 1, yb15 - 1, Theme.Color(clrButtonGreenBg)); - osd->DrawRectangle(xb08, yb14, xb09 - 1, yb15 - 1, Theme.Color(clrButtonYellowBg)); - osd->DrawRectangle(xb12, yb14, xb13 - 1, yb15 - 1, Theme.Color(clrButtonBlueBg)); + tColor lutBg[] = { clrButtonRedBg, clrButtonGreenBg, clrButtonYellowBg, clrButtonBlueBg }; + osd->DrawRectangle(xb00, yb14, xb01 - 1, yb15 - 1, Theme.Color(lutBg[Setup.ColorKey0])); + osd->DrawRectangle(xb04, yb14, xb05 - 1, yb15 - 1, Theme.Color(lutBg[Setup.ColorKey1])); + osd->DrawRectangle(xb08, yb14, xb09 - 1, yb15 - 1, Theme.Color(lutBg[Setup.ColorKey2])); + osd->DrawRectangle(xb12, yb14, xb13 - 1, yb15 - 1, Theme.Color(lutBg[Setup.ColorKey3])); } void cSkinLCARSDisplayMenu::DrawDate(void) @@ -1458,19 +1459,22 @@ void cSkinLCARSDisplayMenu::SetTitle(const char *Title) void cSkinLCARSDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue) { + const char *lutText[] = { Red, Green, Yellow, Blue }; + tColor lutFg[] = { clrButtonRedFg, clrButtonGreenFg, clrButtonYellowFg, clrButtonBlueFg }; + tColor lutBg[] = { clrButtonRedBg, clrButtonGreenBg, clrButtonYellowBg, clrButtonBlueBg }; const cFont *font = cFont::GetFont(fontSml); if (MenuCategory() == mcMain) { - DrawMainButton(Red, xd00, xd01, xd02, xd03, yd02, yd03, Theme.Color(clrButtonRedFg), Theme.Color(clrButtonRedBg), font); - DrawMainButton(Green, xd04, xd05, xd06, xd07, yd02, yd03, Theme.Color(clrButtonGreenFg), Theme.Color(clrButtonGreenBg), font); - DrawMainButton(Yellow, xd00, xd01, xd02, xd03, yd04, yd05, Theme.Color(clrButtonYellowFg), Theme.Color(clrButtonYellowBg), font); - DrawMainButton(Blue, xd04, xd05, xd06, xd07, yd04, yd05, Theme.Color(clrButtonBlueFg), Theme.Color(clrButtonBlueBg), font); + DrawMainButton(lutText[Setup.ColorKey0], xd00, xd01, xd02, xd03, yd02, yd03, Theme.Color(lutFg[Setup.ColorKey0]), Theme.Color(lutBg[Setup.ColorKey0]), font); + DrawMainButton(lutText[Setup.ColorKey1], xd04, xd05, xd06, xd07, yd02, yd03, Theme.Color(lutFg[Setup.ColorKey1]), Theme.Color(lutBg[Setup.ColorKey1]), font); + DrawMainButton(lutText[Setup.ColorKey2], xd00, xd01, xd02, xd03, yd04, yd05, Theme.Color(lutFg[Setup.ColorKey2]), Theme.Color(lutBg[Setup.ColorKey2]), font); + DrawMainButton(lutText[Setup.ColorKey3], xd04, xd05, xd06, xd07, yd04, yd05, Theme.Color(lutFg[Setup.ColorKey3]), Theme.Color(lutBg[Setup.ColorKey3]), font); } else { int h = yb15 - yb14; - osd->DrawText(xb02, yb14, Red, Theme.Color(clrButtonRedFg), Theme.Color(clrButtonRedBg), font, xb03 - xb02, h, taLeft | taBorder); - osd->DrawText(xb06, yb14, Green, Theme.Color(clrButtonGreenFg), Theme.Color(clrButtonGreenBg), font, xb07 - xb06, h, taLeft | taBorder); - osd->DrawText(xb10, yb14, Yellow, Theme.Color(clrButtonYellowFg), Theme.Color(clrButtonYellowBg), font, xb11 - xb10, h, taLeft | taBorder); - osd->DrawText(xb14, yb14, Blue, Theme.Color(clrButtonBlueFg), Theme.Color(clrButtonBlueBg), font, xb15 - xb14, h, taLeft | taBorder); + osd->DrawText(xb02, yb14, lutText[Setup.ColorKey0], Theme.Color(lutFg[Setup.ColorKey0]), Theme.Color(lutBg[Setup.ColorKey0]), font, xb03 - xb02, h, taLeft | taBorder); + osd->DrawText(xb06, yb14, lutText[Setup.ColorKey1], Theme.Color(lutFg[Setup.ColorKey1]), Theme.Color(lutBg[Setup.ColorKey1]), font, xb07 - xb06, h, taLeft | taBorder); + osd->DrawText(xb10, yb14, lutText[Setup.ColorKey2], Theme.Color(lutFg[Setup.ColorKey2]), Theme.Color(lutBg[Setup.ColorKey2]), font, xb11 - xb10, h, taLeft | taBorder); + osd->DrawText(xb14, yb14, lutText[Setup.ColorKey3], Theme.Color(lutFg[Setup.ColorKey3]), Theme.Color(lutBg[Setup.ColorKey3]), font, xb15 - xb14, h, taLeft | taBorder); } } diff --git a/skinlcars.h b/skinlcars.h index 7306d12..71117f6 100644 --- a/skinlcars.h +++ b/skinlcars.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: skinlcars.h 1.1 2012/04/15 13:17:35 kls Exp $ + * $Id: skinlcars.h 2.1 2012/04/15 13:17:35 kls Exp $ */ #ifndef __SKINLCARS_H diff --git a/skinsttng.c b/skinsttng.c index d985538..94f5408 100644 --- a/skinsttng.c +++ b/skinsttng.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: skinsttng.c 2.15 2012/04/23 08:39:11 kls Exp $ + * $Id: skinsttng.c 2.16 2012/09/09 11:39:06 kls Exp $ */ // "Star Trek: The Next Generation"(R) is a registered trademark of Paramount Pictures @@ -571,6 +571,9 @@ void cSkinSTTNGDisplayMenu::SetTitle(const char *Title) void cSkinSTTNGDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue) { + const char *lutText[] = { Red, Green, Yellow, Blue }; + tColor lutFg[] = { clrButtonRedFg, clrButtonGreenFg, clrButtonYellowFg, clrButtonBlueFg }; + tColor lutBg[] = { clrButtonRedBg, clrButtonGreenBg, clrButtonYellowBg, clrButtonBlueBg }; cString date = DayDateTime(); const cFont *font = cFont::GetFont(fontSml); int d = 2 * Gap; @@ -585,10 +588,10 @@ void cSkinSTTNGDisplayMenu::SetButtons(const char *Red, const char *Green, const osd->DrawRectangle(t1 + d2, y6, t2 - d2, y7 - 1, clrBlack); osd->DrawRectangle(t2 + d2, y6, t3 - d2, y7 - 1, clrBlack); osd->DrawRectangle(t3 + d2, y6, t4 - d2, y7 - 1, clrBlack); - osd->DrawText(t0 + d, y6, Red, Theme.Color(clrButtonRedFg), Theme.Color(clrButtonRedBg), font, t1 - t0 - 2 * d, 0, taCenter); - osd->DrawText(t1 + d, y6, Green, Theme.Color(clrButtonGreenFg), Theme.Color(clrButtonGreenBg), font, t2 - t1 - 2 * d, 0, taCenter); - osd->DrawText(t2 + d, y6, Yellow, Theme.Color(clrButtonYellowFg), Theme.Color(clrButtonYellowBg), font, t3 - t2 - 2 * d, 0, taCenter); - osd->DrawText(t3 + d, y6, Blue, Theme.Color(clrButtonBlueFg), Theme.Color(clrButtonBlueBg), font, t4 - t3 - 2 * d, 0, taCenter); + osd->DrawText(t0 + d, y6, lutText[Setup.ColorKey0], Theme.Color(lutFg[Setup.ColorKey0]), Theme.Color(lutBg[Setup.ColorKey0]), font, t1 - t0 - 2 * d, 0, taCenter); + osd->DrawText(t1 + d, y6, lutText[Setup.ColorKey1], Theme.Color(lutFg[Setup.ColorKey1]), Theme.Color(lutBg[Setup.ColorKey1]), font, t2 - t1 - 2 * d, 0, taCenter); + osd->DrawText(t2 + d, y6, lutText[Setup.ColorKey2], Theme.Color(lutFg[Setup.ColorKey2]), Theme.Color(lutBg[Setup.ColorKey2]), font, t3 - t2 - 2 * d, 0, taCenter); + osd->DrawText(t3 + d, y6, lutText[Setup.ColorKey3], Theme.Color(lutFg[Setup.ColorKey3]), Theme.Color(lutBg[Setup.ColorKey3]), font, t4 - t3 - 2 * d, 0, taCenter); } void cSkinSTTNGDisplayMenu::SetMessage(eMessageType Type, const char *Text) diff --git a/tools.c b/tools.c index bc01a5f..3d9c513 100644 --- a/tools.c +++ b/tools.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: tools.c 2.24 2012/05/12 13:29:20 kls Exp $ + * $Id: tools.c 2.25 2012/08/21 10:34:37 kls Exp $ */ #include "tools.h" @@ -435,6 +435,7 @@ bool RemoveFileOrDir(const char *FileName, bool FollowSymlinks) bool RemoveEmptyDirectories(const char *DirName, bool RemoveThis) { + bool HasDotFiles = false; cReadDir d(DirName); if (d.Ok()) { bool empty = true; @@ -448,6 +449,8 @@ bool RemoveEmptyDirectories(const char *DirName, bool RemoveThis) if (!RemoveEmptyDirectories(buffer, true)) empty = false; } + else if (*e->d_name == '.') // "dot files" don't count + HasDotFiles = true; else empty = false; } @@ -458,6 +461,22 @@ bool RemoveEmptyDirectories(const char *DirName, bool RemoveThis) } } if (RemoveThis && empty) { + if (HasDotFiles) { + cReadDir d(DirName); + if (d.Ok()) { + struct dirent *e; + while ((e = d.Next()) != NULL) { + if (*e->d_name == '.') { // for safety - should always be true + cString buffer = AddDirectory(DirName, e->d_name); + dsyslog("removing %s", *buffer); + if (remove(buffer) < 0) { + LOG_ERROR_STR(*buffer); + return false; + } + } + } + } + } dsyslog("removing %s", DirName); if (remove(DirName) < 0) { LOG_ERROR_STR(DirName); diff --git a/vdr.1 b/vdr.1 index b900b4e..d22c4e9 100644 --- a/vdr.1 +++ b/vdr.1 @@ -8,7 +8,7 @@ .\" License as specified in the file COPYING that comes with the .\" vdr distribution. .\" -.\" $Id: vdr.1 2.8 2012/02/27 11:01:17 kls Exp $ +.\" $Id: vdr.1 2.9 2012/09/01 13:40:49 kls Exp $ .\" .TH vdr 1 "10 Feb 2008" "1.6" "Video Disk Recorder" .SH NAME @@ -42,6 +42,10 @@ which can be accessed on port 6419, for instance by \fBtelnet\fR. .BI \-a\ cmd ,\ \-\-audio= cmd Send Dolby Digital audio to stdin of command \fIcmd\fR. .TP +.BI \-\-cachedir= dir +save cache files in \fIdir\fR +(default is to save them in the video directory). +.TP .BI \-c\ dir ,\ \-\-config= dir Read config files from directory \fIdir\fR (default is to read them from the video directory). @@ -157,6 +161,10 @@ particular options) you can use Call \fIcmd\fR before and after a recording. See the file \fIINSTALL\fR for more information. .TP +.BI \-\-resdir= dir +read resource files from \fIdir\fR +(default is to read them from the config directory). +.TP .BI \-s\ cmd ,\ \-\-shutdown= cmd Call \fIcmd\fR to shutdown the computer. See the file \fIINSTALL\fR for more information. diff --git a/vdr.c b/vdr.c index c075dbe..f5896ca 100644 --- a/vdr.c +++ b/vdr.c @@ -22,7 +22,7 @@ * * The project's page is at http://www.tvdr.de * - * $Id: vdr.c 2.37 2012/06/13 11:28:41 kls Exp $ + * $Id: vdr.c 2.38 2012/09/01 13:30:19 kls Exp $ */ #include @@ -178,10 +178,15 @@ int main(int argc, char *argv[]) // Command line options: +#define dd(a, b) (*a ? a : b) #define DEFAULTSVDRPPORT 6419 #define DEFAULTWATCHDOG 0 // seconds -#define DEFAULTCONFDIR CONFDIR +#define DEFAULTVIDEODIR VIDEODIR +#define DEFAULTCONFDIR dd(CONFDIR, VideoDirectory) +#define DEFAULTCACHEDIR dd(CACHEDIR, VideoDirectory) +#define DEFAULTRESDIR dd(RESDIR, ConfigDirectory) #define DEFAULTPLUGINDIR PLUGINDIR +#define DEFAULTLOCDIR LOCDIR #define DEFAULTEPGDATAFILENAME "epg.data" bool StartedAsRoot = false; @@ -189,7 +194,11 @@ int main(int argc, char *argv[]) bool UserDump = false; int SVDRPport = DEFAULTSVDRPPORT; const char *AudioCommand = NULL; + const char *VideoDirectory = DEFAULTVIDEODIR; const char *ConfigDirectory = NULL; + const char *CacheDirectory = NULL; + const char *ResourceDirectory = NULL; + const char *LocaleDirectory = DEFAULTLOCDIR; const char *EpgDataFileName = DEFAULTEPGDATAFILENAME; bool DisplayHelp = false; bool DisplayVersion = false; @@ -198,7 +207,6 @@ int main(int argc, char *argv[]) bool MuteAudio = false; int WatchdogTimeout = DEFAULTWATCHDOG; const char *Terminal = NULL; - const char *LocaleDir = NULL; bool UseKbd = true; const char *LircDevice = NULL; @@ -216,6 +224,7 @@ int main(int argc, char *argv[]) static struct option long_options[] = { { "audio", required_argument, NULL, 'a' }, + { "cachedir", required_argument, NULL, 'c' | 0x100 }, { "config", required_argument, NULL, 'c' }, { "daemon", no_argument, NULL, 'd' }, { "device", required_argument, NULL, 'D' }, @@ -235,6 +244,7 @@ int main(int argc, char *argv[]) { "plugin", required_argument, NULL, 'P' }, { "port", required_argument, NULL, 'p' }, { "record", required_argument, NULL, 'r' }, + { "resdir", required_argument, NULL, 'r' | 0x100 }, { "shutdown", required_argument, NULL, 's' }, { "split", no_argument, NULL, 's' | 0x100 }, { "terminal", required_argument, NULL, 't' }, @@ -252,6 +262,9 @@ int main(int argc, char *argv[]) switch (c) { case 'a': AudioCommand = optarg; break; + case 'c' | 0x100: + CacheDirectory = optarg; + break; case 'c': ConfigDirectory = optarg; break; case 'd': DaemonMode = true; break; @@ -327,7 +340,7 @@ int main(int argc, char *argv[]) break; case 'l' | 0x200: if (access(optarg, R_OK | X_OK) == 0) - LocaleDir = optarg; + LocaleDirectory = optarg; else { fprintf(stderr, "vdr: can't access locale directory: %s\n", optarg); return 2; @@ -349,6 +362,9 @@ int main(int argc, char *argv[]) break; case 'r': cRecordingUserCommand::SetCommand(optarg); break; + case 'r' | 0x100: + ResourceDirectory = optarg; + break; case 's': ShutdownHandler.SetShutdownCommand(optarg); break; case 's' | 0x100: @@ -414,6 +430,7 @@ int main(int argc, char *argv[]) if (DisplayHelp) { printf("Usage: vdr [OPTIONS]\n\n" // for easier orientation, this is column 80| " -a CMD, --audio=CMD send Dolby Digital audio to stdin of command CMD\n" + " --cachedir=DIR save cache files in DIR (default: %s)\n" " -c DIR, --config=DIR read config files from DIR (default: %s)\n" " -d, --daemon run in daemon mode\n" " -D NUM, --device=NUM use only the given DVB device (NUM = 0, 1, 2...)\n" @@ -450,6 +467,7 @@ int main(int argc, char *argv[]) " 0 turns off SVDRP\n" " -P OPT, --plugin=OPT load a plugin defined by the given options\n" " -r CMD, --record=CMD call CMD before and after a recording\n" + " --resdir=DIR read resource files from DIR (default: %s)\n" " -s CMD, --shutdown=CMD call CMD to shutdown the computer\n" " --split split edited files at the editing marks (only\n" " useful in conjunction with --edit)\n" @@ -464,14 +482,16 @@ int main(int argc, char *argv[]) " -w SEC, --watchdog=SEC activate the watchdog timer with a timeout of SEC\n" " seconds (default: %d); '0' disables the watchdog\n" "\n", + DEFAULTCACHEDIR, DEFAULTCONFDIR, DEFAULTEPGDATAFILENAME, MAXVIDEOFILESIZEDEFAULT, DEFAULTPLUGINDIR, LIRC_DEVICE, - LOCDIR, + DEFAULTLOCDIR, DEFAULTSVDRPPORT, - VideoDirectory, + DEFAULTRESDIR, + DEFAULTVIDEODIR, DEFAULTWATCHDOG ); } @@ -555,7 +575,7 @@ int main(int argc, char *argv[]) // Initialize internationalization: - I18nInitialize(LocaleDir); + I18nInitialize(LocaleDirectory); // Main program loop variables - need to be here to have them initialized before any EXIT(): @@ -577,14 +597,22 @@ int main(int argc, char *argv[]) if (!PluginManager.LoadPlugins(true)) EXIT(2); - // Configuration data: + // Directories: + SetVideoDirectory(VideoDirectory); if (!ConfigDirectory) ConfigDirectory = DEFAULTCONFDIR; - cPlugin::SetConfigDirectory(ConfigDirectory); + if (!CacheDirectory) + CacheDirectory = DEFAULTCACHEDIR; + cPlugin::SetCacheDirectory(CacheDirectory); + if (!ResourceDirectory) + ResourceDirectory = DEFAULTRESDIR; + cPlugin::SetResourceDirectory(ResourceDirectory); cThemes::SetThemesDirectory(AddDirectory(ConfigDirectory, "themes")); + // Configuration data: + Setup.Load(AddDirectory(ConfigDirectory, "setup.conf")); Sources.Load(AddDirectory(ConfigDirectory, "sources.conf"), true, true); Diseqcs.Load(AddDirectory(ConfigDirectory, "diseqc.conf"), true, Setup.DiSEqC); @@ -618,7 +646,7 @@ int main(int argc, char *argv[]) EpgDataFileName = DEFAULTEPGDATAFILENAME; } else if (*EpgDataFileName != '/' && *EpgDataFileName != '.') - EpgDirectory = VideoDirectory; + EpgDirectory = CacheDirectory; if (EpgDirectory) cSchedules::SetEpgDataFileName(AddDirectory(EpgDirectory, EpgDataFileName)); else diff --git a/videodir.c b/videodir.c index 5f94d33..c64a5c6 100644 --- a/videodir.c +++ b/videodir.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: videodir.c 2.2 2012/06/10 13:45:21 kls Exp $ + * $Id: videodir.c 2.3 2012/09/01 10:57:44 kls Exp $ */ #include "videodir.h" @@ -21,6 +21,11 @@ const char *VideoDirectory = VIDEODIR; +void SetVideoDirectory(const char *Directory) +{ + VideoDirectory = strdup(Directory); +} + class cVideoDirectory { private: char *name, *stored, *adjusted; diff --git a/videodir.h b/videodir.h index 0a0587a..40d7b05 100644 --- a/videodir.h +++ b/videodir.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: videodir.h 2.1 2012/04/22 15:07:56 kls Exp $ + * $Id: videodir.h 2.2 2012/09/01 10:57:07 kls Exp $ */ #ifndef __VIDEODIR_H @@ -15,6 +15,7 @@ extern const char *VideoDirectory; +void SetVideoDirectory(const char *Directory); cUnbufferedFile *OpenVideoFile(const char *FileName, int Flags); int CloseVideoFile(cUnbufferedFile *File); bool RenameVideoFile(const char *OldName, const char *NewName); -- cgit v1.2.3