vdr-plugin-tvguide/channelepg.h

70 lines
2.1 KiB
C
Raw Normal View History

2019-07-11 12:06:18 +02:00
#ifndef __TVGUIDE_CHANNELEPG_H
#define __TVGUIDE_CHANNELEPG_H
2013-01-17 13:16:44 +01:00
2013-12-07 15:51:50 +01:00
#include <vdr/tools.h>
2019-07-11 15:11:26 +02:00
#include "gridelement.h"
2013-12-07 15:51:50 +01:00
#include "epggrid.h"
#include "headergrid.h"
#include "switchtimer.h"
2019-07-11 15:06:07 +02:00
class cGridElement;
2013-01-17 13:16:44 +01:00
class cEpgGrid;
class cHeaderGrid;
2013-12-07 15:51:50 +01:00
2019-07-11 12:06:18 +02:00
// --- cChannelEpg -------------------------------------------------------------
2013-01-17 13:16:44 +01:00
2019-07-11 12:06:18 +02:00
class cChannelEpg : public cListObject, public cStyledPixmap {
2013-01-17 13:16:44 +01:00
private:
2019-07-11 14:34:31 +02:00
cTimeManager *timeManager;
2013-05-26 11:38:05 +02:00
int num;
const cChannel *channel;
cHeaderGrid *header;
2019-07-11 15:06:07 +02:00
cList<cGridElement> grids;
#if VDRVERSNUM >= 20301
2018-03-08 13:02:38 +01:00
#else
2013-05-26 11:38:05 +02:00
cSchedulesLock *schedulesLock;
2018-03-08 13:02:38 +01:00
#endif
2013-05-26 11:38:05 +02:00
const cSchedules *schedules;
bool hasTimer;
2013-07-09 00:17:42 +02:00
bool hasSwitchTimer;
2019-07-11 15:06:07 +02:00
cGridElement *addEpgGrid(const cEvent *event, cGridElement *firstGrid, bool color);
cGridElement *addDummyGrid(time_t start, time_t end, cGridElement *firstGrid, bool color);
2013-01-17 13:16:44 +01:00
public:
2019-07-11 14:34:31 +02:00
cChannelEpg(int num, const cChannel *channel, cTimeManager *timeManager);
2019-07-11 12:06:18 +02:00
virtual ~cChannelEpg(void);
2013-05-26 11:38:05 +02:00
void createHeader();
void drawHeader();
bool readGrids();
void drawGrids();
int getX();
int getY();
2019-07-11 14:34:31 +02:00
int Start() { return timeManager->GetStart(); };
int Stop() { return timeManager->GetEnd(); };
const char* Name() { return channel->Name(); };
2019-07-11 15:06:07 +02:00
const cChannel *getChannel() {return channel;}
2019-11-03 11:30:41 +01:00
cGridElement *getActive(bool last = false);
2019-07-11 15:06:07 +02:00
cGridElement *getNext(cGridElement *activeGrid);
cGridElement *getPrev(cGridElement *activeGrid);
cGridElement *getNeighbor(cGridElement *activeGrid);
bool isFirst(cGridElement *grid);
2013-05-26 11:38:05 +02:00
void AddNewGridsAtStart();
void AddNewGridsAtEnd();
void ClearOutdatedStart();
void ClearOutdatedEnd();
int GetNum() {return num;};
void SetNum(int num) {this->num = num;};
#if VDRVERSNUM >= 20301
2018-03-08 13:02:38 +01:00
void setTimer();
#else
2013-07-09 00:17:42 +02:00
void setTimer() {hasTimer = channel->HasTimer();};
2018-03-08 13:02:38 +01:00
#endif
bool HasTimer() { return hasTimer; };
2013-07-09 00:17:42 +02:00
void setSwitchTimer() {hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel);};
bool HasSwitchTimer() { return hasSwitchTimer; };
void SetTimers();
2013-05-26 11:38:05 +02:00
void clearGrids();
void dumpGrids();
2013-01-17 13:16:44 +01:00
};
2019-07-11 12:06:18 +02:00
#endif //__TVGUIDE_CHANNELEPG_H