summaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2000-09-09 14:57:43 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2000-09-09 14:57:43 +0200
commitc00d4ea326e61d76d7ab5760a5c06646d6b88ab0 (patch)
tree2462fd5c1759f451d8f1c54cedc10b5b0d74cfd1 /config.h
parentd4eb96f725bed149762665ddee275301c9f069a6 (diff)
downloadvdr-c00d4ea326e61d76d7ab5760a5c06646d6b88ab0.tar.gz
vdr-c00d4ea326e61d76d7ab5760a5c06646d6b88ab0.tar.bz2
Implemented 'channel grouping'
Diffstat (limited to 'config.h')
-rw-r--r--config.h30
1 files changed, 23 insertions, 7 deletions
diff --git a/config.h b/config.h
index 15e90501..2a8954b7 100644
--- a/config.h
+++ b/config.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: config.h 1.15 2000/09/03 09:37:30 kls Exp $
+ * $Id: config.h 1.16 2000/09/09 14:21:35 kls Exp $
*/
#ifndef __CONFIG_H
@@ -17,7 +17,7 @@
#include "dvbapi.h"
#include "tools.h"
-#define VDRVERSION "0.62"
+#define VDRVERSION "0.63"
#define MaxBuffer 10000
@@ -75,14 +75,15 @@ public:
int apid;
int ca;
int pnr;
+ int preferred; //TODO implement "preferred channel" mechanism
+ int number; // Sequence number assigned on load
+ bool groupSep;
cChannel(void);
cChannel(const cChannel *Channel);
const char *ToText(void);
bool Parse(const char *s);
bool Save(FILE *f);
bool Switch(cDvbApi *DvbApi = NULL);
- static bool SwitchTo(int i, cDvbApi *DvbApi = NULL);
- static const char *GetChannelName(int i);
};
class cTimer : public cListObject {
@@ -130,7 +131,7 @@ private:
cList<T>::Clear();
}
public:
- bool Load(const char *FileName)
+ virtual bool Load(const char *FileName)
{
isyslog(LOG_INFO, "loading %s", FileName);
bool result = true;
@@ -182,14 +183,29 @@ public:
}
};
-class cChannels : public cConfig<cChannel> {};
-
+class cChannels : public cConfig<cChannel> {
+protected:
+ int maxNumber;
+public:
+ cChannels(void) { maxNumber = 0; }
+ virtual bool Load(const char *FileName);
+ int GetNextGroup(int Idx); // Get next channel group
+ int GetPrevGroup(int Idx); // Get previous channel group
+ int GetNextNormal(int Idx); // Get next normal channel (not group)
+ void ReNumber(void); // Recalculate 'number' based on channel type
+ cChannel *GetByNumber(int Number);
+ const char *GetChannelNameByNumber(int Number);
+ bool SwitchTo(int Number, cDvbApi *DvbApi = NULL);
+ int MaxNumber(void) { return maxNumber; }
+ };
+
class cTimers : public cConfig<cTimer> {
public:
cTimer *GetTimer(cTimer *Timer);
};
extern int CurrentChannel;
+extern int CurrentGroup;
extern cChannels Channels;
extern cTimers Timers;