diff options
author | Timo Eskola <timo@tolleri.net> | 2018-08-29 11:56:19 +0300 |
---|---|---|
committer | Timo Eskola <timo@tolleri.net> | 2018-08-29 11:56:19 +0300 |
commit | 72d7261885bf05599310f75883dcdc9d9e190d6c (patch) | |
tree | 1cff14186a40f6cfc8d3ea7cf94b2e40e9df069c /recording.h | |
parent | 6deebe52d29a5401e88b0a9337c387a66ee04ea8 (diff) | |
download | vdr-plugin-duplicates-72d7261885bf05599310f75883dcdc9d9e190d6c.tar.gz vdr-plugin-duplicates-72d7261885bf05599310f75883dcdc9d9e190d6c.tar.bz2 |
Refactored duplicate detection to own classes.
Diffstat (limited to 'recording.h')
-rw-r--r-- | recording.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/recording.h b/recording.h new file mode 100644 index 0000000..0987af4 --- /dev/null +++ b/recording.h @@ -0,0 +1,52 @@ +/* + * recording.h: Duplicate recording handling. + * + * See the README file for copyright information and how to reach the author. + * + * $Id$ + */ + +#ifndef _DUPLICATES_RECORDING_H +#define _DUPLICATES_RECORDING_H + +#include "visibility.h" +#include <vdr/recording.h> +#include <string> + +// --- cDuplicateRecording ------------------------------------------------------- + +class cDuplicateRecording : public cListObject { +private: + bool checked; + cVisibility visibility; + std::string fileName; + std::string text; + std::string title; + std::string description; + cList<cDuplicateRecording> *duplicates; +public: + cDuplicateRecording(void); + cDuplicateRecording(const cRecording *Recording); + cDuplicateRecording(const cDuplicateRecording &DuplicateRecording); + ~cDuplicateRecording(); + bool HasDescription(void) const { return ! description.empty(); } + bool IsDuplicate(cDuplicateRecording *DuplicateRecording); + void SetChecked(bool chkd = true) { checked = chkd; } + bool Checked() { return checked; } + cVisibility Visibility() { return visibility; } + std::string FileName(void) { return fileName; } + void SetText(const char *t) { text = std::string(t); } + const char *Text(void) { return text.c_str(); } + cList<cDuplicateRecording> *Duplicates(void) { return duplicates; } +}; + +class cDuplicateRecordings : public cList<cDuplicateRecording> { +public: + cDuplicateRecordings(void); + cMutex mutex; + void Update(void); +}; + +extern cDuplicateRecordings DuplicateRecordings; + +#endif |