summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--channels.c4
-rw-r--r--channels.h6
-rw-r--r--epg.c7
-rw-r--r--epg.h3
-rw-r--r--recording.c10
-rw-r--r--recording.h4
6 files changed, 15 insertions, 19 deletions
diff --git a/channels.c b/channels.c
index 942d7af0..7185a99f 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.39 2005/05/26 11:10:06 kls Exp $
+ * $Id: channels.c 1.40 2005/05/28 09:44:41 kls Exp $
*/
#include "channels.h"
@@ -141,7 +141,7 @@ tChannelID tChannelID::FromString(const char *s)
return tChannelID::InvalidID;
}
-cString tChannelID::ToString(void)
+cString tChannelID::ToString(void) const
{
char buffer[256];
snprintf(buffer, sizeof(buffer), rid ? "%s-%d-%d-%d-%d" : "%s-%d-%d-%d", *cSource::ToString(source), nid, tid, sid, rid);
diff --git a/channels.h b/channels.h
index f1bc6568..297aab55 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.30 2005/05/26 11:11:31 kls Exp $
+ * $Id: channels.h 1.31 2005/05/28 09:47:23 kls Exp $
*/
#ifndef __CHANNELS_H
@@ -66,11 +66,11 @@ public:
tChannelID(void) { source = nid = tid = sid = rid = 0; }
tChannelID(int Source, int Nid, int Tid, int Sid, int Rid = 0) { source = Source; nid = Nid; tid = Tid; sid = Sid; rid = Rid; }
bool operator== (const tChannelID &arg) const { return source == arg.source && nid == arg.nid && tid == arg.tid && sid == arg.sid && rid == arg.rid; }
- bool Valid(void) { return (nid || tid) && sid; } // rid is optional and source may be 0//XXX source may not be 0???
+ bool Valid(void) const { return (nid || tid) && sid; } // rid is optional and source may be 0//XXX source may not be 0???
tChannelID &ClrRid(void) { rid = 0; return *this; }
tChannelID &ClrPolarization(void);
static tChannelID FromString(const char *s);
- cString ToString(void);
+ cString ToString(void) const;
static const tChannelID InvalidID;
};
diff --git a/epg.c b/epg.c
index 13a4ba81..5546bf96 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.30 2005/05/16 14:12:00 kls Exp $
+ * $Id: epg.c 1.31 2005/05/28 09:49:04 kls Exp $
*/
#include "epg.h"
@@ -112,11 +112,6 @@ int cEvent::Compare(const cListObject &ListObject) const
return startTime - e->startTime;
}
-void cEvent::SetChannelID(tChannelID ChannelID)
-{
- channelID = ChannelID;
-}
-
void cEvent::SetEventID(u_int16_t EventID)
{
eventID = EventID;
diff --git a/epg.h b/epg.h
index 66d6cd43..f0836946 100644
--- a/epg.h
+++ b/epg.h
@@ -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.h 1.22 2005/05/16 14:11:28 kls Exp $
+ * $Id: epg.h 1.23 2005/05/28 09:48:56 kls Exp $
*/
#ifndef __EPG_H
@@ -86,7 +86,6 @@ public:
cString GetTimeString(void) const;
cString GetEndTimeString(void) const;
cString GetVpsString(void) const;
- void SetChannelID(tChannelID ChannelID);
void SetEventID(u_int16_t EventID);
void SetTableID(uchar TableID);
void SetVersion(uchar Version);
diff --git a/recording.c b/recording.c
index 0e899a3d..64335649 100644
--- a/recording.c
+++ b/recording.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: recording.c 1.103 2005/05/22 11:27:28 kls Exp $
+ * $Id: recording.c 1.104 2005/05/28 09:53:54 kls Exp $
*/
#include "recording.h"
@@ -224,6 +224,7 @@ cRecordingInfo::cRecordingInfo(const cEvent *Event)
{
if (Event) {
event = Event;
+ channelID = event->ChannelID();
ownEvent = NULL;
}
else
@@ -258,7 +259,7 @@ bool cRecordingInfo::Read(FILE *f)
if (p)
*p = 0; // strips optional channel name
if (*t)
- ownEvent->SetChannelID(tChannelID::FromString(t));
+ channelID = tChannelID::FromString(t);
}
break;
default: if (!ownEvent->Parse(s))
@@ -273,9 +274,8 @@ bool cRecordingInfo::Read(FILE *f)
bool cRecordingInfo::Write(FILE *f, const char *Prefix) const
{
- cChannel *channel = Channels.GetByChannelID(event->ChannelID(), true);
- if (channel)
- fprintf(f, "%sC %s %s\n", Prefix, *channel->GetChannelID().ToString(), channel->Name());
+ if (channelID.Valid())
+ fprintf(f, "%sC %s\n", Prefix, *channelID.ToString());
event->Dump(f, Prefix, true);
return true;
}
diff --git a/recording.h b/recording.h
index 893c9a23..0adb036e 100644
--- a/recording.h
+++ b/recording.h
@@ -4,13 +4,14 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: recording.h 1.37 2005/05/22 10:29:02 kls Exp $
+ * $Id: recording.h 1.38 2005/05/28 09:34:07 kls Exp $
*/
#ifndef __RECORDING_H
#define __RECORDING_H
#include <time.h>
+#include "channels.h"
#include "config.h"
#include "epg.h"
#include "thread.h"
@@ -36,6 +37,7 @@ public:
class cRecordingInfo {
friend class cRecording;
private:
+ tChannelID channelID;
const cEvent *event;
cEvent *ownEvent;
cRecordingInfo(const cEvent *Event = NULL);