From 457f5dd14c426c7324a7987c4bcd7f9b2b641b6d Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Tue, 28 Feb 2006 14:00:28 +0100 Subject: The status changes of EPG events are now logged for all channels that have timers --- HISTORY | 1 + channels.c | 12 +++++++++++- channels.h | 3 ++- epg.c | 5 ++--- menu.c | 12 +++++------- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/HISTORY b/HISTORY index 94a8ca31..69aa8470 100644 --- a/HISTORY +++ b/HISTORY @@ -4421,3 +4421,4 @@ Video Disk Recorder Revision History - Reduced the number of events to actually check when setting events to timers. - cMenuEditIntItem now checks the given value and forces it to be between the given min and max limits. +- The status changes of EPG events are now logged for all channels that have timers. diff --git a/channels.c b/channels.c index bf1230bd..c4000616 100644 --- a/channels.c +++ b/channels.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: channels.c 1.48 2006/01/14 15:51:02 kls Exp $ + * $Id: channels.c 1.49 2006/02/28 13:54:34 kls Exp $ */ #include "channels.h" @@ -12,6 +12,7 @@ #include #include "device.h" #include "epg.h" +#include "timers.h" // IMPORTANT NOTE: in the 'sscanf()' calls there is a blank after the '%d' // format characters in order to allow any number of blanks after a numeric @@ -248,6 +249,15 @@ int cChannel::Transponder(void) const return tf; } +bool cChannel::HasTimer(void) const +{ + for (cTimer *Timer = Timers.First(); Timer; Timer = Timers.Next(Timer)) { + if (Timer->Channel() == this) + return true; + } + return false; +} + int cChannel::Modification(int Mask) { int Result = modification & Mask; diff --git a/channels.h b/channels.h index ef4e80b3..c7da4f35 100644 --- a/channels.h +++ b/channels.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: channels.h 1.39 2006/02/19 14:39:43 kls Exp $ + * $Id: channels.h 1.40 2006/02/28 13:52:49 kls Exp $ */ #ifndef __CHANNELS_H @@ -202,6 +202,7 @@ public: bool IsSat(void) const { return cSource::IsSat(source); } bool IsTerr(void) const { return cSource::IsTerr(source); } tChannelID GetChannelID(void) const { return tChannelID(source, nid, (nid || tid) ? tid : Transponder(), sid, rid); } + bool HasTimer(void) const; int Modification(int Mask = CHANNELMOD_ALL); void CopyTransponderData(const cChannel *Channel); bool SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH); diff --git a/epg.c b/epg.c index 2f88af9a..9b24da46 100644 --- a/epg.c +++ b/epg.c @@ -7,7 +7,7 @@ * Original version (as used in VDR before 1.3.0) written by * Robert Schneider and Rolf Hakenes . * - * $Id: epg.c 1.64 2006/02/26 15:07:17 kls Exp $ + * $Id: epg.c 1.65 2006/02/28 13:56:05 kls Exp $ */ #include "epg.h" @@ -156,8 +156,7 @@ void cEvent::SetVersion(uchar Version) void cEvent::SetRunningStatus(int RunningStatus, cChannel *Channel) { - if (Channel && runningStatus != RunningStatus && (RunningStatus > SI::RunningStatusNotRunning || runningStatus > SI::RunningStatusUndefined)) - if (Channel->Number() <= 30)//XXX maybe log only those that have timers??? + if (Channel && runningStatus != RunningStatus && (RunningStatus > SI::RunningStatusNotRunning || runningStatus > SI::RunningStatusUndefined) && Channel->HasTimer()) isyslog("channel %d (%s) event %s '%s' status %d", Channel->Number(), Channel->Name(), *GetTimeString(), Title(), RunningStatus); runningStatus = RunningStatus; } diff --git a/menu.c b/menu.c index 0d555286..f3c9fab9 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.423 2006/02/28 12:15:43 kls Exp $ + * $Id: menu.c 1.424 2006/02/28 13:58:00 kls Exp $ */ #include "menu.h" @@ -500,12 +500,10 @@ eOSState cMenuChannels::Delete(void) cChannel *channel = GetChannel(Current()); int DeletedChannel = channel->Number(); // Check if there is a timer using this channel: - for (cTimer *ti = Timers.First(); ti; ti = Timers.Next(ti)) { - if (ti->Channel() == channel) { - Skins.Message(mtError, tr("Channel is being used by a timer!")); - return osContinue; - } - } + if (channel->HasTimer()) { + Skins.Message(mtError, tr("Channel is being used by a timer!")); + return osContinue; + } if (Interface->Confirm(tr("Delete channel?"))) { Channels.Del(channel); cOsdMenu::Del(Index); -- cgit v1.2.3