From fe9499ba901f5c32dd0b3841a2b6e599fefc144f Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 24 Nov 2002 18:00:00 +0100 Subject: =?UTF-8?q?Version=201.1.17=20-=20Added=20new=20entries=20to=20'ca?= =?UTF-8?q?.conf'.=20-=20Fixed=20closing=20unused=20PID=20handles=20(thank?= =?UTF-8?q?s=20to=20Stefan=20Schluenss=20for=20reporting=20this=20=20=20on?= =?UTF-8?q?e).=20-=20Added=20more=20examples=20to=20'diseqc.conf'=20(thank?= =?UTF-8?q?s=20to=20Oliver=20Endriss).=20-=20Fixed=20disabling=20multiple?= =?UTF-8?q?=20recordings=20on=20a=20single=20DVB=20card=20(comment=20out?= =?UTF-8?q?=20the=20definition=20=20=20of=20the=20macros=20DO=5FREC=5FAND?= =?UTF-8?q?=5FPLAY=5FON=5FPRIMARY=5FDEVICE=20and=20DO=5FMULTIPLE=5FRECORDI?= =?UTF-8?q?NGS=20in=20=20=20dvbdevice.c).=20-=20Plugins=20can=20now=20have?= =?UTF-8?q?=20their=20very=20own=20OSD=20setup=20in=20the=20object=20they?= =?UTF-8?q?=20return=20from=20=20=20a=20call=20to=20cPlugin::MainMenuActio?= =?UTF-8?q?n().=20In=20order=20to=20implement=20this,=20the=20return=20typ?= =?UTF-8?q?e=20=20=20of=20cPlugin::MainMenuAction()=20had=20to=20be=20chan?= =?UTF-8?q?ged=20from=20(cOsdMenu=20*)=20to=20(cOsdObject=20*).=20=20=20So?= =?UTF-8?q?=20in=20case=20you=20are=20compiling=20an=20existing=20plugin?= =?UTF-8?q?=20with=20this=20version=20of=20VDR=20and=20you=20=20=20get=20a?= =?UTF-8?q?n=20error=20message,=20simply=20change=20cOsdMenu=20to=20cOsdOb?= =?UTF-8?q?ject=20in=20the=20plugin's=20source=20=20=20for=20the=20MainMen?= =?UTF-8?q?uAction()=20function.=20=20=20Plugin=20authors=20who=20have=20s?= =?UTF-8?q?o=20far=20(ab)used=20the=20cControl=20mechanism=20to=20implemen?= =?UTF-8?q?t=20their=20=20=20own=20raw=20OSD=20should=20take=20a=20look=20?= =?UTF-8?q?at=20the=20new=20demo=20plugin=20'osddemo'.=20It=20implements?= =?UTF-8?q?=20=20=20a=20very=20primitive=20game=20that=20shows=20how=20a?= =?UTF-8?q?=20plugin=20can=20have=20its=20own=20raw=20OSD.=20Especially=20?= =?UTF-8?q?=20=20look=20into=20cLineGame=20and=20see=20how=20it=20implemen?= =?UTF-8?q?ts=20the=20Show()=20function.=20See=20also=20=20=20the=20chapte?= =?UTF-8?q?r=20on=20"User=20interaction"=20in=20PLUGINS.html.=20-=20Added?= =?UTF-8?q?=20three=20new=20fields=20to=20the=20lines=20in=20'channels.con?= =?UTF-8?q?f':=20NID,=20TID=20and=20RID.=20NID=20and=20=20=20TID=20are=20t?= =?UTF-8?q?he=20Network=20and=20Transport=20Stream=20IDs,=20respectively.?= =?UTF-8?q?=20RID=20is=20an=20additional=20ID=20=20=20that=20can=20be=20us?= =?UTF-8?q?ed=20to=20tell=20apart=20channels=20that=20would=20otherwise=20?= =?UTF-8?q?be=20indistinguishable.=20=20=20This=20is=20typically=20the=20c?= =?UTF-8?q?ase=20with=20radio=20channels,=20which=20may=20have=20the=20sam?= =?UTF-8?q?e=20NID,=20TID=20=20=20and=20SID,=20but=20different=20"radio=20?= =?UTF-8?q?IDs".=20This=20new=20field=20is=20therefore=20called=20RID=20("?= =?UTF-8?q?radio=20=20=20ID").=20Currently=20NID=20and=20TID=20are=20not?= =?UTF-8?q?=20yet=20used=20by=20VDR=20and=20should=20always=20be=200.=20Th?= =?UTF-8?q?e=20=20=20RID=20is=20actually=20used=20when=20building=20the=20?= =?UTF-8?q?"unique=20channel=20ID",=20so=20if=20you=20have=20channels=20?= =?UTF-8?q?=20=20in=20your=20'channels.conf'=20file=20that=20cause=20error?= =?UTF-8?q?=20messages=20when=20loading,=20you=20can=20set=20=20=20the=20R?= =?UTF-8?q?IDs=20of=20these=20channels=20to=20different=20values.=20=20=20?= =?UTF-8?q?When=20reading=20an=20old=20'channels.conf'=20these=20new=20fie?= =?UTF-8?q?lds=20will=20be=20automatically=20=20=20initialized=20to=200=20?= =?UTF-8?q?and=20once=20the=20file=20is=20written=20back=20to=20disk=20the?= =?UTF-8?q?y=20will=20be=20appended=20=20=20to=20the=20channel=20definitio?= =?UTF-8?q?ns.=20=20=20Thanks=20to=20R=C3=A9gis=20Bossut=20for=20pointing?= =?UTF-8?q?=20out=20that=20with=20some=20providers=20the=20channels=20can?= =?UTF-8?q?=20=20=20only=20be=20distinguished=20through=20the=20RID.=20-?= =?UTF-8?q?=20The=20"unique=20channel=20ID"=20now=20contains=20an=20option?= =?UTF-8?q?al=205th=20part=20(the=20RID).=20See=20man=20vdr(5).=20-=20Upda?= =?UTF-8?q?ted=20'channels.conf.cable'=20and=20made=20some=20channels=20un?= =?UTF-8?q?ique=20using=20the=20new=20RID=20=20=20(thanks=20to=20Andreas?= =?UTF-8?q?=20Kool=20for=20pointing=20out=20the=20problems).=20-=20Made=20?= =?UTF-8?q?some=20channels=20unique=20in=20'channels.conf.terr'=20using=20?= =?UTF-8?q?the=20new=20RID.=20-=20Extended=20the=20'-l'=20option=20to=20al?= =?UTF-8?q?low=20logging=20to=20LOG=5FLOCALn=20(n=3D0..7)=20by=20writing,?= =?UTF-8?q?=20for=20=20=20instance,=20'-l=203.7'=20(suggested=20by=20J?= =?UTF-8?q?=C3=BCrgen=20Schmidt).=20-=20Now=20deleting=20stale=20lock=20fi?= =?UTF-8?q?les=20if=20they=20have=20a=20time=20stamp=20that=20is=20outside?= =?UTF-8?q?=20the=20window=20=20=20'now=20+/-=20LOCKFILESTALETIME'.=20This?= =?UTF-8?q?=20improves=20things=20in=20cases=20where=20the=20system=20time?= =?UTF-8?q?=20=20=20makes=20far=20jumps,=20so=20that=20a=20lock=20file=20m?= =?UTF-8?q?ight=20end=20up=20with=20a=20time=20stamp=20that=20lies=20=20?= =?UTF-8?q?=20in=20the=20distant=20future=20(thanks=20to=20Oliver=20Endris?= =?UTF-8?q?s).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eit.c | 60 +++++++++++++++++++++++++++++++----------------------------- 1 file changed, 31 insertions(+), 29 deletions(-) (limited to 'eit.c') diff --git a/eit.c b/eit.c index f8b436c..dd51f0c 100644 --- a/eit.c +++ b/eit.c @@ -16,7 +16,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: eit.c 1.60 2002/11/10 15:50:21 kls Exp $ + * $Id: eit.c 1.61 2002/11/24 14:37:38 kls Exp $ ***************************************************************************/ #include "eit.h" @@ -180,7 +180,7 @@ bool cTDT::SetSystemTime() // --- cEventInfo ------------------------------------------------------------ -cEventInfo::cEventInfo(uint64 channelid, unsigned short eventid) +cEventInfo::cEventInfo(tChannelID channelid, unsigned short eventid) { pTitle = NULL; pSubtitle = NULL; @@ -190,7 +190,7 @@ cEventInfo::cEventInfo(uint64 channelid, unsigned short eventid) tTime = 0; uTableID = 0; uEventID = eventid; - uChannelID = channelid; + channelID = channelid; nChannelNumber = 0; } @@ -325,15 +325,15 @@ void cEventInfo::SetEventID(unsigned short evid) uEventID = evid; } /** */ -void cEventInfo::SetChannelID(uint64 channelid) +void cEventInfo::SetChannelID(tChannelID channelid) { - uChannelID = channelid; + channelID = channelid; } /** */ -uint64 cEventInfo::GetChannelID() const +tChannelID cEventInfo::GetChannelID() const { - return uChannelID; + return channelID; } /** */ @@ -404,13 +404,13 @@ bool cEventInfo::Read(FILE *f, cSchedule *Schedule) struct tEpgBugFixStats { int hits; int n; - uint64 channelIDs[MAXEPGBUGFIXCHANS]; + tChannelID channelIDs[MAXEPGBUGFIXCHANS]; tEpgBugFixStats(void) { hits = n = 0; } }; tEpgBugFixStats EpgBugFixStats[MAXEPGBUGFIXSTATS]; -static void EpgBugFixStat(int Number, uint64 ChannelID) +static void EpgBugFixStat(int Number, tChannelID ChannelID) { if (0 <= Number && Number < MAXEPGBUGFIXSTATS) { tEpgBugFixStats *p = &EpgBugFixStats[Number]; @@ -448,7 +448,7 @@ static void ReportEpgBugFixStats(bool Reset = false) char *q = buffer; q += snprintf(q, sizeof(buffer) - (q - buffer), "%d\t%d", i, p->hits); for (int c = 0; c < p->n; c++) { - cChannel *channel = Channels.GetByChannelID(p->channelIDs[c]); + cChannel *channel = Channels.GetByChannelID(p->channelIDs[c], true); if (channel) { q += snprintf(q, sizeof(buffer) - (q - buffer), "%s%s", delim, channel->Name()); delim = ", "; @@ -608,10 +608,10 @@ void cEventInfo::FixEpgBugs(void) // --- cSchedule ------------------------------------------------------------- -cSchedule::cSchedule(uint64 channelid) +cSchedule::cSchedule(tChannelID channelid) { pPresent = pFollowing = NULL; - uChannelID = channelid; + channelID = channelid; } @@ -645,14 +645,14 @@ const cEventInfo *cSchedule::GetFollowingEvent(void) const return pe; } -void cSchedule::SetChannelID(uint64 channelid) +void cSchedule::SetChannelID(tChannelID channelid) { - uChannelID = channelid; + channelID = channelid; } /** */ -uint64 cSchedule::GetChannelID() const +tChannelID cSchedule::GetChannelID() const { - return uChannelID; + return channelID; } /** */ const cEventInfo * cSchedule::GetEvent(unsigned short uEventID, time_t tTime) const @@ -735,10 +735,10 @@ void cSchedule::Cleanup(time_t tTime) /** */ void cSchedule::Dump(FILE *f, const char *Prefix) const { - cChannel *channel = Channels.GetByChannelID(uChannelID); + cChannel *channel = Channels.GetByChannelID(channelID, true); if (channel) { - fprintf(f, "%sC %s %s\n", Prefix, channel->GetChannelIDStr(), channel->Name()); + fprintf(f, "%sC %s %s\n", Prefix, channel->GetChannelID().ToString(), channel->Name()); for (cEventInfo *p = Events.First(); p; p = Events.Next(p)) p->Dump(f, Prefix); fprintf(f, "%sc\n", Prefix); @@ -756,9 +756,9 @@ bool cSchedule::Read(FILE *f, cSchedules *Schedules) if (p) *p = 0; // strips optional channel name if (*s) { - uint64 uChannelID = cChannel::StringToChannelID(s); - if (uChannelID) { - cSchedule *p = (cSchedule *)Schedules->AddChannelID(uChannelID); + tChannelID channelID = tChannelID::FromString(s); + if (channelID.Valid()) { + cSchedule *p = (cSchedule *)Schedules->AddChannelID(channelID); if (p) { if (!cEventInfo::Read(f, p)) return false; @@ -785,14 +785,13 @@ bool cSchedule::Read(FILE *f, cSchedules *Schedules) cSchedules::cSchedules() { pCurrentSchedule = NULL; - uCurrentChannelID = 0; } cSchedules::~cSchedules() { } /** */ -const cSchedule *cSchedules::AddChannelID(uint64 channelid) +const cSchedule *cSchedules::AddChannelID(tChannelID channelid) { const cSchedule *p = GetSchedule(channelid); if (!p) { @@ -802,11 +801,12 @@ const cSchedule *cSchedules::AddChannelID(uint64 channelid) return p; } /** */ -const cSchedule *cSchedules::SetCurrentChannelID(uint64 channelid) +const cSchedule *cSchedules::SetCurrentChannelID(tChannelID channelid) { + channelid.ClrRid(); pCurrentSchedule = AddChannelID(channelid); if (pCurrentSchedule) - uCurrentChannelID = channelid; + currentChannelID = channelid; return pCurrentSchedule; } /** */ @@ -815,10 +815,11 @@ const cSchedule * cSchedules::GetSchedule() const return pCurrentSchedule; } /** */ -const cSchedule * cSchedules::GetSchedule(uint64 channelid) const +const cSchedule * cSchedules::GetSchedule(tChannelID channelid) const { cSchedule *p; + channelid.ClrRid(); p = First(); while (p != NULL) { @@ -905,7 +906,8 @@ int cEIT::ProcessEIT(unsigned char *buffer, int CurrentSource) for (VdrProgramInfo = (struct VdrProgramInfo *) VdrProgramInfos->Head; VdrProgramInfo; VdrProgramInfo = (struct VdrProgramInfo *) xSucc (VdrProgramInfo)) { //XXX TODO use complete channel ID cChannel *channel = Channels.GetByServiceID(CurrentSource, VdrProgramInfo->ServiceID); - uint64 channelID = channel ? channel->GetChannelID() : (uint64(CurrentSource) << 48) | VdrProgramInfo->ServiceID; + tChannelID channelID = channel ? channel->GetChannelID() : tChannelID(CurrentSource, 0, 0, VdrProgramInfo->ServiceID); + channelID.ClrRid(); //XXX pSchedule = (cSchedule *)schedules->GetSchedule(channelID); if (!pSchedule) { @@ -915,7 +917,7 @@ int cEIT::ProcessEIT(unsigned char *buffer, int CurrentSource) break; } if (VdrProgramInfo->ReferenceServiceID) { - rSchedule = (cSchedule *)schedules->GetSchedule((uint64(CurrentSource) << 48) | VdrProgramInfo->ReferenceServiceID); + rSchedule = (cSchedule *)schedules->GetSchedule(tChannelID(CurrentSource, 0, 0, VdrProgramInfo->ReferenceServiceID)); if (!rSchedule) break; rEvent = (cEventInfo *)rSchedule->GetEvent((unsigned short)VdrProgramInfo->ReferenceEventID); @@ -1270,7 +1272,7 @@ void cSIProcessor::SetCurrentTransponder(int CurrentSource, int CurrentTranspond } /** */ -bool cSIProcessor::SetCurrentChannelID(uint64 channelid) +bool cSIProcessor::SetCurrentChannelID(tChannelID channelid) { cMutexLock MutexLock(&schedulesMutex); return schedules ? schedules->SetCurrentChannelID(channelid) : false; -- cgit v1.2.3