From patchwork Sun Mar 6 10:48:56 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Olivetti X-Patchwork-Id: 11797 Received: from 232.red-213-97-27.pooles.rima-tde.net ([213.97.27.232]) by www.linuxtv.org with esmtp (Exim 4.34) id 1D7tKE-0005Ab-7c for vdr@linuxtv.org; Sun, 06 Mar 2005 11:49:31 +0100 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by 232.Red-213-97-27.pooles.rima-tde.net (Postfix) with ESMTP id 8CE4818985FC for ; Sun, 6 Mar 2005 11:49:05 +0100 (CET) Message-ID: <422AE018.7050701@ventoso.org> Date: Sun, 06 Mar 2005 11:48:56 +0100 From: Luca Olivetti User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Klaus Schmidinger's VDR Subject: Re: [vdr] Radio/TV channel switch References: <1110102738.3748.2.camel@berlin.classic-net.de> In-Reply-To: <1110102738.3748.2.camel@berlin.classic-net.de> X-Enigmail-Version: 0.89.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2005 10:49:31 -0000 Status: O X-Status: X-Keywords: X-UID: 531 Uwe Ortner wrote: > I know this isnt on the top priority list ... > > I have about 2500 channels available, if I could fade out or switch > between radio and tv channels this would be a great help managing the > channel list This is how I do it (I include the source-dependent patch because otherwise the channel filter patch wouldn't apply). You have to go to the dvb setup to select if you want to see only tv, only radio or all channels. In spite of the name they both apply to 1.3.21/1.3.22 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--; }