summaryrefslogtreecommitdiff
path: root/channelcolumn.h
blob: 0e1d13891ee3f1db2d60b2e2b59365f82cb2a84b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef __TVGUIDE_CHANNELCOLUMN_H
#define __TVGUIDE_CHANNELCOLUMN_H

#include <vdr/tools.h>
#include "grid.h"
#include "epggrid.h"
#include "headergrid.h"
#include "switchtimer.h"

class cGrid;
class cEpgGrid;
class cHeaderGrid;

// --- cChannelColumn  -------------------------------------------------------------

class cChannelColumn : public cListObject, public cStyledPixmap {
private:
    cMyTime *myTime;
    int num;
    const cChannel *channel;
    cHeaderGrid *header;
    cList<cGrid> grids;
    cSchedulesLock *schedulesLock;
    const cSchedules *schedules;
    bool hasTimer;
    bool hasSwitchTimer;
    cGrid *addEpgGrid(const cEvent *event, cGrid *firstGrid, bool color);
    cGrid *addDummyGrid(time_t start, time_t end, cGrid *firstGrid, bool color);
public:
    cChannelColumn(int num, const cChannel *channel, cMyTime *myTime);
    virtual ~cChannelColumn(void);
    void createHeader();
    void drawHeader();
    bool readGrids();
    void drawGrids();
    int getX();
    int getY();
    int Start() { return myTime->GetStart(); };
    int Stop()  { return myTime->GetEnd(); };
    const char* Name() { return channel->Name(); };
    const cChannel * getChannel() {return channel;}
    cGrid * getActive();
    cGrid * getNext(cGrid *activeGrid);
    cGrid * getPrev(cGrid *activeGrid);
    cGrid * getNeighbor(cGrid *activeGrid);
    bool isFirst(cGrid *grid);
    void AddNewGridsAtStart();
    void AddNewGridsAtEnd();
    void ClearOutdatedStart();
    void ClearOutdatedEnd();
    int GetNum() {return num;};
    void SetNum(int num) {this->num = num;};
    void setTimer() {hasTimer = channel->HasTimer();};
    bool HasTimer() { return hasTimer; };
    void setSwitchTimer() {hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel);};
    bool HasSwitchTimer() { return hasSwitchTimer; };
    void SetTimers();
    void clearGrids();
    void dumpGrids();
};

#endif //__TVGUIDE_CHANNELCOLUMN_H