summaryrefslogtreecommitdiff
path: root/timer.h
blob: 5966ac5574d019018f214455a71629bfd570aac6 (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
#ifndef __TVGUIDE_TIMER_H
#define __TVGUIDE_TIMER_H

#include <vdr/tools.h>

// --- cMyTime ------------------------------------------------------------- 

class cMyTime {
    private:
        time_t t;
        time_t tStart;
        time_t tEnd;
    public:
        cMyTime(){};
        virtual ~cMyTime(void);
        static cString printTime(time_t displayTime);
        void Now();
        void AddStep(int step);
        bool DelStep(int step);
        void SetTime(time_t newTime);
        time_t Get() {return t;};
        time_t GetStart() {return tStart;};
        time_t GetEnd() {return tEnd;};
        cString GetCurrentTime();
        cString GetDate();
        cString GetWeekday();
        time_t getPrevPrimetime(time_t current);
        time_t getNextPrimetime(time_t current);
        bool tooFarInPast(time_t current);
        int GetTimelineOffset();
        time_t GetRounded();
        void debug();
};

// --- cTimeInterval ------------------------------------------------------------- 

class cTimeInterval {
    private:
        time_t start;
        time_t stop;
    public:
        cTimeInterval(time_t start, time_t stop);
        virtual ~cTimeInterval(void);
        time_t Start(void) { return start; };
        time_t Stop(void) { return stop; };
        cTimeInterval *Intersect(cTimeInterval *interval);
        cTimeInterval *Union(cTimeInterval *interval);
};

#endif //__TVGUIDE_TIMER_H