diff options
author | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2021-03-15 14:10:18 +0100 |
---|---|---|
committer | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2021-03-15 14:10:18 +0100 |
commit | cef6ca78a25e0d80196b5b94bb9435e81a490624 (patch) | |
tree | 8bb14d4d19465c6ff2aaf5b825904f64d7bea5b0 /coreengine/viewelementsdisplayreplay.c | |
parent | 85df1e7f980f0f7092523e5ac9ed4ff6db51d82e (diff) | |
download | vdr-plugin-skindesigner-cef6ca78a25e0d80196b5b94bb9435e81a490624.tar.gz vdr-plugin-skindesigner-cef6ca78a25e0d80196b5b94bb9435e81a490624.tar.bz2 |
Fix cutting marks wasn't updated
Diffstat (limited to 'coreengine/viewelementsdisplayreplay.c')
-rw-r--r-- | coreengine/viewelementsdisplayreplay.c | 84 |
1 files changed, 14 insertions, 70 deletions
diff --git a/coreengine/viewelementsdisplayreplay.c b/coreengine/viewelementsdisplayreplay.c index 2f7b690..09ac47a 100644 --- a/coreengine/viewelementsdisplayreplay.c +++ b/coreengine/viewelementsdisplayreplay.c @@ -375,6 +375,7 @@ bool cVeDrProgressBar::Parse(bool force) { tokenContainer->AddIntToken((int)eDRProgressbarIT::timeshifttotal, timeshiftTotal); SetDirty(); + changed = false; return true; } @@ -383,13 +384,16 @@ bool cVeDrProgressBar::Parse(bool force) { ******************************************************************/ cVeDrCutMarks::cVeDrCutMarks(void) { cutmarksIndex = -1; - lastMarks = NULL; + changed = true; + marks = NULL; + current = -1; + total = -1; + numMarksLast = 0; timeShiftActive = NoRec; - Reset(); + timeshiftTotal = -1; } cVeDrCutMarks::~cVeDrCutMarks(void) { - delete[] lastMarks; } void cVeDrCutMarks::SetTokenContainer(void) { @@ -406,31 +410,22 @@ void cVeDrCutMarks::SetTokenContainer(void) { } void cVeDrCutMarks::Set(const cMarks *marks, int current, int total, eRecType_t timeShiftActive, int timeshiftTotal) { + int numMarks = marks->Count(); + if (!(this->current != current || this->total != total || this->marks != marks || numMarksLast != numMarks)) + return; this->marks = marks; + numMarksLast = numMarks; this->current = current; this->total = total; this->timeShiftActive = timeShiftActive; this->timeshiftTotal = timeshiftTotal; -} -void cVeDrCutMarks::Reset(void) { - marks = NULL; - current = -1; - total = -1; - numMarksLast = 0; - delete[] lastMarks; - lastMarks = NULL; - markActive = -1; - timeShiftActive = NoRec; - timeshiftTotal = -1; + changed = true; } bool cVeDrCutMarks::Parse(bool force) { - if (!cViewElement::Parse(force)) - return false; - if (!marks || !MarksChanged()) { + if (!cViewElement::Parse(force) || !changed) return false; - } tokenContainer->Clear(); tokenContainer->AddIntToken((int)eDRCutmarksIT::timeshift, timeShiftActive); int numMarks = marks->Count(); @@ -459,61 +454,10 @@ bool cVeDrCutMarks::Parse(bool force) { isStartMark = !isStartMark; } SetDirty(); + changed = false; return true; } -bool cVeDrCutMarks::MarksChanged(void) { - bool redraw = false; - //if mark was active, we redraw always - if (markActive >= 0) { - markActive = -1; - redraw = true; - } - //check if current position in recording hits mark exactly - for (const cMark *m = marks->First(); m; m = marks->Next(m)) { - if (m->Position() == current) { - markActive = current; - redraw = true; - break; - } - } - if (redraw) - return true; - //if number of marks has changed, redraw - int numMarks = marks->Count(); - if (numMarks != numMarksLast) { - RememberMarks(); - return true; - } - if (!lastMarks) - return false; - //if position has changed, redraw - int i=0; - for (const cMark *m = marks->First(); m; m = marks->Next(m)) { - if (m->Position() != lastMarks[i]) { - RememberMarks(); - return true; - } - i++; - } - return false; -} - -void cVeDrCutMarks::RememberMarks(void) { - if (!marks) - return; - numMarksLast = marks->Count(); - if (numMarksLast < 1) - return; - delete[] lastMarks; - lastMarks = new int[numMarksLast]; - int i=0; - for (const cMark *m = marks->First(); m; m = marks->Next(m)) { - lastMarks[i] = m->Position(); - i++; - } -} - /****************************************************************** * cVeDrControlIcons ******************************************************************/ |