C'e' una semplice patch (inizialmente allegata al pluggo rotor) che inserisce i nuovi canali in un gruppo particolare (New Channels @ ), basta mettere questo gruppo in coda ad ogni blocco sorgente e almeno un po' di lavoro non lo devi fare. Per i canali DTT e' funziona perfettamente essendo questi ultimi solo poche decine.
L'unico problema, ma dipende da altro, e' quanto VDR non riesce ad acquisire correttamente le info sul canale e quindi potrebbe non riuscire a definire la sorgente ed il tipo...
Codice: Seleziona tutto
diff -u VDR146/channels.c VDR/channels.c
--- VDR146/channels.c2007-05-08 09:33:12.000000000 +0200
+++ VDR/channels.c2007-06-25 16:07:12.000000000 +0200
@@ -490,6 +490,25 @@
}
}
+void cChannel::SeparateFreePayTV(char *buffer)
+{
+ cChannel *groupSep=Channels.GetByName(buffer);
+ if (!groupSep)
+ {
+ groupSep = new cChannel();
+ groupSep->SetName(buffer,"","");
+ groupSep->SetGroupSep(true);
+ Channels.Add(groupSep);
+ }
+ if (Channels.GetNextGroup(groupSep->Index())>=0)
+ groupSep=Channels.Get(Channels.GetNextGroup(groupSep->Index())-1);
+ else
+ groupSep=Channels.Last();
+ Channels.Move(this,groupSep);
+ Channels.ReNumber();
+}
+
+
void cChannel::SetCaIds(const int *CaIds)
{
if (caids[0] && caids[0] <= 0x00FF)
@@ -505,6 +524,38 @@
if (!CaIds[i])
break;
}
+ cChannel *groupSep=Channels.Get(Channels.GetPrevGroup(Index()));
+ if (groupSep) {
+ char buffer[64];
+ if (caids[0]==0) {
+ snprintf(buffer, sizeof(buffer), "New PayRadio-Channels @ %s", *cSource::ToString(Source()));
+ if (groupSep != Channels.GetByName(buffer)) {
+ snprintf(buffer, sizeof(buffer), "New PayTV-Channels @ %s", *cSource::ToString(Source()));
+ if (groupSep == Channels.GetByName(buffer)) {
+ snprintf(buffer, sizeof(buffer), "New FreeTV-Channels @ %s",*cSource::ToString(Source()));
+ SeparateFreePayTV(buffer);
+ }
+ }
+ else {
+ snprintf(buffer, sizeof(buffer), "New Free Radio-Channels @ %s",*cSource::ToString(Source()));
+ SeparateFreePayTV(buffer);
+ }
+ }
+ else {
+ snprintf(buffer, sizeof(buffer), "New Free Radio-Channels @ %s", *cSource::ToString(Source()));
+ if (groupSep != Channels.GetByName(buffer)) {
+ snprintf(buffer, sizeof(buffer), "New FreeTV-Channels @ %s", *cSource::ToString(Source()));
+ if (groupSep == Channels.GetByName(buffer)) {
+ snprintf(buffer, sizeof(buffer), "New PayTV-Channels @ %s",*cSource::ToString(Source()));
+ SeparateFreePayTV(buffer);
+ }
+ }
+ else {
+ snprintf(buffer, sizeof(buffer), "New PayRadio-Channels @ %s",*cSource::ToString(Source()));
+ SeparateFreePayTV(buffer);
+ }
+ }
+ }
modification |= CHANNELMOD_CA;
Channels.SetModified();
}
@@ -571,6 +622,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;
@@ -1011,6 +1067,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();
@@ -1039,7 +1105,7 @@
return Result;
}
-cChannel *cChannels::NewChannel(const cChannel *Transponder, const char *Name, const char *ShortName, const char *Provider, int Nid, int Tid, int Sid, int Rid)
+cChannel *cChannels::NewChannel(const cChannel *Transponder, const char *Name, const char *ShortName, const char *Provider, int Nid, int Tid, int Sid, int Rid, int Type)
{
if (Transponder) {
dsyslog("creating new channel '%s,%s;%s' on %s transponder %d with id %d-%d-%d-%d", Name, ShortName, Provider, *cSource::ToString(Transponder->Source()), Transponder->Transponder(), Nid, Tid, Sid, Rid);
@@ -1047,7 +1113,27 @@
NewChannel->CopyTransponderData(Transponder);
NewChannel->SetId(Nid, Tid, Sid, Rid);
NewChannel->SetName(Name, ShortName, Provider);
- Add(NewChannel);
+ /* find group seperator for the source of this channel */
+ {
+ char buffer[64];
+ if (Type==2)
+ snprintf(buffer, sizeof(buffer), "New Free Radio-Channels @ %s", *cSource::ToString(NewChannel->Source()));
+ else
+ snprintf(buffer, sizeof(buffer), "New FreeTV-Channels @ %s", *cSource::ToString(NewChannel->Source()) );
+ cChannel *groupSep = GetByName(buffer);
+ if(!groupSep) // group sepeator for this source doesn't exist, so lets
+ {
+ groupSep = new cChannel();
+ groupSep->SetName(buffer,"","");
+ groupSep->SetGroupSep(true);
+ Add(groupSep);
+ }
+ if (GetNextGroup(groupSep->Index())>=0)
+ groupSep=Get(GetNextGroup(groupSep->Index())-1);
+ else
+ groupSep=Last();
+ Add(NewChannel, groupSep);
+ }
ReNumber();
return NewChannel;
}
diff -u VDR146/channels.h VDR/channels.h
--- VDR146/channels.h2007-05-08 09:33:12.000000000 +0200
+++ VDR/channels.h2007-06-25 16:08:24.000000000 +0200
@@ -150,6 +150,7 @@
cChannel *refChannel;
cString ParametersToString(void) const;
bool StringToParameters(const char *s);
+ void SeparateFreePayTV(char *buffer);
public:
cChannel(void);
cChannel(const cChannel &Channel);
@@ -216,6 +217,7 @@
void SetCaDescriptors(int Level);
void SetLinkChannels(cLinkChannels *LinkChannels);
void SetRefChannel(cChannel *RefChannel);
+ void SetGroupSep(bool Sep = true);
};
class cChannels : public cRwLock, public cConfig<cChannel> {
@@ -238,6 +240,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--; }
@@ -249,7 +252,7 @@
///< Returns 0 if no channels have been modified, 1 if an automatic
///< modification has been made, and 2 if the user has made a modification.
///< Calling this function resets the 'modified' flag to 0.
- cChannel *NewChannel(const cChannel *Transponder, const char *Name, const char *ShortName, const char *Provider, int Nid, int Tid, int Sid, int Rid = 0);
+ cChannel *NewChannel(const cChannel *Transponder, const char *Name, const char *ShortName, const char *Provider, int Nid, int Tid, int Sid, int Rid = 0,int Type = 0);
#ifdef USE_NOEPG
bool keinEPGScan(tChannelID kanalID);
#endif /* NOEPG */
diff -u VDR146/sdt.c VDR/sdt.c
--- VDR146/sdt.c2006-04-15 16:12:21.000000000 +0200
+++ VDR/sdt.c2007-06-25 16:10:27.000000000 +0200
@@ -87,7 +87,7 @@
// channel->SetCa(SiSdtService.getFreeCaMode() ? 0xFFFF : 0);
}
else if (*pn && Setup.UpdateChannels >= 4) {
- channel = Channels.NewChannel(Channel(), pn, ps, pp, sdt.getOriginalNetworkId(), sdt.getTransportStreamId(), SiSdtService.getServiceId());
+ channel = Channels.NewChannel(Channel(), pn, ps, pp, sdt.getOriginalNetworkId(), sdt.getTransportStreamId(), SiSdtService.getServiceId(),0,sd->getServiceType());
patFilter->Trigger();
}
}
Questa e' la versione che divide i free dai canali pay (quindi 4 gruppi per sorgente)...
col pc in salotto ed utilizzare le funzioni del ricevitore hai ragione, pero' buona parte dei problemi si risolvono nei ritagli di tempo semplicemente mettendo la lista a posto con un editor invece di compilare l'ultima versione del pluggo
(sempre IMHO)...
Personalmente non utilizzero' mai l'editor del ricevitore quando posso farlo piu' semplicemente con tastiera e mouse a colpi di copia ed incolla...