From patchwork Sun Aug 27 20:16:16 2006 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Olivetti X-Patchwork-Id: 12379 Received: from [85.52.226.61] (helo=mail.ventoso.org) by www.linuxtv.org with esmtp (Exim 4.50) id 1GHR3S-0008EN-MB for vdr@linuxtv.org; Sun, 27 Aug 2006 22:16:26 +0200 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by mail.ventoso.org (Postfix) with ESMTP id 41D621800286 for ; Sun, 27 Aug 2006 22:16:24 +0200 (CEST) Message-ID: <44F1FD90.7070105@ventoso.org> Date: Sun, 27 Aug 2006 22:16:16 +0200 From: Luca Olivetti User-Agent: Mozilla Thunderbird 1.5.0.5 (X11/20060719) MIME-Version: 1.0 To: VDR Mailing List Subject: Re: [vdr] channel number range limit? References: <000701c6ca0e$64a62200$0a00a8c0@vorg> In-Reply-To: <000701c6ca0e$64a62200$0a00a8c0@vorg> X-Enigmail-Version: 0.94.0.0 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Aug 2006 20:16:27 -0000 Status: O X-Status: X-Keywords: X-UID: 10524 En/na Timothy D. Lenz ha escrit: > Also, I notice when looking at the channel.conf that channels added from vdr > rotor plugin don't show up in the conf for at least 5-10 minutes. If you > shut down or crash before that, the channel entry is lost. This is by design: the channels are only saved if you manually edit them, otherwise they'll be saved only after 10 minutes (IIRC). > > A request for vdr 1.5 would be multi channel list where each list with > contain just channels for a given sat or provider, as well as favorites > list. for the time being you can try the attached patch Bye --- channels.c.newchannels 2005-02-06 10:44:53.000000000 +0100 +++ channels.c 2005-02-13 16:48:07.825253533 +0100 @@ -536,6 +536,11 @@ refChannel = RefChannel; } +void cChannel::SetGroupSep(bool Sep) +{ + groupSep = Sep; +} + static int PrintParameter(char *p, char Name, int Value) { return Value >= 0 && Value != 999 ? sprintf(p, "%c%d", Name, Value) : 0; @@ -909,6 +914,16 @@ return NULL; } +cChannel *cChannels::GetByName(char *Name) +{ + for (cChannel *channel = First(); channel; channel = Next(channel)) + { + if (strcmp(channel->Name(), Name)==0) + return channel; + } + return NULL; +} + bool cChannels::HasUniqueChannelID(cChannel *NewChannel, cChannel *OldChannel) { tChannelID NewChannelID = NewChannel->GetChannelID(); @@ -944,7 +959,33 @@ cChannel *NewChannel = new cChannel(*Transponder); NewChannel->SetId(Nid, Tid, Sid, Rid); NewChannel->SetName(Name, ShortName, Provider); +#if 0 Add(NewChannel); +#else + /* find group separator for the source of this channel */ + { + char buffer[64]; + snprintf(buffer, sizeof(buffer), "New Channels @ %s", + *cSource::ToString(NewChannel->Source()) ); + cChannel *groupSep = GetByName(buffer); + if(!groupSep) // group separator for this source doesn't exist, so lets create it + { + groupSep = new cChannel(); + groupSep->SetName(buffer, "", ""); + groupSep->SetGroupSep(true); + Add(groupSep); + } else // find next separator or last channel + { + cChannel *nextChannel=Next(groupSep); + while (nextChannel && !nextChannel->GroupSep()) + { + groupSep=nextChannel; + nextChannel=Next(nextChannel); + } + } + Add(NewChannel, groupSep); + } +#endif ReNumber(); return NewChannel; } --- channels.h.newchannels 2005-01-16 14:46:41.000000000 +0100 +++ channels.h 2005-02-13 16:45:39.327608385 +0100 @@ -191,6 +191,7 @@ void SetCaDescriptors(int Level); void SetLinkChannels(cLinkChannels *LinkChannels); void SetRefChannel(cChannel *RefChannel); + void SetGroupSep(bool Sep = true); }; class cChannels : public cRwLock, public cConfig { @@ -208,6 +209,7 @@ cChannel *GetByNumber(int Number, int SkipGap = 0); cChannel *GetByServiceID(int Source, int Transponder, unsigned short ServiceID); cChannel *GetByChannelID(tChannelID ChannelID, bool TryWithoutRid = false, bool TryWithoutPolarization = false); + cChannel *GetByName(char *Name); int BeingEdited(void) { return beingEdited; } void IncBeingEdited(void) { beingEdited++; } void DecBeingEdited(void) { beingEdited--; }