From patchwork Mon Jun 18 13:38:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ludi X-Patchwork-Id: 11952 Received: from localhost ([127.0.0.1] helo=www.linuxtv.org) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1SgcA2-0002NJ-0Z; Mon, 18 Jun 2012 15:38:30 +0200 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1Sgc9z-0002Mh-Ia for vdr@linuxtv.org; Mon, 18 Jun 2012 15:38:28 +0200 X-tubIT-Incoming-IP: 65.55.111.153 Received: from blu0-omc4-s14.blu0.hotmail.com ([65.55.111.153]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtp for id 1Sgc9z-0003OH-9g; Mon, 18 Jun 2012 15:38:27 +0200 Received: from BLU0-SMTP336 ([65.55.111.137]) by blu0-omc4-s14.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 18 Jun 2012 06:38:25 -0700 X-Originating-IP: [83.99.70.142] X-Originating-Email: [ludi113@hotmail.com] Message-ID: Received: from localhost ([83.99.70.142]) by BLU0-SMTP336.phx.gbl over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 18 Jun 2012 06:38:23 -0700 Date: Mon, 18 Jun 2012 15:38:21 +0200 From: Ludi To: VDR Mailing List In-Reply-To: <4FDDEFCE.7010702@tvdr.de> References: <4FDC8ADB.3000604@tvdr.de> <4FDDCAB5.2030006@tvdr.de> <4FDDEFCE.7010702@tvdr.de> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-OriginalArrivalTime: 18 Jun 2012 13:38:23.0883 (UTC) FILETIME=[A1FD2DB0:01CD4D57] X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.6.18.133026 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' FROM_NAME_ONE_WORD 0.05, HTML_00_01 0.05, HTML_00_10 0.05, MIME_TEXT_ONLY_MP_MIXED 0.05, MSGID_ADDED_BY_MTA 0.05, BODYTEXTP_SIZE_3000_LESS 0, WEBMAIL_SOURCE 0, WEBMAIL_XOIP 0, WEBMAIL_X_IP_HDR 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_MIXED 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __FROM_HOTMAIL 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_XOAT 0, __HAS_XOIP 0, __HAS_X_MAILER 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __PHISH_SPEAR_STRUCTURE_1 0, __RDNS_HOTMAIL 0, __RECEIVED_FROM_MSN_LIVE 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __URI_NS ' X-LSpam-Score: -0.9 (/) X-LSpam-Report: No, score=-0.9 required=5.0 tests=BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793 autolearn=no Subject: Re: [vdr] RFE: Make VDR more friendly when using combinations of DVB-S, DVB-T and DVB-C X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: vdr-bounces@linuxtv.org Errors-To: vdr-bounces@linuxtv.org On Sun, 17 Jun 2012 16:55:10 +0200 Klaus Schmidinger wrote: > On 17.06.2012 16:50, Ludi wrote: > > Could you please tell us whether the patch is compatible to vdr > > 1.7.27? It is the version that is currently in use in the > > development version of yavdr. > > It should apply just fine. After some fiddling (unfortunately, I am far from being an expert), I was able to apply the patch (enhanced with the part to save the configuration) to vdr-1.7.27, that I got from the unstable vdr PPA for precise of yavdr. I added the patch, added a point to debian/changelog and was able to rebuild and install the vdr debian package. (The patch I used and that contains Klaus' code is attached to this email, but be aware that I don't know whether I did everything correctly.) Depending on the skin used, the source is visible on more or less places; I am using the narrowhd skin, and the source is not visible in the menu that appears when hitting "ok" on the remote control, it is not visible in the next records section of the main menu, but it is visible in the channellist, in the detailed view of the timers,... I was able to verify the with the default vdr skin, the source is visible on more places. Concerning the plugins, I only looked at the live plugin and the xmltv2vdr plugin; unfortunately, the source is not visible in this plugins. @Henning You talked about an error in the patch from Klaus; if you know how to fix it, you are welcome to enhance my patch. Cheers Index: vdr-1.7.27/channels.c =================================================================== --- vdr-1.7.27.orig/channels.c 2012-06-18 13:10:37.636562494 +0200 +++ vdr-1.7.27/channels.c 2012-06-18 13:10:37.648562494 +0200 @@ -112,10 +112,34 @@ provider = strcpyrealloc(provider, Channel.provider); portalName = strcpyrealloc(portalName, Channel.portalName); memcpy(&__BeginData__, &Channel.__BeginData__, (char *)&Channel.__EndData__ - (char *)&Channel.__BeginData__); + nameSource = NULL; // these will be recalculated automatically + shortNameSource = NULL; parameters = Channel.parameters; return *this; } +const char *cChannel::Name(void) const +{ + if (Setup.ShowChannelNamesWithSource) { + if (isempty(nameSource)) + nameSource = cString::sprintf("%s (%c)", name, cSource::ToChar(source)); + return nameSource; + } + return name; +} + +const char *cChannel::ShortName(bool OrName) const +{ + if (OrName && isempty(shortName)) + return Name(); + if (Setup.ShowChannelNamesWithSource) { + if (isempty(shortNameSource)) + shortNameSource = cString::sprintf("%s (%c)", shortName, cSource::ToChar(source)); + return shortNameSource; + } + return shortName; +} + int cChannel::Transponder(int Frequency, char Polarization) { // some satellites have transponders at the same frequency, just with different polarization: @@ -233,10 +257,14 @@ modification |= CHANNELMOD_NAME; Channels.SetModified(); } - if (nn) + if (nn) { name = strcpyrealloc(name, Name); - if (ns) + nameSource = NULL; + } + if (ns) { shortName = strcpyrealloc(shortName, ShortName); + shortNameSource = NULL; + } if (np) provider = strcpyrealloc(provider, Provider); } @@ -774,6 +802,8 @@ free(tpidbuf); free(caidbuf); free(namebuf); + nameSource = NULL; + shortNameSource = NULL; if (!GetChannelID().Valid()) { esyslog("ERROR: channel data results in invalid ID!"); return false; Index: vdr-1.7.27/channels.h =================================================================== --- vdr-1.7.27.orig/channels.h 2012-06-18 13:10:37.416562489 +0200 +++ vdr-1.7.27/channels.h 2012-06-18 13:10:37.648562494 +0200 @@ -137,6 +137,8 @@ int number; // Sequence number assigned on load bool groupSep; int __EndData__; + mutable cString nameSource; + mutable cString shortNameSource; cString parameters; int modification; mutable const cSchedule *schedule; @@ -151,8 +153,8 @@ cString ToText(void) const; bool Parse(const char *s); bool Save(FILE *f); - const char *Name(void) const { return name; } - const char *ShortName(bool OrName = false) const { return (OrName && isempty(shortName)) ? name : shortName; } + const char *Name(void) const; + const char *ShortName(bool OrName = false) const; const char *Provider(void) const { return provider; } const char *PortalName(void) const { return portalName; } int Frequency(void) const { return frequency; } ///< Returns the actual frequency, as given in 'channels.conf' Index: vdr-1.7.27/config.c =================================================================== --- vdr-1.7.27.orig/config.c 2012-06-18 13:10:37.600562493 +0200 +++ vdr-1.7.27/config.c 2012-06-18 14:44:32.080696192 +0200 @@ -469,6 +469,7 @@ DeviceBondings = ""; InitialVolume = -1; ChannelsWrap = 0; + ShowChannelNamesWithSource = 0; EmergencyExit = 1; } @@ -671,6 +672,7 @@ else if (!strcasecmp(Name, "InitialVolume")) InitialVolume = atoi(Value); else if (!strcasecmp(Name, "DeviceBondings")) DeviceBondings = Value; else if (!strcasecmp(Name, "ChannelsWrap")) ChannelsWrap = atoi(Value); + else if (!strcasecmp(Name, "ShowChannelNamesWithSource")) ShowChannelNamesWithSource = atoi(Value); else if (!strcasecmp(Name, "EmergencyExit")) EmergencyExit = atoi(Value); else return false; @@ -776,6 +778,7 @@ Store("InitialVolume", InitialVolume); Store("DeviceBondings", DeviceBondings); Store("ChannelsWrap", ChannelsWrap); + Store("ShowChannelNamesWithSource", ShowChannelNamesWithSource); Store("EmergencyExit", EmergencyExit); Sort(); Index: vdr-1.7.27/config.h =================================================================== --- vdr-1.7.27.orig/config.h 2012-06-18 13:10:37.600562493 +0200 +++ vdr-1.7.27/config.h 2012-06-18 13:10:37.648562494 +0200 @@ -330,6 +330,7 @@ int CurrentDolby; int InitialVolume; int ChannelsWrap; + int ShowChannelNamesWithSource; int EmergencyExit; int __EndData__; cString InitialChannel; Index: vdr-1.7.27/menu.c =================================================================== --- vdr-1.7.27.orig/menu.c 2012-06-18 13:10:37.612562493 +0200 +++ vdr-1.7.27/menu.c 2012-06-18 13:10:37.652562494 +0200 @@ -3560,6 +3560,7 @@ Add(new cMenuEditChanItem(tr("Setup.Miscellaneous$Initial channel"), &data.InitialChannel, tr("Setup.Miscellaneous$as before"))); Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Initial volume"), &data.InitialVolume, -1, 255, tr("Setup.Miscellaneous$as before"))); Add(new cMenuEditBoolItem(tr("Setup.Miscellaneous$Channels wrap"), &data.ChannelsWrap)); + Add(new cMenuEditBoolItem(tr("Setup.Miscellaneous$Show channel names with source"), &data.ShowChannelNamesWithSource)); Add(new cMenuEditBoolItem(tr("Setup.Miscellaneous$Emergency exit"), &data.EmergencyExit)); } Index: vdr-1.7.27/sources.h =================================================================== --- vdr-1.7.27.orig/sources.h 2012-06-18 13:00:38.148548269 +0200 +++ vdr-1.7.27/sources.h 2012-06-18 13:10:37.652562494 +0200 @@ -33,6 +33,7 @@ int Code(void) const { return code; } const char *Description(void) const { return description; } bool Parse(const char *s); + static char ToChar(int Code) { return (Code & st_Mask) >> 24; } static cString ToString(int Code); static int FromString(const char *s); static int FromData(eSourceType SourceType, int Position = 0, bool East = false);