summaryrefslogtreecommitdiff
path: root/logger.h
diff options
context:
space:
mode:
authorMatti Lehtimäki <matti.lehtimaki@gmail.com>2013-01-07 21:29:45 +0200
committerMatti Lehtimäki <matti.lehtimaki@gmail.com>2013-01-07 21:29:45 +0200
commitc6ffcc01aa82582b119de294ff40aac915c88e19 (patch)
treeac6881e6c72f9f2511bcbff7d5d29607a9ff9711 /logger.h
downloadvdr-plugin-history-c6ffcc01aa82582b119de294ff40aac915c88e19.tar.gz
vdr-plugin-history-c6ffcc01aa82582b119de294ff40aac915c88e19.tar.bz2
Initial commit. Version 0.0.3.v0.0.3
Diffstat (limited to 'logger.h')
-rwxr-xr-xlogger.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/logger.h b/logger.h
new file mode 100755
index 0000000..2948aab
--- /dev/null
+++ b/logger.h
@@ -0,0 +1,54 @@
+/*
+ * logger.h: Keep log of replayed recordings
+ *
+ * See the README file for copyright information and how to reach the author.
+ *
+ */
+
+#ifndef __HISTORY_LOGGER_H_
+#define __HISTORY_LOGGER_H_
+
+#include <time.h>
+#include <vdr/status.h>
+#include <vdr/tools.h>
+#include "config.h"
+
+class cHistoryRecordingItem: public cListObject
+{
+protected:
+ char *filename;
+ char *name;
+ time_t replay_time;
+
+public:
+ cHistoryRecordingItem(const char *String);
+ cHistoryRecordingItem(const char *Name, const char *FileName);
+ ~cHistoryRecordingItem() { free(filename); free(name); }
+ const char *GetFilename() { return filename; }
+ const char *GetName() { return name; }
+ time_t *GetReplayTime() { return &replay_time; }
+ char *GetReplayTimeString();
+};
+
+class cHistoryLogger : public cStatus
+{
+public:
+ cHistoryLogger();
+ ~cHistoryLogger();
+ void DeleteRecordingItem(int index);
+ cHistoryRecordingItem *GetRecordingItem(int index);
+ cList<cHistoryRecordingItem> *GetReplayHistory();
+ void ClearReplayHistory();
+ void LoadReplayHistory();
+ void StoreReplayHistory();
+ void SetReplayHistoryConfigFile(const char *FileName);
+
+protected:
+ virtual void Replaying(const cControl *Control, const char *Name, const char *FileName, bool On);
+
+private:
+ char *replay_history_filename;
+ cList<cHistoryRecordingItem> *replay_history;
+};
+
+#endif //__HISTORY_LOGGER_H_