summaryrefslogtreecommitdiff
path: root/timemanager.h
diff options
context:
space:
mode:
Diffstat (limited to 'timemanager.h')
-rw-r--r--timemanager.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/timemanager.h b/timemanager.h
new file mode 100644
index 0000000..fb6b5b2
--- /dev/null
+++ b/timemanager.h
@@ -0,0 +1,61 @@
+#ifndef __TVGUIDE_TIMEMANAGER_H
+#define __TVGUIDE_TIMEMANAGER_H
+
+#include <vdr/tools.h>
+
+enum eTimeFormat {
+ e12Hours,
+ e24Hours
+};
+
+// --- cTimeManager -------------------------------------------------------------
+
+class cTimeManager {
+ private:
+ time_t t;
+ time_t tStart;
+ time_t tEnd;
+ int displayHours;
+ int displaySeconds;
+ eTimeFormat timeFormat;
+ public:
+ cTimeManager(void);
+ virtual ~cTimeManager(void);
+ static cString PrintTime(time_t displayTime);
+ void Now();
+ time_t GetNow() { return t; };
+ void AddMinutes(int step);
+ bool DelMinutes(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);
+ bool IsStart(int activeStart);
+ time_t GetRounded();
+ bool NowVisible(void);
+ int GetDisplaySeconds(void) {return displaySeconds; };
+ 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_TIMEMANAGER_H \ No newline at end of file