diff -urN vdr-1.7.40.orig/channels.h vdr-1.7.40/channels.h --- vdr-1.7.40.orig/channels.h 2013-03-10 21:15:30.680180359 +0100 +++ vdr-1.7.40/channels.h 2013-03-10 21:15:56.460180803 +0100 @@ -14,6 +14,7 @@ #include "sources.h" #include "thread.h" #include "tools.h" +#include #define ISTRANSPONDER(f1, f2) (abs((f1) - (f2)) < 4) //XXX @@ -101,6 +102,9 @@ friend class cSchedules; friend class cMenuEditChannel; friend class cDvbSourceParam; + friend class cMenuMyEditChannel; + friend class cMenuMyBouquets; + friend class cMenuEditBouquet; private: static cString ToText(const cChannel *Channel); char *name; @@ -191,6 +195,7 @@ int Number(void) const { return number; } void SetNumber(int Number) { number = Number; } bool GroupSep(void) const { return groupSep; } + void SetGroupSep(bool GroupSep) { groupSep=GroupSep; } const char *Parameters(void) const { return parameters; } const cLinkChannels* LinkChannels(void) const { return linkChannels; } const cChannel *RefChannel(void) const { return refChannel; } @@ -228,6 +233,7 @@ public: cChannels(void); bool Load(const char *FileName, bool AllowComments = false, bool MustExist = false); + bool Reload(const char *FileName, bool AllowComments = false, bool MustExist = false); void HashChannel(cChannel *Channel); void UnhashChannel(cChannel *Channel); int GetNextGroup(int Idx); // Get next channel group diff -urN vdr-1.7.40.orig/config.c vdr-1.7.40/config.c --- vdr-1.7.40.orig/config.c 2013-03-10 21:15:30.680180359 +0100 +++ vdr-1.7.40/config.c 2013-03-10 21:15:56.460180803 +0100 @@ -482,6 +482,16 @@ ChannelsWrap = 0; ShowChannelNamesWithSource = 0; EmergencyExit = 1; + ExpertOptions = 0; + AddNewChannels = 0; + UseBouquetList = 1; + OnlyRadioChannels = 0; + OnlyEncryptedChannels = 0; + OnlyHDChannels = 0; + ExpertNavi = 0; + WantChListOnOk = 1; + ChannelUpDownKeyMode = 0; // 0 Normal, kChanUp and kChanDn jumps channel + // 1 opens bouquet / channellist } cSetup& cSetup::operator= (const cSetup &s) @@ -587,6 +597,15 @@ bool cSetup::Parse(const char *Name, const char *Value) { if (!strcasecmp(Name, "OSDLanguage")) { strn0cpy(OSDLanguage, Value, sizeof(OSDLanguage)); I18nSetLocale(OSDLanguage); } + else if (!strcasecmp(Name, "ExpertOptions")) ExpertOptions = atoi(Value); + else if (!strcasecmp(Name, "AddNewChannels")) AddNewChannels = atoi(Value); + else if (!strcasecmp(Name, "UseBouquetList")) UseBouquetList = atoi(Value); + else if (!strcasecmp(Name, "OnlyRadioChannels")) OnlyRadioChannels = atoi(Value); + else if (!strcasecmp(Name, "OnlyEncryptedChannels"))OnlyEncryptedChannels = atoi(Value); + else if (!strcasecmp(Name, "OnlyHDChannels")) OnlyHDChannels = atoi(Value); + else if (!strcasecmp(Name, "ExpertNavi")) ExpertNavi = atoi(Value); + else if (!strcasecmp(Name, "WantChListOnOk")) WantChListOnOk = atoi(Value); + else if (!strcasecmp(Name, "ChannelUpDownKeyMode")) ChannelUpDownKeyMode = atoi(Value); else if (!strcasecmp(Name, "OSDSkin")) Utf8Strn0Cpy(OSDSkin, Value, MaxSkinName); else if (!strcasecmp(Name, "OSDTheme")) Utf8Strn0Cpy(OSDTheme, Value, MaxThemeName); else if (!strcasecmp(Name, "WarEagleIcons")) WarEagleIcons = atoi(Value); @@ -812,6 +831,15 @@ Store("ChannelsWrap", ChannelsWrap); Store("ShowChannelNamesWithSource", ShowChannelNamesWithSource); Store("EmergencyExit", EmergencyExit); + Store("ExpertOptions", ExpertOptions); + Store("AddNewChannels", AddNewChannels); + Store("UseBouquetList", UseBouquetList); + Store("OnlyRadioChannels", OnlyRadioChannels); + Store("OnlyEncryptedChannels", OnlyEncryptedChannels); + Store("OnlyHDChannels", OnlyHDChannels); + Store("ExpertNavi", ExpertNavi); + Store("WantChListOnOk", WantChListOnOk); + Store("ChannelUpDownKeyMode", ChannelUpDownKeyMode); Store("LastReplayed", cReplayControl::LastReplayed()); Sort(); diff -urN vdr-1.7.40.orig/config.h vdr-1.7.40/config.h --- vdr-1.7.40.orig/config.h 2013-03-10 21:15:30.692180357 +0100 +++ vdr-1.7.40/config.h 2013-03-10 21:15:56.464180803 +0100 @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include "i18n.h" @@ -347,6 +348,17 @@ int ChannelsWrap; int ShowChannelNamesWithSource; int EmergencyExit; + int ExpertOptions; + int AddNewChannels; + int UseBouquetList; + int OnlyRadioChannels; + int OnlyEncryptedChannels; + int OnlyHDChannels; + int ExpertNavi; + int WantChListOnOk; + int ChannelUpDownKeyMode; // 0 Normal, jumps to next or previous channel + // 1 opens bouquet / channel list + bool UseZonedChannelList; int __EndData__; cString InitialChannel; cString DeviceBondings; diff -urN vdr-1.7.40.orig/debug.h vdr-1.7.40/debug.h --- vdr-1.7.40.orig/debug.h 1970-01-01 01:00:00.000000000 +0100 +++ vdr-1.7.40/debug.h 2013-03-10 21:15:56.464180803 +0100 @@ -0,0 +1,44 @@ + +#ifndef DEBUG_H +#define DEBUG_H +#include + +#ifdef DBG + #undef DBG + #undef DERR + #undef DLOG + #undef PRINTF +#endif + + +#if defined DEBUG + #ifdef PLUGIN_NAME_I18N + #define CONTEXT PLUGIN_NAME_I18N + #else + #define CONTEXT "VDR" + #endif + + // standard debug macro + #define DDD(x...) { printf("["CONTEXT": %s +%d, %s()]: ",__FILE__, __LINE__, __FUNCTION__); \ + printf(x); printf("\n"); } + + // standard error macro (red background) + #define DERR(x...) { printf("\033[0;37m\033[1;41m["CONTEXT"]: "x); printf("\033[0m\n"); } + + // special macro: logs to syslog AND console + #define DLOG(x...) { printf("["CONTEXT"]: "x); printf("\n"); dsyslog("["CONTEXT"]: "x); } + + // for automatic conversion of printf's - i.e. use sed s/" printf"/" PRINTF"/ + #define PRINTF(x...) printf("["CONTEXT"]: "x) +#else + #define DDD(x...) + #define DERR(x...) + #define DLOG(x...) + #define PRINTF(x...) +#endif + +//only here for compatibility reasons, don't use any more +#define ERR "Error" +#define DBG(x...) + +#endif /* DEBUG_H */ diff -urN vdr-1.7.40.orig/keys.c vdr-1.7.40/keys.c --- vdr-1.7.40.orig/keys.c 2013-03-10 21:15:30.696180358 +0100 +++ vdr-1.7.40/keys.c 2013-03-10 21:15:56.464180803 +0100 @@ -57,6 +57,9 @@ { kRecordings, trNOOP("Key$Recordings") }, { kSetup, trNOOP("Key$Setup") }, { kCommands, trNOOP("Key$Commands") }, + { kGreater, trNOOP("Key$Greater") }, + { kLess, trNOOP("Key$Less") }, + { k2digit, trNOOP("Key$2digit") }, { kUser0, trNOOP("Key$User0") }, { kUser1, trNOOP("Key$User1") }, { kUser2, trNOOP("Key$User2") }, diff -urN vdr-1.7.40.orig/keys.h vdr-1.7.40/keys.h --- vdr-1.7.40.orig/keys.h 2013-03-10 21:15:30.692180357 +0100 +++ vdr-1.7.40/keys.h 2013-03-10 21:15:56.464180803 +0100 @@ -51,6 +51,7 @@ kRecordings, kSetup, kCommands, + kGreater, kLess, k2digit, kUser0, kUser1, kUser2, kUser3, kUser4, kUser5, kUser6, kUser7, kUser8, kUser9, kNone, kKbd, diff -urN vdr-1.7.40.orig/Make.common vdr-1.7.40/Make.common --- vdr-1.7.40.orig/Make.common 1970-01-01 01:00:00.000000000 +0100 +++ vdr-1.7.40/Make.common 2013-03-10 21:15:56.464180803 +0100 @@ -0,0 +1,156 @@ + + +### The version number of this plugin (taken from the main source file): + +VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g') + + +### The version number of VDR (taken from VDR's "config.h"): + +APIVERSION = $(shell grep 'define APIVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g') +APIVERSNUM = $(shell grep 'define APIVERSNUM ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g' ) + +VDRLOCALE = $(shell grep '^LOCALEDIR' $(VDRDIR)/Makefile) + + +### The name of the distribution archive: + +ARCHIVE = $(PLUGIN)-$(VERSION) +PACKAGE = vdr-$(ARCHIVE) + + +### Includes and Defines (add further entries here): + +INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include +DEFINES += -D_GNU_SOURCE -D_LARGEFILE_SOURCE +DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DAPIVERSNUM=$(APIVERSNUM) + +#ifdef DEBUG +# DEFINES += -DDEBUG +# CXXFLAGS += -g +#endif + +#ifdef RBLITE +# DEFINES += -DRBLITE +#endif + +#ifdef RBMINI +# DEFINES += -DRBMINI +#endif + +#ifdef REELVDR +# DEFINES += -DREELVDR +#endif + +### Targets: + +plug: libvdr-$(PLUGIN).so + +all: libvdr-$(PLUGIN).so i18n + +### Implicit rules: + +%.o: %.c + $(CXX) $(CXXFLAGS) -c $(DEFINES) -DPLUGIN_NAME='"$(PLUGIN)"' -DPLUGIN_NAME_I18N='"$(PLUGIN)"' $(INCLUDES) -o $@ $< + +# Dependencies: + +MAKEDEP = $(CXX) -MM -MG +DEPFILE = .dependencies +$(DEPFILE): Makefile + @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@ + +-include $(DEPFILE) + + +### Internationalization (I18N): +ifneq ($(strip $(VDRLOCALE)),) +### do gettext based i18n stuff + +PODIR = po +LOCALEDIR = $(VDRDIR)/locale +I18Npo = $(wildcard $(PODIR)/*.po) +I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, \ + $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) +I18Npot = $(PODIR)/$(PLUGIN).pot + +#%.mo: %.po +# msgfmt -c -o $@ $< + +.PHONY: $(I18Npot)-rule +$(I18Npot): $(wildcard *.c $(PLUGIN).h $(EXTRA_I18N)) + @echo "making: $@" + @#echo $(I18Nmsgs) + xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --from-code=utf-8 --msgid-bugs-address='' $^ -o $(I18Npot) + +%.po: +#%.po: $(I18Npot) + @echo "making: $@" + msgmerge -U --no-wrap --no-location --backup=none -q $@ $< + @touch $@ + +$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.po + @echo "making: $@" + @mkdir -p $(dir $@) + msgfmt -c -o $@ $< + +.PHONY: i18n +i18n: $(I18Npot) i18n-pofiles $(I18Nmsgs) + +i18n-pofiles: $(I18Npot) + @echo "making: $@" + @for i in $(I18Npo) ; do \ + echo msgmerge -U --no-wrap --no-location --backup=none -q $$i $(I18Npot) ;\ + msgmerge -U -N --no-wrap --no-location --backup=none -q $$i $(I18Npot) ;\ + done + +i18n-dist: $(I18Nmsgs) + +#i18n-dist: +# @echo "making: $@" +# for i in `ls po/*.po` ; do \ +# odir=`echo $$i | cut -b4-8` ;\ +# msgfmt -c -o $(LOCALEDIR)/$$odir/LC_MESSAGES/vdr-$(PLUGIN).mo $$i ;\ +# done + +else ### do i18n.c based i18n stuff + +i18n: + @### nothing to do + +#i18n compatibility generator: +i18n.c: i18n-template.c po2i18n.pl $(I18Npo) + ./po2i18n.pl < i18n-template.c > i18n.c + +endif + + +libvdr-$(PLUGIN).so: $(OBJS) + $(CXX) $(CXXFLAGS) -shared $(OBJS) $(LDFLAGS) $(LIBS) -o $@ + @cp $@ $(LIBDIR)/$@.$(APIVERSION) + +dist: distclean + @rm -rf $(TMPDIR)/$(ARCHIVE) + @mkdir $(TMPDIR)/$(ARCHIVE) + @cp -a * $(TMPDIR)/$(ARCHIVE) + @rm -f $(TMPDIR)/$(ARCHIVE)/$(PLUGIN).kdevelop + @rm -f $(TMPDIR)/$(ARCHIVE)/$(PLUGIN).kdevelop.filelist + @rm -f $(TMPDIR)/$(ARCHIVE)/$(PLUGIN).kdevelop.pcs + @rm -f $(TMPDIR)/$(ARCHIVE)/$(PLUGIN).kdevses + @rm -rf $(TMPDIR)/$(ARCHIVE)/CVS + @rm -rf $(TMPDIR)/$(ARCHIVE)/Examples/CVS + @rm -rf $(TMPDIR)/$(ARCHIVE)/Patch/CVS + @ln -s $(ARCHIVE) $(TMPDIR)/$(PLUGIN) + @tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE) $(PLUGIN) + @rm -rf $(TMPDIR)/$(ARCHIVE) $(TMPDIR)/$(PLUGIN) + @echo Distribution package created as $(PACKAGE).tgz + +clean: + @-rm -f $(PODIR)/*.mo + @-rm -f $(OBJS) $(MAIN) $(DEPFILE) *.so *.tgz core* *~ + @-rm -f $(LIBDIR)/libvdr-$(PLUGIN).so.$(APIVERSION) + +distclean: clean + @-rm -f $(PODIR)/*.pot + +MAKECOMMON_IS_SOURCED = 1 diff -urN vdr-1.7.40.orig/menu.c vdr-1.7.40/menu.c --- vdr-1.7.40.orig/menu.c 2013-03-10 21:15:30.684180359 +0100 +++ vdr-1.7.40/menu.c 2013-03-10 21:15:56.468180801 +0100 @@ -99,15 +99,6 @@ // --- cMenuEditSrcItem ------------------------------------------------------ -class cMenuEditSrcItem : public cMenuEditIntItem { -private: - const cSource *source; -protected: - virtual void Set(void); -public: - cMenuEditSrcItem(const char *Name, int *Value); - eOSState ProcessKey(eKeys Key); - }; cMenuEditSrcItem::cMenuEditSrcItem(const char *Name, int *Value) :cMenuEditIntItem(Name, Value, 0) @@ -4244,6 +4235,7 @@ else return osEnd; break; + case kInfo: return osEnd; break; default: if ((Key & (k_Repeat | k_Release)) == 0) { cRemote::Put(Key); diff -urN vdr-1.7.40.orig/menu.h vdr-1.7.40/menu.h --- vdr-1.7.40.orig/menu.h 2013-03-10 21:15:30.692180357 +0100 +++ vdr-1.7.40/menu.h 2013-03-10 21:15:56.468180801 +0100 @@ -19,6 +19,17 @@ #include "recorder.h" #include "skins.h" +class cMenuEditSrcItem : public cMenuEditIntItem { +private: + const cSource *source; +protected: + virtual void Set(void); +public: + cMenuEditSrcItem(const char *Name, int *Value); + eOSState ProcessKey(eKeys Key); + }; + + class cMenuText : public cOsdMenu { private: char *text; @@ -98,8 +109,24 @@ virtual eOSState ProcessKey(eKeys Key); virtual const char* MenuKind() { return "MenuEvent"; } }; +struct MenuMainHook_Data_V1_0 { + eOSState Function; /*IN*/ + cOsdMenu *pResultMenu; /*OUT*/ +}; +#define CREATE_MENU_MAIN(function,menu) { \ + MenuMainHook_Data_V1_0 data; \ + memset(&data, 0, sizeof(data)); \ + data.Function = function; \ + if (!cPluginManager::CallFirstService("MenuMainHook-V1.0", &data)) \ + menu = new cMenuMain(function); \ + else \ + menu = data.pResultMenu; \ +} + class cMenuMain : public cOsdMenu { +protected: + cMenuMain(const char *Title):cOsdMenu(Title){}; // Allow custom constructor private: bool replaying; cOsdItem *stopReplayItem; diff -urN vdr-1.7.40.orig/osdbase.h vdr-1.7.40/osdbase.h --- vdr-1.7.40.orig/osdbase.h 2013-03-10 21:15:30.692180357 +0100 +++ vdr-1.7.40/osdbase.h 2013-03-10 21:15:56.472180800 +0100 @@ -34,6 +34,10 @@ osSwitchDvb, osBack, osEnd, + osBouquets, + osActiveBouquet, + osFavourites, + osAddFavourite, os_User, // the following values can be used locally osUser1, osUser2, diff -urN vdr-1.7.40.orig/po/it_IT.po vdr-1.7.40/po/it_IT.po --- vdr-1.7.40.orig/po/it_IT.po 2013-03-10 21:15:30.696180358 +0100 +++ vdr-1.7.40/po/it_IT.po 2013-03-10 21:15:56.472180800 +0100 @@ -25,6 +25,9 @@ msgid "*** Invalid Channel ***" msgstr "*** Canale NON valido ***" + +msgid "File already exists - overwrite?" +msgstr "" msgid "Channel not available!" msgstr "Canale non disponibile!" @@ -489,6 +492,15 @@ msgid "Key$Commands" msgstr "Comandi" +msgid "Key$Greater" +msgstr "" + +msgid "Key$Less" +msgstr "" + +msgid "Key$2digit" +msgstr "" + msgid "Key$User0" msgstr "Utente0" @@ -738,6 +750,9 @@ msgid "Button$Rewind" msgstr "Riavvolgi" + +msgid "Edit recording" +msgstr "" msgid "Recordings" msgstr "Registrazioni" @@ -1204,6 +1219,10 @@ msgid " Cancel editing" msgstr " Annulla modifiche" +#. TRANSLATORS: note the leading blank! +msgid " Cancel file transfer" +msgstr "" + msgid "Stop recording?" msgstr "Fermare la registrazione?" @@ -1292,6 +1311,9 @@ msgid "Editing - shut down anyway?" msgstr "Modifica in corso - spegnere comunque?" +msgid "Transfering file - shut down anyway?" +msgstr "" + msgid "Recording - shut down anyway?" msgstr "Registrazione in corso - spegnere comunque?" @@ -1396,6 +1418,12 @@ msgid "Editing process finished" msgstr "Processo di modifica terminato" +msgid "File transfer failed!" +msgstr "" + +msgid "File transfer finished" +msgstr "" + msgid "Press any key to cancel restart" msgstr "Premi un tasto per annullare il riavvio" diff -urN vdr-1.7.40.orig/vdr.c vdr-1.7.40/vdr.c --- vdr-1.7.40.orig/vdr.c 2013-03-10 21:15:30.700180359 +0100 +++ vdr-1.7.40/vdr.c 2013-03-10 21:15:56.472180800 +0100 @@ -1091,6 +1091,28 @@ case kChanUp: case kChanDn|k_Repeat: case kChanDn: + + if (Setup.ChannelUpDownKeyMode == 1 && (!Menu || cDisplayChannel::IsOpen())) + // only if a menu is not open + // and user has opted for a different key behavior + { + if (cDisplayChannel::IsOpen() || cControl::Control()) + { + DELETE_MENU; + } + if (key == kChanDn) + { + DirectMainFunction(osBouquets); + } + else + { + DirectMainFunction(osActiveBouquet); + } + key = kNone; // nobody else sees these keys + break; + } + else + if (!Interact) Menu = new cDisplayChannel(NORMALKEY(key)); else if (cDisplayChannel::IsOpen() || cControl::Control()) { @@ -1134,6 +1156,7 @@ break; // Subtitle track control: case kSubtitles: + case kGreater: if (cControl::Control()) cControl::Control()->Hide(); if (!cDisplaySubtitleTracks::IsOpen()) { @@ -1288,7 +1311,19 @@ Menu = new cDisplayChannel(NORMALKEY(key)); break; // Viewing Control: - case kOk: LastChannel = -1; break; // forces channel display + case kInfo: + case kOk: if ((Setup.WantChListOnOk && (key == kOk)) + || (!Setup.WantChListOnOk && (key == kInfo)) ) + { + DirectMainFunction(osChannels); + } + else + { + LastChannel = -1; + } + break; + + // Instant resume of the last viewed recording: case kPlay: if (cReplayControl::LastReplayed()) {