From 5a4eb3f1041b8a53826cebe570f9d201f3d35826 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 29 Feb 2004 18:00:00 +0100 Subject: =?UTF-8?q?Version=201.3.5=20-=20Fixed=20reading=20the=20EPG=20pre?= =?UTF-8?q?ferred=20language=20parameter=20from=20'setup.conf'.=20-=20Fixe?= =?UTF-8?q?d=20switching=20to=20a=20visible=20programme=20in=20case=20the?= =?UTF-8?q?=20current=20channel=20has=20neither=20=20=20a=20video=20nor=20?= =?UTF-8?q?an=20audio=20PID.=20-=20Fixed=20editing=20channels=20(SID=20now?= =?UTF-8?q?=20range=20checked)=20and=20creating=20new=20channels=20(NID,?= =?UTF-8?q?=20=20=20TID=20and=20RID=20are=20now=20set=20to=200).=20-=20Fix?= =?UTF-8?q?ed=20transponder=20handling=20to=20make=20it=20work=20with=20sa?= =?UTF-8?q?tellites=20that=20provide=20two=20=20=20transponders=20on=20the?= =?UTF-8?q?=20same=20frequency,=20with=20different=20polarization,=20like?= =?UTF-8?q?=20Hispasat=20=20=20at=20S30.0W=20(thanks=20to=20Thomas=20Bergw?= =?UTF-8?q?inkl=20for=20pointing=20this=20out).=20See=20man=20vdr(5)=20=20?= =?UTF-8?q?=20for=20details=20about=20the=20enhanced=20channel=20ID=20form?= =?UTF-8?q?at.=20-=20Since=20there=20appears=20to=20be=20no=20general=20so?= =?UTF-8?q?lution=20for=20the=20UPT=20error=20yet,=20a=20recording=20=20?= =?UTF-8?q?=20now=20initiates=20an=20"emergency=20exit"=20if=20the=20numbe?= =?UTF-8?q?r=20of=20UPT=20errors=20during=20one=20=20=20recording=20exceed?= =?UTF-8?q?s=2010=20(suggested=20by=20Gregoire=20Favre).=20Since=20the=20U?= =?UTF-8?q?PT=20error=20doesn't=20=20=20happen=20on=20my=20system,=20this?= =?UTF-8?q?=20has=20not=20been=20explicitly=20tested.=20=20=20The=20"preli?= =?UTF-8?q?minary=20fix"=20for=20the=20UPT=20error=20in=20VDR/dvbdevice.c?= =?UTF-8?q?=20has=20been=20disabled=20=20=20by=20default,=20since=20it=20m?= =?UTF-8?q?akes=20channel=20switching=20unpleasently=20slow.=20If=20you=20?= =?UTF-8?q?want=20=20=20to=20have=20that=20workaround=20back,=20you=20can?= =?UTF-8?q?=20uncomment=20the=20line=20=20=20//#define=20WAIT=5FFOR=5FLOCK?= =?UTF-8?q?=5FAFTER=5FTUNING=201=20=20=20in=20VDR/dvbdevice.c.=20-=20Adapt?= =?UTF-8?q?ed=20the=20'sky'=20plugin=20to=20use=20the=20actual=20channel?= =?UTF-8?q?=20IDs,=20and=20to=20fetch=20EPG=20data=20=20=20from=20www.bleb?= =?UTF-8?q?.org.=20-=20Limited=20automatic=20retuning=20to=20devices=20tha?= =?UTF-8?q?t=20actually=20provide=20the=20transponder=20=20=20(necessary?= =?UTF-8?q?=20for=20the=20'sky'=20plugin).=20-=20Fixed=20handling=20receiv?= =?UTF-8?q?ers=20in=20the=20'sky'=20plugin,=20so=20that=20a=20recording=20?= =?UTF-8?q?on=20the=20same=20=20=20channel=20won't=20interrupt=20an=20ongo?= =?UTF-8?q?ing=20Transfer=20Mode.=20-=20Added=20subtable=20ID=20and=20TSDT?= =?UTF-8?q?=20handling=20to=20'libsi'=20(thanks=20to=20Marcel=20Wiesweg).?= =?UTF-8?q?=20-=20Fixed=20some=20Russian=20OSD=20texts=20(thanks=20to=20Vy?= =?UTF-8?q?acheslav=20Dikonov).=20-=20Added=20the=20'running=20status'=20t?= =?UTF-8?q?o=20the=20EPG=20events.=20This=20is=20necessary=20for=20impleme?= =?UTF-8?q?nting=20=20=20the=20VPS=20function=20for=20recording.=20-=20Rem?= =?UTF-8?q?oved=20the=20obsolete=20'present'=20and=20'following'=20handlin?= =?UTF-8?q?g=20from=20the=20EPG=20data.=20-=20The=20EPG=20data=20is=20now?= =?UTF-8?q?=20always=20kept=20sorted=20chronologically=20in=20the=20intern?= =?UTF-8?q?al=20data=20=20=20structures.=20This=20also=20means=20that=20an?= =?UTF-8?q?y=20EPG=20data=20retrieved=20through=20the=20SVRDP=20=20=20comm?= =?UTF-8?q?and=20LSTE=20is=20guaranteed=20to=20be=20sorted=20by=20start=20?= =?UTF-8?q?time.=20-=20Now=20using=20the=20'running=20status'=20in=20the?= =?UTF-8?q?=20channel=20display,=20so=20that=20a=20programme=20=20=20that?= =?UTF-8?q?=20has=20an=20end=20time=20that=20is=20before=20the=20current?= =?UTF-8?q?=20time,=20but=20is=20still=20running,=20=20=20will=20still=20b?= =?UTF-8?q?e=20shown=20in=20the=20display=20(provided=20the=20broadcasters?= =?UTF-8?q?=20handle=20the=20=20=20'running=20status'=20flag=20correctly).?= =?UTF-8?q?=20This=20also=20applies=20to=20programmes=20that=20have=20=20?= =?UTF-8?q?=20a=20start=20time=20that=20is=20in=20the=20future,=20but=20ar?= =?UTF-8?q?e=20already=20running.=20-=20Implemented=20an=20"EPG=20linger?= =?UTF-8?q?=20time",=20which=20can=20be=20set=20to=20have=20older=20EPG=20?= =?UTF-8?q?information=20=20=20still=20displayed=20in=20the=20"Schedule"?= =?UTF-8?q?=20menu=20(thanks=20to=20Jaakko=20Hyv=C3=A4tti).=20-=20Added=20?= =?UTF-8?q?PDCDescriptor=20handling=20to=20'libsi'.=20-=20Implemented=20ha?= =?UTF-8?q?ndling=20the=20VPS=20timestamps=20(aka=20"Programme=20Identific?= =?UTF-8?q?ation=20Label")=20=20=20for=20full=20VPS=20support=20for=20time?= =?UTF-8?q?rs=20(provided=20the=20tv=20stations=20actually=20broadcast=20?= =?UTF-8?q?=20=20this=20information).=20The=20VPS=20time=20is=20displayed?= =?UTF-8?q?=20in=20the=20event=20info=20page=20if=20it=20exists=20=20=20an?= =?UTF-8?q?d=20is=20different=20than=20the=20event's=20start=20time.=20-?= =?UTF-8?q?=20Extended=20the=20SVDRP=20command=20LSTE=20to=20allow=20limit?= =?UTF-8?q?ing=20the=20listed=20data=20to=20a=20given=20=20=20channel,=20t?= =?UTF-8?q?he=20present=20or=20following=20events,=20or=20events=20at=20a?= =?UTF-8?q?=20given=20time=20(thanks=20to=20=20=20Thomas=20Heiligenmann).?= =?UTF-8?q?=20-=20Fixed=20a=20typo=20in=20libsi/si.h=20(thanks=20to=20St?= =?UTF-8?q?=C3=A9phane=20Est=C3=A9-Gracias).=20-=20Timers=20can=20now=20be?= =?UTF-8?q?=20set=20to=20use=20the=20VPS=20information=20to=20control=20re?= =?UTF-8?q?cording=20a=20programme.=20=20=20The=20new=20setup=20options=20?= =?UTF-8?q?"Recording/Use=20VPS"=20and=20"Recording/VPS=20margin",=20as=20?= =?UTF-8?q?well=20as=20=20=20the=20"VPS"=20option=20in=20the=20individual?= =?UTF-8?q?=20timers,=20can=20be=20used=20to=20control=20this=20feature=20?= =?UTF-8?q?=20=20(see=20MANUAL=20for=20details).=20=20=20Note=20that=20thi?= =?UTF-8?q?s=20feature=20will=20certainly=20need=20a=20lot=20of=20testing?= =?UTF-8?q?=20before=20it=20can=20be=20=20=20called=20"safe"!=20-=20The=20?= =?UTF-8?q?"Schedule"=20and=20"What's=20on=20now/next=3F"=20menus=20now=20?= =?UTF-8?q?have=20an=20additional=20column=20=20=20which=20displays=20info?= =?UTF-8?q?rmation=20on=20whether=20there=20is=20a=20timer=20defined=20for?= =?UTF-8?q?=20an=20event,=20=20=20whether=20an=20event=20has=20a=20VPS=20t?= =?UTF-8?q?ime=20that's=20different=20than=20its=20start=20time,=20and=20?= =?UTF-8?q?=20=20whether=20an=20event=20is=20currently=20running=20(see=20?= =?UTF-8?q?MANUAL=20under=20"The=20"Schedule"=20Menu"=20=20=20for=20detail?= =?UTF-8?q?s).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- menu.c | 163 ++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 80 insertions(+), 83 deletions(-) (limited to 'menu.c') diff --git a/menu.c b/menu.c index 6a7907f..c153151 100644 --- a/menu.c +++ b/menu.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.c 1.284 2004/02/08 15:06:42 kls Exp $ + * $Id: menu.c 1.292 2004/02/22 14:14:55 kls Exp kls $ */ #include "menu.h" @@ -18,6 +18,7 @@ #include "cutter.h" #include "eitscan.h" #include "i18n.h" +#include "libsi/si.h" #include "menuitems.h" #include "plugin.h" #include "recording.h" @@ -557,8 +558,12 @@ cMenuEditChannel::cMenuEditChannel(cChannel *Channel, bool New) channel = Channel; if (channel) { data = *channel; - if (New) + if (New) { channel = NULL; + data.nid = 0; + data.tid = 0; + data.rid = 0; + } Setup(); } } @@ -583,7 +588,7 @@ void cMenuEditChannel::Setup(void) Add(new cMenuEditIntItem( tr("Dpid2"), &data.dpids[1], 0, 0x1FFF)); Add(new cMenuEditIntItem( tr("Tpid"), &data.tpid, 0, 0x1FFF)); Add(new cMenuEditCaItem( tr("CA"), &data.caids[0], true));//XXX - Add(new cMenuEditIntItem( tr("Sid"), &data.sid, 0)); + Add(new cMenuEditIntItem( tr("Sid"), &data.sid, 1, 0xFFFF)); /* XXX not yet used Add(new cMenuEditIntItem( tr("Nid"), &data.nid, 0)); Add(new cMenuEditIntItem( tr("Tid"), &data.tid, 0)); @@ -867,13 +872,14 @@ cMenuEditTimer::cMenuEditTimer(cTimer *Timer, bool New) if (timer) { data = *timer; if (New) - data.active = 1; + data.SetFlags(tfActive); channel = data.Channel()->Number(); - Add(new cMenuEditBoolItem(tr("Active"), &data.active)); + Add(new cMenuEditBitItem( tr("Active"), &data.flags, tfActive)); Add(new cMenuEditChanItem(tr("Channel"), &channel)); Add(new cMenuEditDayItem( tr("Day"), &data.day)); Add(new cMenuEditTimeItem(tr("Start"), &data.start)); Add(new cMenuEditTimeItem(tr("Stop"), &data.stop)); + Add(new cMenuEditBitItem( tr("VPS"), &data.flags, tfVps)); Add(new cMenuEditIntItem( tr("Priority"), &data.priority, 0, MAXPRIORITY)); Add(new cMenuEditIntItem( tr("Lifetime"), &data.lifetime, 0, MAXLIFETIME)); Add(new cMenuEditStrItem( tr("File"), data.file, sizeof(data.file), tr(FileNameChars))); @@ -922,13 +928,13 @@ eOSState cMenuEditTimer::ProcessKey(eKeys Key) if (timer) { if (memcmp(timer, &data, sizeof(data)) != 0) { *timer = data; - if (timer->active) - timer->active = 1; // allows external programs to mark active timers with values > 1 and recognize if the user has modified them + if (timer->HasFlags(tfActive)) + timer->ClrFlags(~tfAll); // allows external programs to mark active timers with values > 0xFFFF and recognize if the user has modified them } if (addIfConfirmed) Timers.Add(timer); Timers.Save(); - isyslog("timer %d %s (%s)", timer->Index() + 1, addIfConfirmed ? "added" : "modified", timer->active ? "active" : "inactive"); + isyslog("timer %d %s (%s)", timer->Index() + 1, addIfConfirmed ? "added" : "modified", timer->HasFlags(tfActive) ? "active" : "inactive"); addIfConfirmed = false; } } @@ -972,7 +978,7 @@ void cMenuTimerItem::Set(void) { char *buffer = NULL; asprintf(&buffer, "%c\t%d\t%s\t%02d:%02d\t%02d:%02d\t%s", - !timer->Active() ? ' ' : timer->FirstDay() ? '!' : timer->Recording() ? '#' : '>', + !(timer->HasFlags(tfActive)) ? ' ' : timer->FirstDay() ? '!' : timer->Recording() ? '#' : '>', timer->Channel()->Number(), timer->PrintDay(timer->Day()), timer->Start() / 100, @@ -1037,7 +1043,7 @@ eOSState cMenuTimers::OnOff(void) if (timer->FirstDay()) isyslog("timer %d first day set to %s", timer->Index() + 1, timer->PrintFirstDay()); else - isyslog("timer %d %sactivated", timer->Index() + 1, timer->Active() ? "" : "de"); + isyslog("timer %d %sactivated", timer->Index() + 1, timer->HasFlags(tfActive) ? "" : "de"); Timers.Save(); } return osContinue; @@ -1164,6 +1170,13 @@ cMenuEvent::cMenuEvent(const cEvent *Event, bool CanSwitch) Add(item = new cMenuTextItem(Subtitle, 1, Line, Setup.OSDwidth - 2, -1, clrYellow)); Line += item->Height() + 1; } + if (Event->Vps() && Event->Vps() != Event->StartTime()) { + char *buffer; + asprintf(&buffer, "VPS: %s", Event->GetVpsString()); + Add(item = new cMenuTextItem(buffer, 1, Line, Setup.OSDwidth - 2, -1, clrYellow)); + free(buffer); + Line += item->Height() + 1; + } if (!isempty(ExtendedDescription)) Add(new cMenuTextItem(ExtendedDescription, 1, Line, Setup.OSDwidth - 2, Height() - Line - 2, clrCyan), true); SetHelp(tr("Record"), NULL, NULL, CanSwitch ? tr("Switch") : NULL); @@ -1191,15 +1204,20 @@ eOSState cMenuEvent::ProcessKey(eKeys Key) class cMenuWhatsOnItem : public cOsdItem { public: const cEvent *event; - cMenuWhatsOnItem(const cEvent *Event); + const cChannel *channel; + cMenuWhatsOnItem(const cEvent *Event, cChannel *Channel); }; -cMenuWhatsOnItem::cMenuWhatsOnItem(const cEvent *Event) +cMenuWhatsOnItem::cMenuWhatsOnItem(const cEvent *Event, cChannel *Channel) { event = Event; + channel = Channel; char *buffer = NULL; - cChannel *channel = Channels.GetByNumber(event->ChannelNumber()); - asprintf(&buffer, "%d\t%.*s\t%.*s\t%s", event->ChannelNumber(), 6, channel ? channel->Name() : "???", 5, event->GetTimeString(), event->Title()); + int TimerMatch; + char t = Timers.GetMatch(Event, &TimerMatch) ? (TimerMatch == tmFull) ? 'T' : 't' : ' '; + char v = event->Vps() && (event->Vps() - event->StartTime()) ? 'V' : ' '; + char r = event->RunningStatus() > SI::RunningStatusNotRunning ? '*' : ' '; + asprintf(&buffer, "%d\t%.*s\t%.*s\t%c%c%c\t%s", channel->Number(), 6, channel->Name(), 5, event->GetTimeString(), t, v, r, event->Title()); SetText(buffer, false); } @@ -1222,39 +1240,20 @@ public: int cMenuWhatsOn::currentChannel = 0; const cEvent *cMenuWhatsOn::scheduleEvent = NULL; -static int CompareEventChannel(const void *p1, const void *p2) -{ - return (int)( (*(const cEvent **)p1)->ChannelNumber() - (*(const cEvent **)p2)->ChannelNumber()); -} - cMenuWhatsOn::cMenuWhatsOn(const cSchedules *Schedules, bool Now, int CurrentChannelNr) -:cOsdMenu(Now ? tr("What's on now?") : tr("What's on next?"), CHNUMWIDTH, 7, 6) -{ - const cSchedule *Schedule = Schedules->First(); - const cEvent **pArray = NULL; - int num = 0; - - while (Schedule) { - pArray = (const cEvent **)realloc(pArray, (num + 1) * sizeof(cEvent *)); - - pArray[num] = Now ? Schedule->GetPresentEvent() : Schedule->GetFollowingEvent(); - if (pArray[num]) { - cChannel *channel = Channels.GetByChannelID(pArray[num]->ChannelID(), true); - if (channel) { - pArray[num]->SetChannelNumber(channel->Number()); - num++; - } - } - Schedule = (const cSchedule *)Schedules->Next(Schedule); - } - - qsort(pArray, num, sizeof(cEvent *), CompareEventChannel); - - for (int a = 0; a < num; a++) - Add(new cMenuWhatsOnItem(pArray[a]), pArray[a]->ChannelNumber() == CurrentChannelNr); - +:cOsdMenu(Now ? tr("What's on now?") : tr("What's on next?"), CHNUMWIDTH, 7, 6, 4) +{ + for (cChannel *Channel = Channels.First(); Channel; Channel = Channels.Next(Channel)) { + if (!Channel->GroupSep()) { + const cSchedule *Schedule = Schedules->GetSchedule(Channel->GetChannelID()); + if (Schedule) { + const cEvent *Event = Now ? Schedule->GetPresentEvent() : Schedule->GetFollowingEvent(); + if (Event) + Add(new cMenuWhatsOnItem(Event, Channel), Channel->Number() == CurrentChannelNr); + } + } + } currentChannel = CurrentChannelNr; - free(pArray); SetHelp(Count() ? tr("Record") : NULL, Now ? tr("Next") : tr("Now"), tr("Button$Schedule"), tr("Switch")); } @@ -1306,7 +1305,7 @@ eOSState cMenuWhatsOn::ProcessKey(eKeys Key) cMenuWhatsOnItem *mi = (cMenuWhatsOnItem *)Get(Current()); if (mi) { scheduleEvent = mi->event; - currentChannel = mi->event->ChannelNumber(); + currentChannel = mi->channel->Number(); } } break; @@ -1332,7 +1331,11 @@ cMenuScheduleItem::cMenuScheduleItem(const cEvent *Event) { event = Event; char *buffer = NULL; - asprintf(&buffer, "%.*s\t%.*s\t%s", 5, event->GetDateString(), 5, event->GetTimeString(), event->Title()); + int TimerMatch; + char t = Timers.GetMatch(Event, &TimerMatch) ? (TimerMatch == tmFull) ? 'T' : 't' : ' '; + char v = event->Vps() && (event->Vps() - event->StartTime()) ? 'V' : ' '; + char r = event->RunningStatus() > SI::RunningStatusNotRunning ? '*' : ' '; + asprintf(&buffer, "%.*s\t%.*s\t%c%c%c\t%s", 5, event->GetDateString(), 5, event->GetTimeString(), t, v, r, event->Title()); SetText(buffer, false); } @@ -1354,7 +1357,7 @@ public: }; cMenuSchedule::cMenuSchedule(void) -:cOsdMenu("", 6, 6) +:cOsdMenu("", 6, 6, 4) { now = next = false; otherChannel = 0; @@ -1372,11 +1375,6 @@ cMenuSchedule::~cMenuSchedule() cMenuWhatsOn::ScheduleEvent(); // makes sure any posted data is cleared } -static int CompareEventTime(const void *p1, const void *p2) -{ - return (int)((*(cEvent **)p1)->StartTime() - (*(cEvent **)p2)->StartTime()); -} - void cMenuSchedule::PrepareSchedule(cChannel *Channel) { Clear(); @@ -1387,23 +1385,14 @@ void cMenuSchedule::PrepareSchedule(cChannel *Channel) if (schedules) { const cSchedule *Schedule = schedules->GetSchedule(Channel->GetChannelID()); if (Schedule) { + const cEvent *PresentEvent = Schedule->GetPresentEvent(Channel->Number() == cDevice::CurrentChannel()); int num = Schedule->NumEvents(); - const cEvent **pArray = MALLOC(const cEvent *, num); - if (pArray) { - time_t now = time(NULL); - int numreal = 0; - for (int a = 0; a < num; a++) { - const cEvent *Event = Schedule->GetEventNumber(a); - if (Event->StartTime() + Event->Duration() > now) - pArray[numreal++] = Event; - } - - qsort(pArray, numreal, sizeof(cEvent *), CompareEventTime); - - for (int a = 0; a < numreal; a++) - Add(new cMenuScheduleItem(pArray[a])); - free(pArray); - } + time_t now = time(NULL) - Setup.EPGLinger * 60; + for (int a = 0; a < num; a++) { + const cEvent *Event = Schedule->GetEventNumber(a); + if (Event->StartTime() + Event->Duration() > now || Event == PresentEvent) + Add(new cMenuScheduleItem(Event), Event == PresentEvent); + } } } } @@ -2057,6 +2046,7 @@ void cMenuSetupEPG::Setup(void) Add(new cMenuEditIntItem( tr("Setup.EPG$EPG scan timeout (h)"), &data.EPGScanTimeout)); Add(new cMenuEditIntItem( tr("Setup.EPG$EPG bugfix level"), &data.EPGBugfixLevel, 0, MAXEPGBUGFIXLEVEL)); + Add(new cMenuEditIntItem( tr("Setup.EPG$EPG linger time (min)"), &data.EPGLinger, 0)); Add(new cMenuEditBoolItem(tr("Setup.EPG$Set system time"), &data.SetSystemTime)); if (data.SetSystemTime) Add(new cMenuEditTranItem(tr("Setup.EPG$Use time from transponder"), &data.TimeTransponder)); @@ -2314,6 +2304,8 @@ cMenuSetupRecord::cMenuSetupRecord(void) Add(new cMenuEditIntItem( tr("Setup.Recording$Pause priority"), &data.PausePriority, 0, MAXPRIORITY)); Add(new cMenuEditIntItem( tr("Setup.Recording$Pause lifetime (d)"), &data.PauseLifetime, 0, MAXLIFETIME)); Add(new cMenuEditBoolItem(tr("Setup.Recording$Use episode name"), &data.UseSubtitle)); + Add(new cMenuEditBoolItem(tr("Setup.Recording$Use VPS"), &data.UseVps)); + Add(new cMenuEditIntItem( tr("Setup.Recording$VPS margin (s)"), &data.VpsMargin, 0)); Add(new cMenuEditBoolItem(tr("Setup.Recording$Mark instant recording"), &data.MarkInstantRecord)); Add(new cMenuEditStrItem( tr("Setup.Recording$Name instant recording"), data.NameInstantRecord, sizeof(data.NameInstantRecord), tr(FileNameChars))); Add(new cMenuEditIntItem( tr("Setup.Recording$Instant rec. time (min)"), &data.InstantRecordTime, 1, MAXINSTANTRECTIME)); @@ -2784,7 +2776,7 @@ void cDisplayChannel::DisplayInfo(void) if (Schedule) { const char *PresentTitle = NULL, *PresentSubtitle = NULL, *FollowingTitle = NULL, *FollowingSubtitle = NULL; int Lines = 0; - if ((Present = Schedule->GetPresentEvent()) != NULL) { + if ((Present = Schedule->GetPresentEvent(true)) != NULL) { PresentTitle = Present->Title(); if (!isempty(PresentTitle)) Lines++; @@ -2792,7 +2784,7 @@ void cDisplayChannel::DisplayInfo(void) if (!isempty(PresentSubtitle)) Lines++; } - if ((Following = Schedule->GetFollowingEvent()) != NULL) { + if ((Following = Schedule->GetFollowingEvent(true)) != NULL) { FollowingTitle = Following->Title(); if (!isempty(FollowingTitle)) Lines++; @@ -3076,11 +3068,12 @@ cRecordControl::cRecordControl(cDevice *Device, cTimer *Timer, bool Pause) } timer->SetPending(true); timer->SetRecording(true); + event = timer->Event(); const char *Title = NULL; const char *Subtitle = NULL; const char *Summary = NULL; - if (GetEvent()) { + if (event || GetEvent()) { Title = event->Title(); Subtitle = event->ShortText(); Summary = event->Description(); @@ -3135,7 +3128,7 @@ cRecordControl::~cRecordControl() bool cRecordControl::GetEvent(void) { const cChannel *channel = timer->Channel(); - time_t Time = timer->Active() == taActInst ? timer->StartTime() + INSTANT_REC_EPG_LOOKAHEAD : timer->StartTime() + (timer->StopTime() - timer->StartTime()) / 2; + time_t Time = timer->HasFlags(tfInstant) ? timer->StartTime() + INSTANT_REC_EPG_LOOKAHEAD : timer->StartTime() + (timer->StopTime() - timer->StartTime()) / 2; for (int seconds = 0; seconds <= MAXWAIT4EPGINFO; seconds++) { { cSchedulesLock SchedulesLock; @@ -3207,12 +3200,14 @@ bool cRecordControls::Start(cTimer *Timer, bool Pause) cThread::EmergencyExit(true); return false; } - for (int i = 0; i < MAXRECORDCONTROLS; i++) { - if (!RecordControls[i]) { - RecordControls[i] = new cRecordControl(device, Timer, Pause); - return true; + if (!Timer || Timer->Matches()) { + for (int i = 0; i < MAXRECORDCONTROLS; i++) { + if (!RecordControls[i]) { + RecordControls[i] = new cRecordControl(device, Timer, Pause); + return true; + } } - } + } } else if (!Timer || (Timer->Priority() >= Setup.PrimaryLimit && !Timer->Pending())) isyslog("no free DVB device to record channel %d!", ch); @@ -3237,7 +3232,7 @@ void cRecordControls::Stop(cDevice *Device) { for (int i = 0; i < MAXRECORDCONTROLS; i++) { if (RecordControls[i]) { - if (RecordControls[i]->Uses(Device)) { + if (RecordControls[i]->Device() == Device) { isyslog("stopping recording on DVB device %d due to higher priority", Device->CardIndex() + 1); RecordControls[i]->Stop(true); } @@ -3316,10 +3311,12 @@ void cRecordControls::ChannelDataModified(cChannel *Channel) for (int i = 0; i < MAXRECORDCONTROLS; i++) { if (RecordControls[i]) { if (RecordControls[i]->Timer() && RecordControls[i]->Timer()->Channel() == Channel) { - isyslog("stopping recording due to modification of channel %d", Channel->Number()); - RecordControls[i]->Stop(true); - // This will restart the recording, maybe even from a different - // device in case conditional access has changed. + if (RecordControls[i]->Device()->ProvidesTransponder(Channel)) { // avoids retune on devices that don't really access the transponder + isyslog("stopping recording due to modification of channel %d", Channel->Number()); + RecordControls[i]->Stop(true); + // This will restart the recording, maybe even from a different + // device in case conditional access has changed. + } } } } -- cgit v1.2.3