From afa9cb77a3534dd253ec7e6b4ea63305e410097d Mon Sep 17 00:00:00 2001 From: kamel5 Date: Fri, 12 Feb 2021 15:20:34 +0100 Subject: 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. --- coreengine/viewelementsdisplayreplay.c | 68 +++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 5 deletions(-) (limited to 'coreengine/viewelementsdisplayreplay.c') 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); @@ -241,11 +246,59 @@ bool cVeDrTotalTime::Parse(bool force) { return true; } +/****************************************************************** +* 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(); } -- cgit v1.2.3