From c00d4ea326e61d76d7ab5760a5c06646d6b88ab0 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 9 Sep 2000 14:57:43 +0200 Subject: Implemented 'channel grouping' --- config.h | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'config.h') 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::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 {}; - +class cChannels : public cConfig { +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 { public: cTimer *GetTimer(cTimer *Timer); }; extern int CurrentChannel; +extern int CurrentGroup; extern cChannels Channels; extern cTimers Timers; -- cgit v1.2.3