diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2000-09-09 14:57:43 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2000-09-09 14:57:43 +0200 |
commit | c00d4ea326e61d76d7ab5760a5c06646d6b88ab0 (patch) | |
tree | 2462fd5c1759f451d8f1c54cedc10b5b0d74cfd1 /config.h | |
parent | d4eb96f725bed149762665ddee275301c9f069a6 (diff) | |
download | vdr-c00d4ea326e61d76d7ab5760a5c06646d6b88ab0.tar.gz vdr-c00d4ea326e61d76d7ab5760a5c06646d6b88ab0.tar.bz2 |
Implemented 'channel grouping'
Diffstat (limited to 'config.h')
-rw-r--r-- | config.h | 30 |
1 files changed, 23 insertions, 7 deletions
@@ -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; |