Enhanced logging EPG event data

This commit is contained in:
Klaus Schmidinger 2006-03-25 12:51:29 +01:00
parent daaab1dfc8
commit 8a3dae1e8b
4 changed files with 16 additions and 10 deletions

View File

@ -4443,3 +4443,4 @@ Video Disk Recorder Revision History
- Updated the Russian OSD texts (thanks to Oleg Roitburd). - Updated the Russian OSD texts (thanks to Oleg Roitburd).
- Made cMenuRecordings::GetRecording() 'protected' (suggested by Marius Heidenstecker). - Made cMenuRecordings::GetRecording() 'protected' (suggested by Marius Heidenstecker).
- Speeded up cRemux::ScanVideoPacket() (thanks to Reinhard Nissl). - Speeded up cRemux::ScanVideoPacket() (thanks to Reinhard Nissl).
- Enhanced logging EPG event data.

12
epg.c
View File

@ -7,7 +7,7 @@
* Original version (as used in VDR before 1.3.0) written by * Original version (as used in VDR before 1.3.0) written by
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. * Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
* *
* $Id: epg.c 1.66 2006/03/25 11:43:00 kls Exp $ * $Id: epg.c 1.67 2006/03/25 12:48:34 kls Exp $
*/ */
#include "epg.h" #include "epg.h"
@ -157,7 +157,7 @@ void cEvent::SetVersion(uchar Version)
void cEvent::SetRunningStatus(int RunningStatus, cChannel *Channel) void cEvent::SetRunningStatus(int RunningStatus, cChannel *Channel)
{ {
if (Channel && runningStatus != RunningStatus && (RunningStatus > SI::RunningStatusNotRunning || runningStatus > SI::RunningStatusUndefined) && Channel->HasTimer()) 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); isyslog("channel %d (%s) event %s status %d", Channel->Number(), Channel->Name(), *ToDescr(), RunningStatus);
runningStatus = RunningStatus; runningStatus = RunningStatus;
} }
@ -208,6 +208,14 @@ void cEvent::SetSeen(void)
seen = time(NULL); seen = time(NULL);
} }
cString cEvent::ToDescr(void) const
{
char vpsbuf[64] = "";
if (Vps())
sprintf(vpsbuf, "(VPS: %s) ", *GetVpsString());
return cString::sprintf("%s %s-%s %s'%s'", *GetDateString(), *GetTimeString(), *GetEndTimeString(), vpsbuf, Title());
}
bool cEvent::HasTimer(void) const bool cEvent::HasTimer(void) const
{ {
for (cTimer *t = Timers.First(); t; t = Timers.Next(t)) { for (cTimer *t = Timers.First(); t; t = Timers.Next(t)) {

3
epg.h
View File

@ -7,7 +7,7 @@
* Original version (as used in VDR before 1.3.0) written by * Original version (as used in VDR before 1.3.0) written by
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. * Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
* *
* $Id: epg.h 1.33 2006/02/26 13:58:57 kls Exp $ * $Id: epg.h 1.34 2006/03/25 12:39:39 kls Exp $
*/ */
#ifndef __EPG_H #ifndef __EPG_H
@ -103,6 +103,7 @@ public:
void SetDuration(int Duration); void SetDuration(int Duration);
void SetVps(time_t Vps); void SetVps(time_t Vps);
void SetSeen(void); void SetSeen(void);
cString ToDescr(void) const;
void Dump(FILE *f, const char *Prefix = "", bool InfoOnly = false) const; void Dump(FILE *f, const char *Prefix = "", bool InfoOnly = false) const;
bool Parse(char *s); bool Parse(char *s);
static bool Read(FILE *f, cSchedule *Schedule); static bool Read(FILE *f, cSchedule *Schedule);

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: timers.c 1.53 2006/03/25 11:41:24 kls Exp $ * $Id: timers.c 1.54 2006/03/25 12:43:59 kls Exp $
*/ */
#include "timers.h" #include "timers.h"
@ -492,12 +492,8 @@ void cTimer::SetEventFromSchedule(const cSchedules *Schedules)
void cTimer::SetEvent(const cEvent *Event) void cTimer::SetEvent(const cEvent *Event)
{ {
if (event != Event) { //XXX TODO check event data, too??? if (event != Event) { //XXX TODO check event data, too???
if (Event) { if (Event)
char vpsbuf[64] = ""; isyslog("timer %s set to event %s", *ToDescr(), *Event->ToDescr());
if (Event->Vps())
sprintf(vpsbuf, "(VPS: %s) ", *Event->GetVpsString());
isyslog("timer %s set to event %s %s-%s %s'%s'", *ToDescr(), *Event->GetDateString(), *Event->GetTimeString(), *Event->GetEndTimeString(), vpsbuf, Event->Title());
}
else else
isyslog("timer %s set to no event", *ToDescr()); isyslog("timer %s set to no event", *ToDescr());
event = Event; event = Event;