summaryrefslogtreecommitdiff
path: root/switchtimer.h
blob: 331bd8cb0eea828d1b193e47bc935079336e9c2c (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
#ifndef __TVGUIDE_SWITCHTIMER_H
#define __TVGUIDE_SWITCHTIMER_H

#include <vdr/plugin.h>
#include "config.h"

class cSwitchTimer : public cListObject {
public:
    tEventID eventID;
    time_t startTime;
    tChannelID channelID;
    int switchMinsBefore;
    int announceOnly;
    cSwitchTimer(const cSwitchTimer &SwitchTimer)
	{
    	*this = SwitchTimer;
	};
    cSwitchTimer& operator= (const cSwitchTimer &SwitchTimer)
    {
        this->eventID = SwitchTimer.eventID;
        this->startTime = SwitchTimer.startTime;
        this->channelID = SwitchTimer.channelID;
        this->switchMinsBefore = SwitchTimer.switchMinsBefore;
        this->announceOnly = SwitchTimer.announceOnly;

        return *this;
    };
    cSwitchTimer(void);
    cSwitchTimer(const cEvent* Event);
    bool Parse(const char *s);
    void SetEventID(tEventID eventID) { this->eventID = eventID; };
    void SetStartTime(time_t startTime) { this->startTime = startTime; };
};

class cSwitchTimers : public cConfig<cSwitchTimer>, public cMutex {
public:
    cSwitchTimers(void) {}
    ~cSwitchTimers(void) {}
    bool EventInSwitchList(const cEvent* event);
    bool ChannelInSwitchList(const cChannel* channel);
    void DeleteSwitchTimer(const cEvent *event);
};

extern cSwitchTimers SwitchTimers;

#endif //__TVGUIDE_SWITCHTIMER_H