summaryrefslogtreecommitdiff
path: root/channelepg.h
blob: 53218811de106ab36fe4f966dbe14000ff776599 (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_CHANNELEPG_H
#define __TVGUIDE_CHANNELEPG_H

#include <set>
#include <vdr/tools.h>
#include <libskindesignerapi/skindesignerosdbase.h>
#include "definitions.h"
#include "config.h"
#include "gridelement.h"
#include "epgelement.h"
#include "dummyelement.h"
#include "timemanager.h"
#include "switchtimer.h"

// --- cChannelEpg  -------------------------------------------------------------

class cChannelEpg : public cListObject {
private:
    bool init;
    int channelsPerPage;
    cTimeManager *timeManager;
    int position;
    const cChannel *channel;
    cList<cGridElement> grids;
    set<long> deletedElements;
    bool hasTimer;
    bool timerIsActive;
    bool hasSwitchTimer;
    cGridElement *AddEpgGrid(const cEvent *event, cGridElement *after = NULL);
    void AddDummyGrid(time_t start, time_t end, cGridElement *after = NULL);
public:
    cChannelEpg(int position, const cChannel *channel, cTimeManager *timeManager);
    virtual ~cChannelEpg(void);
    void SetPosition(int newPos) { position = newPos; };
    bool ReadGrids(void);
    const cChannel *Channel(void) { return channel; };
    const char* Name(void) { return channel->Name(); };
    int GetChannelNumber(void) {return channel->Number();}
    cGridElement * GetActive(void);
    cGridElement * GetNext(cGridElement *activeGrid);
    cGridElement * GetPrev(cGridElement *activeGrid);
    cGridElement * GetNeighbor(cGridElement *activeGrid);
    bool IsFirst(cGridElement *grid);
    void AddNewGridsAtStart(void);
    void AddNewGridsAtEnd(void);
    void ClearOutdatedStart(void);
    void ClearOutdatedEnd(void);
    void SetTimers(void);
    void SetTimer(void);
    bool HasTimer(void) { return hasTimer; };
    bool TimerIsActive(void) { return timerIsActive; };
    void SetSwitchTimer() {hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel);};
    bool HasSwitchTimer() { return hasSwitchTimer; };
    void ClearGrids(void);
    void DrawHeader(skindesignerapi::cViewGrid *channelsGrid);
    void DrawGrids(skindesignerapi::cViewGrid *epgGrid);
    void DeleteOutdated(skindesignerapi::cViewGrid *epgGrid);
    void DeleteGridViews(skindesignerapi::cViewGrid *epgGrid);
    void Debug(void);
};

#endif //__TVGUIDE_CHANNELEPG_H