summaryrefslogtreecommitdiff
path: root/epg.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-02-22 15:36:36 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2004-02-22 15:36:36 +0100
commit36e22ad6e2b3f974c96661742940a64a996b79ed (patch)
tree71d5f8ccddbb7fbbaa54a3ca25c1bfecf8f5bd7a /epg.c
parent98f3934a583790b2119ff5a09d63cb3ede4e78f4 (diff)
downloadvdr-36e22ad6e2b3f974c96661742940a64a996b79ed.tar.gz
vdr-36e22ad6e2b3f974c96661742940a64a996b79ed.tar.bz2
Extended the SVDRP command LSTE to allow limiting the listed data
Diffstat (limited to 'epg.c')
-rw-r--r--epg.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/epg.c b/epg.c
index 05a8713a..ce839751 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 <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
*
- * $Id: epg.c 1.12 2004/02/22 13:55:12 kls Exp $
+ * $Id: epg.c 1.13 2004/02/22 14:41:37 kls Exp $
*/
#include "epg.h"
@@ -552,13 +552,34 @@ void cSchedule::Cleanup(time_t Time)
}
}
-void cSchedule::Dump(FILE *f, const char *Prefix) const
+void cSchedule::Dump(FILE *f, const char *Prefix, eDumpMode DumpMode, time_t AtTime) const
{
cChannel *channel = Channels.GetByChannelID(channelID, true);
if (channel) {
fprintf(f, "%sC %s %s\n", Prefix, channel->GetChannelID().ToString(), channel->Name());
- for (cEvent *p = events.First(); p; p = events.Next(p))
- p->Dump(f, Prefix);
+ const cEvent *p;
+ switch (DumpMode) {
+ case dmAll: {
+ for (p = events.First(); p; p = events.Next(p))
+ p->Dump(f, Prefix);
+ }
+ break;
+ case dmPresent: {
+ if ((p = GetPresentEvent()) != NULL)
+ p->Dump(f, Prefix);
+ }
+ break;
+ case dmFollowing: {
+ if ((p = GetFollowingEvent()) != NULL)
+ p->Dump(f, Prefix);
+ }
+ break;
+ case dmAtTime: {
+ if ((p = GetEventAround(AtTime)) != NULL)
+ p->Dump(f, Prefix);
+ }
+ break;
+ }
fprintf(f, "%sc\n", Prefix);
}
}
@@ -682,13 +703,13 @@ bool cSchedules::ClearAll(void)
return false;
}
-bool cSchedules::Dump(FILE *f, const char *Prefix)
+bool cSchedules::Dump(FILE *f, const char *Prefix, eDumpMode DumpMode, time_t AtTime)
{
cSchedulesLock SchedulesLock;
cSchedules *s = (cSchedules *)Schedules(SchedulesLock);
if (s) {
for (cSchedule *p = s->First(); p; p = s->Next(p))
- p->Dump(f, Prefix);
+ p->Dump(f, Prefix, DumpMode, AtTime);
return true;
}
return false;