diff options
author | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2021-02-12 15:20:34 +0100 |
---|---|---|
committer | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2021-02-15 14:00:35 +0100 |
commit | afa9cb77a3534dd253ec7e6b4ea63305e410097d (patch) | |
tree | 5d3e2cb556a88eb55e24ebe0982ee401bb2d424c /coreengine/viewelementsdisplayreplay.c | |
parent | 1fc5379e2eed0ecd7eb2227564077a62bc0b1e12 (diff) | |
download | vdr-plugin-skindesigner-afa9cb77a3534dd253ec7e6b4ea63305e410097d.tar.gz vdr-plugin-skindesigner-afa9cb77a3534dd253ec7e6b4ea63305e410097d.tar.bz2 |
Add element timeShiftTimes to displayreplay
In displayreplay the tokens recstart, playbacktime and timeshiftrest
added to display start time, actual playback time and the rest of
the actual recording in timeshiftmode.
Diffstat (limited to 'coreengine/viewelementsdisplayreplay.c')
-rw-r--r-- | coreengine/viewelementsdisplayreplay.c | 68 |
1 files changed, 63 insertions, 5 deletions
diff --git a/coreengine/viewelementsdisplayreplay.c b/coreengine/viewelementsdisplayreplay.c index 64df8a8..4116153 100644 --- a/coreengine/viewelementsdisplayreplay.c +++ b/coreengine/viewelementsdisplayreplay.c @@ -10,6 +10,7 @@ cVeDrRecTitle::cVeDrRecTitle(void) { recording = NULL; event = NULL; title = NULL; + timeshiftActive = false; } cVeDrRecTitle::~cVeDrRecTitle(void) { @@ -163,6 +164,7 @@ bool cVeDrRecInfo::Parse(bool force) { cVeDrCurrentTime::cVeDrCurrentTime(void) { changed = true; current = NULL; + timeshiftActive = false; } cVeDrCurrentTime::~cVeDrCurrentTime(void) { @@ -172,14 +174,16 @@ cVeDrCurrentTime::~cVeDrCurrentTime(void) { void cVeDrCurrentTime::SetTokenContainer(void) { tokenContainer = new skindesignerapi::cTokenContainer(); tokenContainer->DefineStringToken("{reccurrent}", (int)eDRCurrentTimeST::reccurrent); + tokenContainer->DefineIntToken("{timeshift}", (int)eDRCurrentTimeIT::timeshift); InheritTokenContainer(); } -void cVeDrCurrentTime::Set(const char *current) { +void cVeDrCurrentTime::Set(const char *current, bool timeshiftActive) { if (!current) return; free(this->current); this->current = strdup(current); + this->timeshiftActive = timeshiftActive; changed = true; } @@ -188,6 +192,7 @@ bool cVeDrCurrentTime::Parse(bool force) { return false; tokenContainer->Clear(); tokenContainer->AddStringToken((int)eDRCurrentTimeST::reccurrent, current); + tokenContainer->AddIntToken((int)eDRCurrentTimeIT::timeshift, timeshiftActive); SetDirty(); changed = false; return true; @@ -199,8 +204,8 @@ bool cVeDrCurrentTime::Parse(bool force) { cVeDrTotalTime::cVeDrTotalTime(void) { changed = true; total = NULL; - timeshiftActive = false; timeshiftDuration = NULL; + timeshiftActive = false; } cVeDrTotalTime::~cVeDrTotalTime(void) { @@ -216,7 +221,7 @@ void cVeDrTotalTime::SetTokenContainer(void) { InheritTokenContainer(); } -void cVeDrTotalTime::Set(const char *total, bool timeshiftActive, const char *timeshiftDuration) { +void cVeDrTotalTime::Set(const char *total, const char *timeshiftDuration, bool timeshiftActive) { if (!total) return; free(this->total); @@ -242,10 +247,58 @@ bool cVeDrTotalTime::Parse(bool force) { } /****************************************************************** +* cVeDrTimeshiftTimes +******************************************************************/ +cVeDrTimeshiftTimes::cVeDrTimeshiftTimes(void) { + changed = true; + start = ""; + playbacktime = ""; + timeshiftrest = ""; + timeshiftActive = false; +} + +cVeDrTimeshiftTimes::~cVeDrTimeshiftTimes(void) { +} + +void cVeDrTimeshiftTimes::SetTokenContainer(void) { + tokenContainer = new skindesignerapi::cTokenContainer(); + tokenContainer->DefineStringToken("{recstart}", (int)eDRTimeshiftTimesST::recstart); + tokenContainer->DefineStringToken("{playbacktime}", (int)eDRTimeshiftTimesST::playbacktime); + tokenContainer->DefineStringToken("{timeshiftrest}", (int)eDRTimeshiftTimesST::timeshiftrest); + tokenContainer->DefineIntToken("{timeshift}", (int)eDRTimeshiftTimesIT::timeshift); + InheritTokenContainer(); +} + +void cVeDrTimeshiftTimes::Set(cString start, cString playbacktime, cString timeshiftrest, bool timeshiftActive) { + this->timeshiftActive = timeshiftActive; + if (strcmp(*this->start, *start) || strcmp(*this->playbacktime, *playbacktime) || strcmp(*this->timeshiftrest, *timeshiftrest)) { + this->start = start; + this->playbacktime = playbacktime; + this->timeshiftrest = timeshiftrest; + changed = true; + } +} + +bool cVeDrTimeshiftTimes::Parse(bool force) { + if (!cViewElement::Parse(force) || !changed) + return false; + tokenContainer->Clear(); + tokenContainer->AddStringToken((int)eDRTimeshiftTimesST::recstart, *start); + tokenContainer->AddStringToken((int)eDRTimeshiftTimesST::playbacktime, *playbacktime); + tokenContainer->AddStringToken((int)eDRTimeshiftTimesST::timeshiftrest, *timeshiftrest); + tokenContainer->AddIntToken((int)eDRTimeshiftTimesIT::timeshift, timeshiftActive); + SetDirty(); + changed = false; + return true; +} + +/****************************************************************** * cVeDrEndTime ******************************************************************/ cVeDrEndTime::cVeDrEndTime(void) { + changed = true; end = ""; + timeshiftActive = false; } cVeDrEndTime::~cVeDrEndTime(void) { @@ -254,10 +307,12 @@ cVeDrEndTime::~cVeDrEndTime(void) { void cVeDrEndTime::SetTokenContainer(void) { tokenContainer = new skindesignerapi::cTokenContainer(); tokenContainer->DefineStringToken("{recend}", (int)eDREndTimeST::recend); + tokenContainer->DefineIntToken("{timeshift}", (int)eDREndTimeIT::timeshift); InheritTokenContainer(); } -void cVeDrEndTime::Set(cString end) { +void cVeDrEndTime::Set(cString end, bool timeshiftActive) { + this->timeshiftActive = timeshiftActive; if (strcmp(*this->end, *end)) { this->end = end; changed = true; @@ -269,6 +324,7 @@ bool cVeDrEndTime::Parse(bool force) { return false; tokenContainer->Clear(); tokenContainer->AddStringToken((int)eDREndTimeST::recend, *end); + tokenContainer->AddIntToken((int)eDREndTimeIT::timeshift, timeshiftActive); SetDirty(); changed = false; return true; @@ -280,8 +336,8 @@ bool cVeDrEndTime::Parse(bool force) { cVeDrProgressBar::cVeDrProgressBar(void) { current = -1; total = -1; - timeshiftActive = false; timeshiftTotal = -1; + timeshiftActive = false; changed = true; } @@ -304,6 +360,7 @@ void cVeDrProgressBar::Set(int current, int total, bool timeshiftActive, int tim this->total = total; this->timeshiftActive = timeshiftActive; this->timeshiftTotal = timeshiftTotal; + changed = true; } @@ -327,6 +384,7 @@ bool cVeDrProgressBar::Parse(bool force) { cVeDrCutMarks::cVeDrCutMarks(void) { cutmarksIndex = -1; lastMarks = NULL; + timeshiftActive = false; Reset(); } |