From 0eaed1eb91855f69f680cc883fd2d1e392f4fc5c Mon Sep 17 00:00:00 2001 From: kamel5 Date: Sat, 6 Feb 2021 13:55:19 +0100 Subject: [PATCH 01/17] Version 1.2.12 --- skindesigner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skindesigner.c b/skindesigner.c index 05faa70..55ff83c 100644 --- a/skindesigner.c +++ b/skindesigner.c @@ -21,7 +21,7 @@ #endif -static const char *VERSION = "1.2.11"; +static const char *VERSION = "1.2.12"; static const char *DESCRIPTION = trNOOP("Skin Designer"); class cPluginSkinDesigner : public cPlugin, public skindesignerapi::SkindesignerAPI { From f8b6b2cf1b7263661e71fdd6c425891e6e74a103 Mon Sep 17 00:00:00 2001 From: kamel5 Date: Sat, 6 Feb 2021 17:58:19 +0100 Subject: [PATCH 02/17] This reverts bd86dd4de "disabled timeshift display for instant recordings" --- coreengine/viewdisplayreplay.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/coreengine/viewdisplayreplay.c b/coreengine/viewdisplayreplay.c index 9a65db2..b89edc5 100644 --- a/coreengine/viewdisplayreplay.c +++ b/coreengine/viewdisplayreplay.c @@ -190,12 +190,8 @@ void cViewReplay::GetTimers(void) { } void cViewReplay::SetTimeShiftValues(const cRecording *recording) { - //check for instant recording if (!recording) return; - const char *recName = recording->Name(); - if (recName && *recName == '@') - return; bool isTimeShift = false; #if APIVERSNUM >= 20101 int usage = recording->IsInUse(); From 6972a59e1b86989167fb3f3b2b1dc02612d72b4a Mon Sep 17 00:00:00 2001 From: kamel5 Date: Mon, 8 Feb 2021 10:58:00 +0100 Subject: [PATCH 03/17] A bug with timeshift in connection with global timers has been fixed With commit 8a04a17 an error was introduced which did not take the global timers into account in the timeshift replay. thanks to @machtnix at vdr-portal.de for finding the bug --- coreengine/viewdisplayreplay.c | 3 ++- coreengine/viewdisplayreplay.h | 2 +- displayreplay.c | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/coreengine/viewdisplayreplay.c b/coreengine/viewdisplayreplay.c index b89edc5..f871afb 100644 --- a/coreengine/viewdisplayreplay.c +++ b/coreengine/viewdisplayreplay.c @@ -182,7 +182,7 @@ void cViewReplay::SetRecording(const cRecording *recording) { } } -void cViewReplay::GetTimers(void) { +void cViewReplay::GetGlobalTimers(void) { if (!timersLoaded) { timersLoaded = true; globalTimers.LoadTimers(); @@ -198,6 +198,7 @@ void cViewReplay::SetTimeShiftValues(const cRecording *recording) { if (usage & ruTimer) isTimeShift = true; else { + GetGlobalTimers(); if (globalTimers.IsRecording(recording)) isTimeShift = true; } diff --git a/coreengine/viewdisplayreplay.h b/coreengine/viewdisplayreplay.h index 9098275..0dc682a 100644 --- a/coreengine/viewdisplayreplay.h +++ b/coreengine/viewdisplayreplay.h @@ -32,6 +32,7 @@ private: cString timeShiftDuration; bool timersLoaded; cGlobalTimers globalTimers; + void GetGlobalTimers(void); void SetViewElements(void); void ClearVariables(void); void SetViewElementObjects(void); @@ -45,7 +46,6 @@ public: void SetTimeShift(int framesTotal, int timeShiftLength); void SetRecording(const cRecording *recording); void SetTitle(const char *title); - void GetTimers(void); void SetTimeShiftValues(const cRecording *recording); void SetCurrent(const char *current); void SetTotal(const char *total); diff --git a/displayreplay.c b/displayreplay.c index a3a1c8b..9921a9d 100644 --- a/displayreplay.c +++ b/displayreplay.c @@ -85,6 +85,5 @@ void cSDDisplayReplay::SetMessage(eMessageType Type, const char *Text) { void cSDDisplayReplay::Flush(void) { if (!ok) return; - view->GetTimers(); view->Flush(); } From c3f7a2cfdf876ff0980e2838c5dbc65ad998404a Mon Sep 17 00:00:00 2001 From: kamel5 Date: Mon, 8 Feb 2021 15:22:40 +0100 Subject: [PATCH 04/17] Fixed a bug in timeshift mode that prevented the progress bar from updating in pause mode --- coreengine/viewdisplayreplay.c | 7 ++++++- coreengine/viewdisplayreplay.h | 3 ++- coreengine/viewelementsdisplayreplay.c | 4 ++-- displayreplay.c | 2 -- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/coreengine/viewdisplayreplay.c b/coreengine/viewdisplayreplay.c index f871afb..db767dc 100644 --- a/coreengine/viewdisplayreplay.c +++ b/coreengine/viewdisplayreplay.c @@ -142,6 +142,7 @@ void cViewReplay::PreCache(void) { void cViewReplay::ClearVariables(void) { cView::ClearVariables(); + recording = NULL; modeOnly = false; lastFlush = 0; lastFlushModeOnly = 0; @@ -171,6 +172,7 @@ void cViewReplay::SetTimeShift(int framesTotal, int timeShiftLength) { } void cViewReplay::SetRecording(const cRecording *recording) { + this->recording = recording; if (veRecTitle) { veRecTitle->Set(recording); } @@ -180,6 +182,7 @@ void cViewReplay::SetRecording(const cRecording *recording) { if (veScraperContent) { veScraperContent->Set(recording); } + SetTimeShiftValues(); } void cViewReplay::GetGlobalTimers(void) { @@ -189,7 +192,7 @@ void cViewReplay::GetGlobalTimers(void) { } } -void cViewReplay::SetTimeShiftValues(const cRecording *recording) { +void cViewReplay::SetTimeShiftValues(void) { if (!recording) return; bool isTimeShift = false; @@ -220,6 +223,7 @@ void cViewReplay::SetTimeShiftValues(const cRecording *recording) { } void cViewReplay::SetTitle(const char *title) { + recording = NULL; if (veRecTitle) { veRecTitle->Set(title); } @@ -259,6 +263,7 @@ void cViewReplay::SetEndTime(int current, int total) { } void cViewReplay::SetProgressbar(int current, int total) { + SetTimeShiftValues(); if (veProgressbar) veProgressbar->Set(current, total, timeShiftActive, timeShiftFramesTotal); Render((int)eVeDisplayReplay::progressbar); diff --git a/coreengine/viewdisplayreplay.h b/coreengine/viewdisplayreplay.h index 0dc682a..b9ed9eb 100644 --- a/coreengine/viewdisplayreplay.h +++ b/coreengine/viewdisplayreplay.h @@ -21,6 +21,7 @@ private: cVeDrJump *veJump; cVeDrOnPause *veOnPause; cVeDrOnPause *veOnPauseModeOnly; + const cRecording *recording; bool modeOnly; time_t lastFlush; time_t lastFlushModeOnly; @@ -33,6 +34,7 @@ private: bool timersLoaded; cGlobalTimers globalTimers; void GetGlobalTimers(void); + void SetTimeShiftValues(void); void SetViewElements(void); void ClearVariables(void); void SetViewElementObjects(void); @@ -46,7 +48,6 @@ public: void SetTimeShift(int framesTotal, int timeShiftLength); void SetRecording(const cRecording *recording); void SetTitle(const char *title); - void SetTimeShiftValues(const cRecording *recording); void SetCurrent(const char *current); void SetTotal(const char *total); void SetEndTime(int current, int total); diff --git a/coreengine/viewelementsdisplayreplay.c b/coreengine/viewelementsdisplayreplay.c index 6cd4b25..9249d37 100644 --- a/coreengine/viewelementsdisplayreplay.c +++ b/coreengine/viewelementsdisplayreplay.c @@ -273,7 +273,7 @@ void cVeDrProgressBar::SetTokenContainer(void) { } void cVeDrProgressBar::Set(int current, int total, bool timeshiftActive, int timeshiftTotal) { - if (this->current == current) + if (!(this->current != current || this->total != total)) return; this->current = current; this->total = total; @@ -595,7 +595,7 @@ void cVeDrProgressModeonly::SetTokenContainer(void) { } void cVeDrProgressModeonly::Set(double fps, int current, int total) { - if (this->current == current) + if (!(this->current != current || this->total != total)) return; this->fps = fps; this->current = current; diff --git a/displayreplay.c b/displayreplay.c index 9921a9d..2a8b646 100644 --- a/displayreplay.c +++ b/displayreplay.c @@ -18,7 +18,6 @@ void cSDDisplayReplay::SetRecording(const cRecording *Recording) { view->SetRecording(Recording); if (init) { view->SetRecordingLength(Recording->LengthInSeconds()); - view->SetTimeShiftValues(Recording); init = false; } } @@ -30,7 +29,6 @@ void cSDDisplayReplay::SetTitle(const char *Title) { view->SetTitle(Title); if (init) { view->SetRecordingLength(0); - view->SetTimeShiftValues(NULL); init = false; } } From b9093a6dca819b40d96024321a8ebd25bfd6232d Mon Sep 17 00:00:00 2001 From: kamel5 Date: Mon, 8 Feb 2021 10:14:01 +0100 Subject: [PATCH 05/17] Update Skin estuary4vdr --- .../estuary4vdr/icons/ico_timer_is_active.svg | 82 +++++++++++++++++++ .../icons/ico_timer_is_inactive.svg | 76 +++++++++++++++++ .../icons/ico_timer_is_switchtimer.svg | 79 ++++++++++++++++++ skins/estuary4vdr/themes/applegreen/theme.xml | 2 +- skins/estuary4vdr/themes/darkred/theme.xml | 2 +- skins/estuary4vdr/themes/default/theme.xml | 2 +- skins/estuary4vdr/themes/orange/theme.xml | 2 +- skins/estuary4vdr/xmlfiles/displaychannel.xml | 4 +- skins/estuary4vdr/xmlfiles/displayreplay.xml | 10 +-- .../xmlfiles/plug-tvguideng-root.xml | 10 ++- 10 files changed, 254 insertions(+), 15 deletions(-) create mode 100644 skins/estuary4vdr/icons/ico_timer_is_active.svg create mode 100644 skins/estuary4vdr/icons/ico_timer_is_inactive.svg create mode 100644 skins/estuary4vdr/icons/ico_timer_is_switchtimer.svg diff --git a/skins/estuary4vdr/icons/ico_timer_is_active.svg b/skins/estuary4vdr/icons/ico_timer_is_active.svg new file mode 100644 index 0000000..7328fd1 --- /dev/null +++ b/skins/estuary4vdr/icons/ico_timer_is_active.svg @@ -0,0 +1,82 @@ + +image/svg+xml diff --git a/skins/estuary4vdr/icons/ico_timer_is_inactive.svg b/skins/estuary4vdr/icons/ico_timer_is_inactive.svg new file mode 100644 index 0000000..393bee8 --- /dev/null +++ b/skins/estuary4vdr/icons/ico_timer_is_inactive.svg @@ -0,0 +1,76 @@ + +image/svg+xml diff --git a/skins/estuary4vdr/icons/ico_timer_is_switchtimer.svg b/skins/estuary4vdr/icons/ico_timer_is_switchtimer.svg new file mode 100644 index 0000000..722830f --- /dev/null +++ b/skins/estuary4vdr/icons/ico_timer_is_switchtimer.svg @@ -0,0 +1,79 @@ + +image/svg+xml diff --git a/skins/estuary4vdr/themes/applegreen/theme.xml b/skins/estuary4vdr/themes/applegreen/theme.xml index 0ec19ad..66b1d34 100644 --- a/skins/estuary4vdr/themes/applegreen/theme.xml +++ b/skins/estuary4vdr/themes/applegreen/theme.xml @@ -19,7 +19,7 @@ FF111111 FF222222 FF99D235 - FF666666 + FF99EE33 FF666666 FFFFFFFF FF333333 diff --git a/skins/estuary4vdr/themes/darkred/theme.xml b/skins/estuary4vdr/themes/darkred/theme.xml index 286f105..f5849ee 100644 --- a/skins/estuary4vdr/themes/darkred/theme.xml +++ b/skins/estuary4vdr/themes/darkred/theme.xml @@ -19,7 +19,7 @@ FFFFFFFF FF222222 FF550000 - FF666666 + FF992222 FF666666 FFFFFFFF FFCCCCCC diff --git a/skins/estuary4vdr/themes/default/theme.xml b/skins/estuary4vdr/themes/default/theme.xml index 0119815..f5a06a6 100644 --- a/skins/estuary4vdr/themes/default/theme.xml +++ b/skins/estuary4vdr/themes/default/theme.xml @@ -19,7 +19,7 @@ FF333333 FF222222 FF12B2E7 - FF666666 + FF126696 FF666666 FFFFFFFF FF333333 diff --git a/skins/estuary4vdr/themes/orange/theme.xml b/skins/estuary4vdr/themes/orange/theme.xml index 6342099..14634ab 100644 --- a/skins/estuary4vdr/themes/orange/theme.xml +++ b/skins/estuary4vdr/themes/orange/theme.xml @@ -19,7 +19,7 @@ FF333333 FF222222 FFAF3B00 - FF666666 + FFEE6633 FF666666 FFFFFFFF FF333333 diff --git a/skins/estuary4vdr/xmlfiles/displaychannel.xml b/skins/estuary4vdr/xmlfiles/displaychannel.xml index 4edb29a..cdc9c10 100644 --- a/skins/estuary4vdr/xmlfiles/displaychannel.xml +++ b/skins/estuary4vdr/xmlfiles/displaychannel.xml @@ -54,7 +54,9 @@ - + + + diff --git a/skins/estuary4vdr/xmlfiles/displayreplay.xml b/skins/estuary4vdr/xmlfiles/displayreplay.xml index b4c7473..f3e96b6 100644 --- a/skins/estuary4vdr/xmlfiles/displayreplay.xml +++ b/skins/estuary4vdr/xmlfiles/displayreplay.xml @@ -90,12 +90,10 @@ - - - - - - + + + + diff --git a/skins/estuary4vdr/xmlfiles/plug-tvguideng-root.xml b/skins/estuary4vdr/xmlfiles/plug-tvguideng-root.xml index e2b74a4..df70190 100644 --- a/skins/estuary4vdr/xmlfiles/plug-tvguideng-root.xml +++ b/skins/estuary4vdr/xmlfiles/plug-tvguideng-root.xml @@ -314,8 +314,9 @@ - - + + @@ -324,8 +325,9 @@ - - + + From cba8fe1eb454711fdda13d6815629c99bc4c238a Mon Sep 17 00:00:00 2001 From: kamel5 Date: Tue, 9 Feb 2021 14:54:10 +0100 Subject: [PATCH 06/17] Missing token eCeMenuSchedulesIT::durationminutes added --- coreengine/listelements.c | 1 + 1 file changed, 1 insertion(+) diff --git a/coreengine/listelements.c b/coreengine/listelements.c index 96daba3..decca1e 100644 --- a/coreengine/listelements.c +++ b/coreengine/listelements.c @@ -968,6 +968,7 @@ bool cCeMenuSchedules::Parse(bool forced) { } tokenContainer->AddIntToken((int)eCeMenuSchedulesIT::duration, event->Duration() / 60); tokenContainer->AddIntToken((int)eCeMenuSchedulesIT::durationhours, event->Duration() / 3600); + tokenContainer->AddIntToken((int)eCeMenuSchedulesIT::durationminutes, (event->Duration() / 60) % 60); if (timerMatch == tmFull || timerMatch == tmPartial) { cTimer_Detail_V1 data; From 78d424d2562350d77bbbce00910b2e4a01483bbe Mon Sep 17 00:00:00 2001 From: kamel5 Date: Tue, 9 Feb 2021 15:02:44 +0100 Subject: [PATCH 07/17] Token eLeMenuDefaultIT::devstatus added --- coreengine/definitions.h | 1 + coreengine/listelements.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/coreengine/definitions.h b/coreengine/definitions.h index 6206843..a995907 100644 --- a/coreengine/definitions.h +++ b/coreengine/definitions.h @@ -813,6 +813,7 @@ enum class eLeMenuDefaultIT { remoteosd, filebrowser, epgsearch, + devstatus, count }; diff --git a/coreengine/listelements.c b/coreengine/listelements.c index decca1e..02b32d5 100644 --- a/coreengine/listelements.c +++ b/coreengine/listelements.c @@ -304,6 +304,7 @@ void cLeMenuDefault::SetTokenContainer(void) { tokenContainer->DefineIntToken("{remoteosd}", (int)eLeMenuDefaultIT::remoteosd); tokenContainer->DefineIntToken("{filebrowser}", (int)eLeMenuDefaultIT::filebrowser); tokenContainer->DefineIntToken("{epgsearch}", (int)eLeMenuDefaultIT::epgsearch); + tokenContainer->DefineIntToken("{devstatus}", (int)eLeMenuDefaultIT::devstatus); InheritTokenContainer(); } @@ -430,6 +431,8 @@ void cLeMenuDefault::SetMenuCategory(void) { tokenContainer->AddIntToken((int)eLeMenuDefaultIT::filebrowser, 1); } else if (!strcmp(plugName, "epgsearch")) { tokenContainer->AddIntToken((int)eLeMenuDefaultIT::epgsearch, 1); + } else if (!strcmp(plugName, "devstatus")) { + tokenContainer->AddIntToken((int)eLeMenuDefaultIT::devstatus, 1); } } From 538d59ca4e83733c6e0b35c21a65d3efe198d176 Mon Sep 17 00:00:00 2001 From: kamel5 Date: Wed, 10 Feb 2021 13:33:54 +0100 Subject: [PATCH 08/17] An error with the remaining time in the channel display has been fixed The remaining time in the channel display wasn't updated. A new token "currentremaining" was introduced in the Progressbar section of displaychannel.xml. --- coreengine/definitions.h | 1 + coreengine/viewelementsdisplaychannel.c | 10 ++++++++++ coreengine/viewelementsdisplaychannel.h | 3 ++- skins/estuary4vdr/xmlfiles/displaychannel.xml | 7 ++++--- skins/metrixhd/xmlfiles/displaychannel.xml | 4 +++- skinskeleton/xmlfiles/displaychannel.xml | 3 ++- 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/coreengine/definitions.h b/coreengine/definitions.h index a995907..b7a3022 100644 --- a/coreengine/definitions.h +++ b/coreengine/definitions.h @@ -433,6 +433,7 @@ enum class eDCProgressBarIT { remaining, permashift, livebuffer, + currentremaining, count }; diff --git a/coreengine/viewelementsdisplaychannel.c b/coreengine/viewelementsdisplaychannel.c index 4b71970..9a307a7 100644 --- a/coreengine/viewelementsdisplaychannel.c +++ b/coreengine/viewelementsdisplaychannel.c @@ -216,16 +216,19 @@ void cVeDcProgressBar::SetTokenContainer(void) { tokenContainer->DefineIntToken("{remaining}", (int)eDCProgressBarIT::remaining); tokenContainer->DefineIntToken("{permashift}", (int)eDCProgressBarIT::permashift); tokenContainer->DefineIntToken("{livebuffer}", (int)eDCProgressBarIT::livebuffer); + tokenContainer->DefineIntToken("{currentremaining}", (int)eDCProgressBarIT::currentremaining); InheritTokenContainer(); } void cVeDcProgressBar::Set(const cEvent *p) { if (!p) { startTime = -1; + endTime = -1; duration = -1; return; } startTime = p->StartTime(); + endTime = p-> EndTime(); duration = p->Duration(); int current = 0; @@ -249,18 +252,24 @@ void cVeDcProgressBar::Set(const cEvent *p) { } else { tokenContainer->AddIntToken((int)eDCProgressBarIT::permashift, 0); } + tokenContainer->AddIntToken((int)eDCProgressBarIT::currentremaining, (int)round((endTime - t) / 60)); } bool cVeDcProgressBar::Parse(bool force) { if (!cViewElement::Parse(force)) return false; + int current = 0; time_t t = time(NULL); if (t > startTime) current = t - startTime; + if (!(current > currentLast + 3) && !force && !Dirty()) return false; + + currentLast = current; SetDirty(); + if (duration <= 0) { tokenContainer->AddIntToken((int)eDCProgressBarIT::duration, 0); tokenContainer->AddIntToken((int)eDCProgressBarIT::elapsed, 0); @@ -276,6 +285,7 @@ bool cVeDcProgressBar::Parse(bool force) { } else { tokenContainer->AddIntToken((int)eDCProgressBarIT::permashift, 0); } + tokenContainer->AddIntToken((int)eDCProgressBarIT::currentremaining, (int)round((endTime - t) / 60)); } return true; } diff --git a/coreengine/viewelementsdisplaychannel.h b/coreengine/viewelementsdisplaychannel.h index b1a7691..fbae6d2 100644 --- a/coreengine/viewelementsdisplaychannel.h +++ b/coreengine/viewelementsdisplaychannel.h @@ -51,6 +51,7 @@ class cVeDcProgressBar : public cViewElement { private: int currentLast; int startTime; + int endTime; int duration; int GetLiveBuffer(void); public: @@ -199,4 +200,4 @@ public: cVeDcGroupChannelListDetail(void) {}; virtual ~cVeDcGroupChannelListDetail(void) {}; }; -#endif //__VIEWELEMENTSDC_H \ No newline at end of file +#endif //__VIEWELEMENTSDC_H diff --git a/skins/estuary4vdr/xmlfiles/displaychannel.xml b/skins/estuary4vdr/xmlfiles/displaychannel.xml index cdc9c10..e38773d 100644 --- a/skins/estuary4vdr/xmlfiles/displaychannel.xml +++ b/skins/estuary4vdr/xmlfiles/displaychannel.xml @@ -37,9 +37,6 @@ - - - @@ -58,6 +55,10 @@ + + + + diff --git a/skins/metrixhd/xmlfiles/displaychannel.xml b/skins/metrixhd/xmlfiles/displaychannel.xml index a057b88..b2466c4 100644 --- a/skins/metrixhd/xmlfiles/displaychannel.xml +++ b/skins/metrixhd/xmlfiles/displaychannel.xml @@ -28,7 +28,6 @@ - @@ -47,6 +46,9 @@ + + + diff --git a/skinskeleton/xmlfiles/displaychannel.xml b/skinskeleton/xmlfiles/displaychannel.xml index 393a30e..ab2872f 100644 --- a/skinskeleton/xmlfiles/displaychannel.xml +++ b/skinskeleton/xmlfiles/displaychannel.xml @@ -25,7 +25,7 @@ {currentdurationhours} Duration, full hours {currentdurationminutes} Duration, rest of minutes {currentelapsed} Elapsed time of current Schedule in min - {currentremaining} Remaining time of current Schedule in min + {currentremaining} Remaining time of current Schedule in min -> DEPRECATED, it doesn't work as expected {currentrecording} true if current Schedule is recorded {hasVPS} true if current Schedule has VPS {nexttitle} Title of next Schedule @@ -48,6 +48,7 @@ {remaining} Remaining time of current Schedule in seconds {permashift} true if permashift plugin is in use {livebuffer} current buffered data in seconds + {currentremaining} Remaining time of current Schedule in min --> From 628a28201b797635486aad40fad042c4c4222656 Mon Sep 17 00:00:00 2001 From: kamel5 Date: Wed, 10 Feb 2021 16:02:44 +0100 Subject: [PATCH 09/17] Revision cViewReplay::SetTimeShiftValues() When the timeshift recording reaches the end time of the start event, the progress bar and the end time no longer shows any useful information. From this version the current live event is used to calculate the progress bar and the end time. --- coreengine/viewdisplayreplay.c | 34 +++++++++++++++++----------------- coreengine/viewdisplayreplay.h | 1 - 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/coreengine/viewdisplayreplay.c b/coreengine/viewdisplayreplay.c index db767dc..aed160d 100644 --- a/coreengine/viewdisplayreplay.c +++ b/coreengine/viewdisplayreplay.c @@ -162,15 +162,6 @@ void cViewReplay::ClearVariables(void) { globalTimers.ClearTimers(); } -void cViewReplay::SetTimeShift(int framesTotal, int timeShiftLength) { - timeShiftActive = true; - timeShiftFramesTotal = framesTotal; - this->timeShiftLength = timeShiftLength; - int mins = (timeShiftLength / 60) % 60; - int hours = (timeShiftLength / 3600) % 24; - timeShiftDuration = cString::sprintf("%d:%02d", hours, mins); -} - void cViewReplay::SetRecording(const cRecording *recording) { this->recording = recording; if (veRecTitle) { @@ -195,31 +186,40 @@ void cViewReplay::GetGlobalTimers(void) { void cViewReplay::SetTimeShiftValues(void) { if (!recording) return; - bool isTimeShift = false; + timeShiftActive = false; #if APIVERSNUM >= 20101 int usage = recording->IsInUse(); if (usage & ruTimer) - isTimeShift = true; + timeShiftActive = true; else { GetGlobalTimers(); if (globalTimers.IsRecording(recording)) - isTimeShift = true; + timeShiftActive = true; } #endif - if (!isTimeShift) + if (!timeShiftActive) return; const cRecordingInfo *recInfo = recording->Info(); if (!recInfo) return; - const cEvent *event = recInfo->GetEvent(); + const cSchedule *Schedule = NULL; + { + LOCK_SCHEDULES_READ; + Schedule = Schedules->GetSchedule(recInfo->ChannelID()); + } + if (!Schedule) + return; + const cEvent *event = Schedule->GetEventAround(time(NULL)); if (!event) return; double fps = recording->FramesPerSecond(); time_t liveEventStop = event->EndTime(); time_t recordingStart = time(0) - recording->LengthInSeconds(); - int framesTotal = (liveEventStop - recordingStart)*fps; - int recLength = liveEventStop - recordingStart; - SetTimeShift(framesTotal, recLength); + timeShiftFramesTotal = (liveEventStop - recordingStart) * fps; + timeShiftLength = liveEventStop - recordingStart; + int mins = (timeShiftLength / 60) % 60; + int hours = (timeShiftLength / 3600) % 24; + timeShiftDuration = cString::sprintf("%d:%02d", hours, mins); } void cViewReplay::SetTitle(const char *title) { diff --git a/coreengine/viewdisplayreplay.h b/coreengine/viewdisplayreplay.h index b9ed9eb..55e7966 100644 --- a/coreengine/viewdisplayreplay.h +++ b/coreengine/viewdisplayreplay.h @@ -45,7 +45,6 @@ public: void PreCache(void); void SetModeOnly(bool modeOnly) { this->modeOnly = modeOnly; }; void SetRecordingLength(int length) { reclength = length; }; - void SetTimeShift(int framesTotal, int timeShiftLength); void SetRecording(const cRecording *recording); void SetTitle(const char *title); void SetCurrent(const char *current); From 64599db339e6aa4b3921fd84836920023714f8c8 Mon Sep 17 00:00:00 2001 From: kamel5 Date: Thu, 11 Feb 2021 16:45:08 +0100 Subject: [PATCH 10/17] In timeshift mode, the title of the actual playback position is displayed If the timeshift mode is activated during playback, the title of the program that was active when the time shift started is displayed by pressing OK. The behavior has now been changed so that the title of the program is displayed in the actual playback position when you press OK. --- coreengine/viewdisplayreplay.c | 49 +++++++++++++++----------- coreengine/viewdisplayreplay.h | 3 +- coreengine/viewelementsdisplayreplay.c | 24 ++++++++++--- coreengine/viewelementsdisplayreplay.h | 7 ++-- 4 files changed, 55 insertions(+), 28 deletions(-) diff --git a/coreengine/viewdisplayreplay.c b/coreengine/viewdisplayreplay.c index aed160d..927780a 100644 --- a/coreengine/viewdisplayreplay.c +++ b/coreengine/viewdisplayreplay.c @@ -143,6 +143,7 @@ void cViewReplay::PreCache(void) { void cViewReplay::ClearVariables(void) { cView::ClearVariables(); recording = NULL; + lastEvent = NULL; modeOnly = false; lastFlush = 0; lastFlushModeOnly = 0; @@ -162,20 +163,6 @@ void cViewReplay::ClearVariables(void) { globalTimers.ClearTimers(); } -void cViewReplay::SetRecording(const cRecording *recording) { - this->recording = recording; - if (veRecTitle) { - veRecTitle->Set(recording); - } - if (veRecInfo) { - veRecInfo->Set(recording); - } - if (veScraperContent) { - veScraperContent->Set(recording); - } - SetTimeShiftValues(); -} - void cViewReplay::GetGlobalTimers(void) { if (!timersLoaded) { timersLoaded = true; @@ -183,7 +170,7 @@ void cViewReplay::GetGlobalTimers(void) { } } -void cViewReplay::SetTimeShiftValues(void) { +void cViewReplay::SetTimeShiftValues(int current, int total) { if (!recording) return; timeShiftActive = false; @@ -209,21 +196,43 @@ void cViewReplay::SetTimeShiftValues(void) { } if (!Schedule) return; - const cEvent *event = Schedule->GetEventAround(time(NULL)); - if (!event) + // Get event at actual recording position + const cEvent *eventEnde = Schedule->GetEventAround(time(NULL)); + if (!eventEnde) return; double fps = recording->FramesPerSecond(); - time_t liveEventStop = event->EndTime(); + time_t liveEventStop = eventEnde->EndTime(); time_t recordingStart = time(0) - recording->LengthInSeconds(); timeShiftFramesTotal = (liveEventStop - recordingStart) * fps; timeShiftLength = liveEventStop - recordingStart; + // Get event at actual replay position + int secondsafter = (int)(recording->LengthInSeconds() * (1.0 - (double)current / (double)total)); + const cEvent *eventReplay = Schedule->GetEventAround(time(NULL) - secondsafter); + // Display title at replay position + if (eventReplay && eventReplay != lastEvent && veRecTitle) { + veRecTitle->Set(recording, eventReplay); + veRecTitle->Parse(); + lastEvent = eventReplay; + } int mins = (timeShiftLength / 60) % 60; int hours = (timeShiftLength / 3600) % 24; timeShiftDuration = cString::sprintf("%d:%02d", hours, mins); } +void cViewReplay::SetRecording(const cRecording *recording) { + this->recording = recording; + if (veRecTitle) { + veRecTitle->Set(recording); + } + if (veRecInfo) { + veRecInfo->Set(recording); + } + if (veScraperContent) { + veScraperContent->Set(recording); + } +} + void cViewReplay::SetTitle(const char *title) { - recording = NULL; if (veRecTitle) { veRecTitle->Set(title); } @@ -263,7 +272,7 @@ void cViewReplay::SetEndTime(int current, int total) { } void cViewReplay::SetProgressbar(int current, int total) { - SetTimeShiftValues(); + SetTimeShiftValues(current, total); if (veProgressbar) veProgressbar->Set(current, total, timeShiftActive, timeShiftFramesTotal); Render((int)eVeDisplayReplay::progressbar); diff --git a/coreengine/viewdisplayreplay.h b/coreengine/viewdisplayreplay.h index 55e7966..310c6e9 100644 --- a/coreengine/viewdisplayreplay.h +++ b/coreengine/viewdisplayreplay.h @@ -22,6 +22,7 @@ private: cVeDrOnPause *veOnPause; cVeDrOnPause *veOnPauseModeOnly; const cRecording *recording; + const cEvent *lastEvent; bool modeOnly; time_t lastFlush; time_t lastFlushModeOnly; @@ -34,7 +35,7 @@ private: bool timersLoaded; cGlobalTimers globalTimers; void GetGlobalTimers(void); - void SetTimeShiftValues(void); + void SetTimeShiftValues(int current, int total); void SetViewElements(void); void ClearVariables(void); void SetViewElementObjects(void); diff --git a/coreengine/viewelementsdisplayreplay.c b/coreengine/viewelementsdisplayreplay.c index 9249d37..5efb2d3 100644 --- a/coreengine/viewelementsdisplayreplay.c +++ b/coreengine/viewelementsdisplayreplay.c @@ -8,6 +8,7 @@ ******************************************************************/ cVeDrRecTitle::cVeDrRecTitle(void) { recording = NULL; + event = NULL; title = NULL; } @@ -24,16 +25,20 @@ void cVeDrRecTitle::SetTokenContainer(void) { InheritTokenContainer(); } -void cVeDrRecTitle::Set(const cRecording *recording) { +void cVeDrRecTitle::Set(const cRecording *recording, const cEvent *event) { if (this->title) { free(this->title); this->title = NULL; } if (this->recording) this->recording = NULL; + if (this->event) + this->event = NULL; if (!recording) return; this->recording = recording; + if (event) + this->event = event; } void cVeDrRecTitle::Set(const char *title) { @@ -43,6 +48,8 @@ void cVeDrRecTitle::Set(const char *title) { } if (this->recording) this->recording = NULL; + if (this->event) + this->event = NULL; if (!title) return; free(this->title); @@ -58,13 +65,22 @@ bool cVeDrRecTitle::Parse(bool force) { tokenContainer->Clear(); if (recording) { const char *recName = NULL; + const char *recShortText = NULL; const cRecordingInfo *recInfo = recording->Info(); - if (recInfo) + if (event) { + recName = event->Title(); + recShortText = event->ShortText(); + } else if (recInfo) { recName = recInfo->Title(); - if (!recName) + recShortText = recInfo->ShortText(); + } + if (!recName) { recName = recording->Name(); + recShortText = ""; + } + tokenContainer->AddStringToken((int)eDRRecTitleST::rectitle, recName); - tokenContainer->AddStringToken((int)eDRRecTitleST::recsubtitle, recInfo ? recInfo->ShortText() : ""); + tokenContainer->AddStringToken((int)eDRRecTitleST::recsubtitle, recShortText); tokenContainer->AddStringToken((int)eDRRecTitleST::recdate, *ShortDateString(recording->Start())); tokenContainer->AddStringToken((int)eDRRecTitleST::rectime, *TimeString(recording->Start())); } else if (title) { diff --git a/coreengine/viewelementsdisplayreplay.h b/coreengine/viewelementsdisplayreplay.h index 7e5d156..c9e40f9 100644 --- a/coreengine/viewelementsdisplayreplay.h +++ b/coreengine/viewelementsdisplayreplay.h @@ -10,13 +10,14 @@ class cVeDrRecTitle : public cViewElement { private: const cRecording *recording; + const cEvent *event; char *title; public: cVeDrRecTitle(void); virtual ~cVeDrRecTitle(void); void SetTokenContainer(void); - void Set(const cRecording *recording); - void Set(const char *title); + void Set(const cRecording *recording = NULL, const cEvent *event = NULL); + void Set(const char *title = NULL); bool Parse(bool forced = false); }; @@ -207,4 +208,4 @@ public: bool Parse(bool forced = false); }; -#endif //__VIEWELEMENTSDR_H \ No newline at end of file +#endif //__VIEWELEMENTSDR_H From 808fba23671a879b3a38675f69478189cb735a29 Mon Sep 17 00:00:00 2001 From: kamel5 Date: Fri, 12 Feb 2021 13:15:30 +0100 Subject: [PATCH 11/17] Add datetime to displaychannel in skin estuary4vdr --- skins/estuary4vdr/xmlfiles/displaychannel.xml | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/skins/estuary4vdr/xmlfiles/displaychannel.xml b/skins/estuary4vdr/xmlfiles/displaychannel.xml index e38773d..3d07379 100644 --- a/skins/estuary4vdr/xmlfiles/displaychannel.xml +++ b/skins/estuary4vdr/xmlfiles/displaychannel.xml @@ -9,6 +9,19 @@ + + + + + + + + @@ -313,13 +326,6 @@ - - From 7a70ed13a768e4c22653b12e1045aa8d9b4716eb Mon Sep 17 00:00:00 2001 From: kamel5 Date: Fri, 12 Feb 2021 15:20:34 +0100 Subject: [PATCH 12/17] Add tokens eventstart and eventstop to eDRRecTitleST Tokens eventstart and eventstop can be used in displayreplay timshiftmode to display the start and end time of the coresponding event --- coreengine/definitions.h | 7 +++++++ coreengine/viewdisplayreplay.c | 2 +- coreengine/viewelementsdisplayreplay.c | 11 ++++++++++- coreengine/viewelementsdisplayreplay.h | 3 ++- skins/estuary4vdr/xmlfiles/displayreplay.xml | 7 ++++++- skinskeleton/xmlfiles/displayreplay.xml | 3 +++ 6 files changed, 29 insertions(+), 4 deletions(-) diff --git a/coreengine/definitions.h b/coreengine/definitions.h index b7a3022..943bea8 100644 --- a/coreengine/definitions.h +++ b/coreengine/definitions.h @@ -1491,6 +1491,13 @@ enum class eDRRecTitleST { recsubtitle, recdate, rectime, + eventstart, + eventstop, + count +}; + +enum class eDRRecTitleIT { + timeshift = 0, count }; diff --git a/coreengine/viewdisplayreplay.c b/coreengine/viewdisplayreplay.c index 927780a..e84ef2c 100644 --- a/coreengine/viewdisplayreplay.c +++ b/coreengine/viewdisplayreplay.c @@ -210,7 +210,7 @@ void cViewReplay::SetTimeShiftValues(int current, int total) { const cEvent *eventReplay = Schedule->GetEventAround(time(NULL) - secondsafter); // Display title at replay position if (eventReplay && eventReplay != lastEvent && veRecTitle) { - veRecTitle->Set(recording, eventReplay); + veRecTitle->Set(recording, eventReplay, true); veRecTitle->Parse(); lastEvent = eventReplay; } diff --git a/coreengine/viewelementsdisplayreplay.c b/coreengine/viewelementsdisplayreplay.c index 5efb2d3..64df8a8 100644 --- a/coreengine/viewelementsdisplayreplay.c +++ b/coreengine/viewelementsdisplayreplay.c @@ -22,10 +22,14 @@ void cVeDrRecTitle::SetTokenContainer(void) { tokenContainer->DefineStringToken("{recsubtitle}", (int)eDRRecTitleST::recsubtitle); tokenContainer->DefineStringToken("{recdate}", (int)eDRRecTitleST::recdate); tokenContainer->DefineStringToken("{rectime}", (int)eDRRecTitleST::rectime); + tokenContainer->DefineStringToken("{eventstart}", (int)eDRRecTitleST::eventstart); + tokenContainer->DefineStringToken("{eventstop}", (int)eDRRecTitleST::eventstop); + tokenContainer->DefineIntToken("{timeshift}", (int)eDRRecTitleIT::timeshift); InheritTokenContainer(); } -void cVeDrRecTitle::Set(const cRecording *recording, const cEvent *event) { +void cVeDrRecTitle::Set(const cRecording *recording, const cEvent *event, bool timeshiftActive) { + this->timeshiftActive = timeshiftActive; if (this->title) { free(this->title); this->title = NULL; @@ -83,6 +87,11 @@ bool cVeDrRecTitle::Parse(bool force) { tokenContainer->AddStringToken((int)eDRRecTitleST::recsubtitle, recShortText); tokenContainer->AddStringToken((int)eDRRecTitleST::recdate, *ShortDateString(recording->Start())); tokenContainer->AddStringToken((int)eDRRecTitleST::rectime, *TimeString(recording->Start())); + tokenContainer->AddIntToken((int)eDRRecTitleIT::timeshift, timeshiftActive); + if (event) { + tokenContainer->AddStringToken((int)eDRRecTitleST::eventstart, *TimeString(event->StartTime())); + tokenContainer->AddStringToken((int)eDRRecTitleST::eventstop, *TimeString(event->EndTime())); + } } else if (title) { tokenContainer->AddStringToken((int)eDRRecTitleST::rectitle, title); } diff --git a/coreengine/viewelementsdisplayreplay.h b/coreengine/viewelementsdisplayreplay.h index c9e40f9..f6d28e5 100644 --- a/coreengine/viewelementsdisplayreplay.h +++ b/coreengine/viewelementsdisplayreplay.h @@ -12,11 +12,12 @@ private: const cRecording *recording; const cEvent *event; char *title; + bool timeshiftActive; public: cVeDrRecTitle(void); virtual ~cVeDrRecTitle(void); void SetTokenContainer(void); - void Set(const cRecording *recording = NULL, const cEvent *event = NULL); + void Set(const cRecording *recording = NULL, const cEvent *event = NULL, bool timeshiftActive = false); void Set(const char *title = NULL); bool Parse(bool forced = false); }; diff --git a/skins/estuary4vdr/xmlfiles/displayreplay.xml b/skins/estuary4vdr/xmlfiles/displayreplay.xml index f3e96b6..0e8b33a 100644 --- a/skins/estuary4vdr/xmlfiles/displayreplay.xml +++ b/skins/estuary4vdr/xmlfiles/displayreplay.xml @@ -38,7 +38,12 @@ - + + + + + + diff --git a/skinskeleton/xmlfiles/displayreplay.xml b/skinskeleton/xmlfiles/displayreplay.xml index 083cdf6..ed548ba 100644 --- a/skinskeleton/xmlfiles/displayreplay.xml +++ b/skinskeleton/xmlfiles/displayreplay.xml @@ -56,6 +56,9 @@ {recsubtitle} Subtitle of the Recording {recdate} Date Recording in dd.mm.yy {rectime} Time of Recording in hh:mm + {eventstart} Starttime of coresponding event in timeshiftmode in hh:mm + {eventstop} Endtime of coresponding event in timeshiftmode in hh:mm + {timeshift} true if a timeshifted recording is displayed --> From 1fc5379e2eed0ecd7eb2227564077a62bc0b1e12 Mon Sep 17 00:00:00 2001 From: kamel5 Date: Sun, 14 Feb 2021 18:23:16 +0100 Subject: [PATCH 13/17] Disabled timeshift display for non timeshift recordings --- coreengine/viewdisplayreplay.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/coreengine/viewdisplayreplay.c b/coreengine/viewdisplayreplay.c index e84ef2c..30b7c36 100644 --- a/coreengine/viewdisplayreplay.c +++ b/coreengine/viewdisplayreplay.c @@ -173,6 +173,9 @@ void cViewReplay::GetGlobalTimers(void) { void cViewReplay::SetTimeShiftValues(int current, int total) { if (!recording) return; + const char *recName = recording->Name(); + if (recName && *recName != '@') + return; timeShiftActive = false; #if APIVERSNUM >= 20101 int usage = recording->IsInUse(); From afa9cb77a3534dd253ec7e6b4ea63305e410097d Mon Sep 17 00:00:00 2001 From: kamel5 Date: Fri, 12 Feb 2021 15:20:34 +0100 Subject: [PATCH 14/17] 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/definitions.h | 23 +++++++ coreengine/viewdisplayreplay.c | 49 +++++++++++--- coreengine/viewdisplayreplay.h | 5 +- coreengine/viewelement.c | 2 + coreengine/viewelementsdisplayreplay.c | 68 ++++++++++++++++++-- coreengine/viewelementsdisplayreplay.h | 30 +++++++-- displayreplay.c | 2 + dtd/displayreplay.dtd | 17 ++++- skins/estuary4vdr/globals.xml | 21 ++++++ skins/estuary4vdr/xmlfiles/displayreplay.xml | 55 ++++++++++++---- skinskeleton/xmlfiles/displayreplay.xml | 13 +++- 11 files changed, 248 insertions(+), 37 deletions(-) diff --git a/coreengine/definitions.h b/coreengine/definitions.h index 943bea8..678c54f 100644 --- a/coreengine/definitions.h +++ b/coreengine/definitions.h @@ -129,6 +129,7 @@ enum class eVeDisplayReplay { recinfo, currenttime, totaltime, + timeshifttimes, endtime, progressbar, cutmarks, @@ -1522,6 +1523,11 @@ enum class eDRCurrentTimeST { count }; +enum class eDRCurrentTimeIT { + timeshift = 0, + count +}; + enum class eDRTotalTimeST { rectotal = 0, timeshifttotal, @@ -1533,11 +1539,28 @@ enum class eDRTotalTimeIT { count }; +enum class eDRTimeshiftTimesST { + recstart = 0, + playbacktime, + timeshiftrest, + count +}; + +enum class eDRTimeshiftTimesIT { + timeshift = 0, + count +}; + enum class eDREndTimeST { recend = 0, count }; +enum class eDREndTimeIT { + timeshift = 0, + count +}; + enum class eDRProgressbarIT { current = 0, total, diff --git a/coreengine/viewdisplayreplay.c b/coreengine/viewdisplayreplay.c index 30b7c36..c3aeb00 100644 --- a/coreengine/viewdisplayreplay.c +++ b/coreengine/viewdisplayreplay.c @@ -6,6 +6,7 @@ cViewReplay::cViewReplay(void) { veCustomTokens = NULL; + veTimeshiftTimes = NULL; veEndTime = NULL; veMessage = NULL; veScraperContent = NULL; @@ -45,6 +46,7 @@ void cViewReplay::SetViewElements(void) { viewElementNames.insert(pair("rectitle", (int)eVeDisplayReplay::rectitle)); viewElementNames.insert(pair("recinfo", (int)eVeDisplayReplay::recinfo)); viewElementNames.insert(pair("currenttime", (int)eVeDisplayReplay::currenttime)); + viewElementNames.insert(pair("timeshifttimes", (int)eVeDisplayReplay::timeshifttimes)); viewElementNames.insert(pair("endtime", (int)eVeDisplayReplay::endtime)); viewElementNames.insert(pair("totaltime", (int)eVeDisplayReplay::totaltime)); viewElementNames.insert(pair("progressbar", (int)eVeDisplayReplay::progressbar)); @@ -92,6 +94,10 @@ void cViewReplay::SetViewElementObjects(void) { { veTotalTime = dynamic_cast(viewElements[i]); } + else if (dynamic_cast(viewElements[i])) + { + veTimeshiftTimes = dynamic_cast(viewElements[i]); + } else if (dynamic_cast(viewElements[i])) { veEndTime = dynamic_cast(viewElements[i]); @@ -153,8 +159,11 @@ void cViewReplay::ClearVariables(void) { timeShiftFramesTotal = -1; timeShiftLength = -1; timeShiftDuration = ""; + timeshiftrest = ""; if (veCustomTokens) veCustomTokens->Reset(); + if (veTimeshiftTimes) + veTimeshiftTimes->Set(cString(""), cString(""), cString("")); if (veEndTime) veEndTime->Set(cString("")); if (veCutMarks) @@ -200,17 +209,20 @@ void cViewReplay::SetTimeShiftValues(int current, int total) { if (!Schedule) return; // Get event at actual recording position - const cEvent *eventEnde = Schedule->GetEventAround(time(NULL)); + const cEvent *eventEnde = Schedule->GetEventAround(time(0)); if (!eventEnde) return; - double fps = recording->FramesPerSecond(); + // End of live program time_t liveEventStop = eventEnde->EndTime(); + // Begin of timeshift recording time_t recordingStart = time(0) - recording->LengthInSeconds(); - timeShiftFramesTotal = (liveEventStop - recordingStart) * fps; + // actual timeshiftlength timeShiftLength = liveEventStop - recordingStart; - // Get event at actual replay position - int secondsafter = (int)(recording->LengthInSeconds() * (1.0 - (double)current / (double)total)); - const cEvent *eventReplay = Schedule->GetEventAround(time(NULL) - secondsafter); + // timeshiftlength until end of live program + timeShiftFramesTotal = total * ((double)timeShiftLength / (double)recording->LengthInSeconds()); + // Get event at actual replay position (add 30sec for a better match) + int timeShiftSecondsAfter = (int)(recording->LengthInSeconds() * (1.0 - (double)current / (double)total)) + 30; + const cEvent *eventReplay = Schedule->GetEventAround(time(0) - timeShiftSecondsAfter); // Display title at replay position if (eventReplay && eventReplay != lastEvent && veRecTitle) { veRecTitle->Set(recording, eventReplay, true); @@ -220,6 +232,9 @@ void cViewReplay::SetTimeShiftValues(int current, int total) { int mins = (timeShiftLength / 60) % 60; int hours = (timeShiftLength / 3600) % 24; timeShiftDuration = cString::sprintf("%d:%02d", hours, mins); + mins = (timeShiftSecondsAfter / 60) % 60; + hours = (timeShiftSecondsAfter / 3600) % 24; + timeshiftrest = cString::sprintf("%d:%02d", hours, mins); } void cViewReplay::SetRecording(const cRecording *recording) { @@ -249,16 +264,30 @@ void cViewReplay::SetTitle(const char *title) { void cViewReplay::SetCurrent(const char *current) { if (veCurrentTime) - veCurrentTime->Set(current); + veCurrentTime->Set(current, timeShiftActive); Render((int)eVeDisplayReplay::currenttime); } void cViewReplay::SetTotal(const char *total) { if (veTotalTime) - veTotalTime->Set(total, timeShiftActive, *timeShiftDuration); + veTotalTime->Set(total, *timeShiftDuration, timeShiftActive); Render((int)eVeDisplayReplay::totaltime); } +void cViewReplay::SetTimeshiftTimes(int current, int total) { + if (!veTimeshiftTimes || reclength == 0) + return; + time_t recordingStart = 0; + time_t playbackTime = 0; + if (timeShiftActive) { + recordingStart = time(0) - recording->LengthInSeconds(); + playbackTime = time(0) - (int)(recording->LengthInSeconds() * (1.0 - (double)current / (double)total)); + } else + recordingStart = recording->Start(); + veTimeshiftTimes->Set(TimeString(recordingStart), TimeString(playbackTime), timeshiftrest, timeShiftActive); + Render((int)eVeDisplayReplay::timeshifttimes); +} + void cViewReplay::SetEndTime(int current, int total) { if (!veEndTime || reclength == 0) return; @@ -270,12 +299,12 @@ void cViewReplay::SetEndTime(int current, int total) { } double rest = (double)(totalLength - current) / (double)totalLength; time_t end = time(0) + rest * recordingLength; - veEndTime->Set(TimeString(end)); + veEndTime->Set(TimeString(end), timeShiftActive); Render((int)eVeDisplayReplay::endtime); } void cViewReplay::SetProgressbar(int current, int total) { - SetTimeShiftValues(current, total); +// SetTimeShiftValues(current, total); if (veProgressbar) veProgressbar->Set(current, total, timeShiftActive, timeShiftFramesTotal); Render((int)eVeDisplayReplay::progressbar); diff --git a/coreengine/viewdisplayreplay.h b/coreengine/viewdisplayreplay.h index 310c6e9..5746ac2 100644 --- a/coreengine/viewdisplayreplay.h +++ b/coreengine/viewdisplayreplay.h @@ -12,6 +12,7 @@ private: cVeDrScraperContent *veScraperContent; cVeDrCurrentTime *veCurrentTime; cVeDrTotalTime *veTotalTime; + cVeDrTimeshiftTimes *veTimeshiftTimes; cVeDrEndTime *veEndTime; cVeDrProgressBar *veProgressbar; cVeDrCutMarks *veCutMarks; @@ -31,11 +32,11 @@ private: bool timeShiftActive; int timeShiftFramesTotal; int timeShiftLength; + cString timeshiftrest; cString timeShiftDuration; bool timersLoaded; cGlobalTimers globalTimers; void GetGlobalTimers(void); - void SetTimeShiftValues(int current, int total); void SetViewElements(void); void ClearVariables(void); void SetViewElementObjects(void); @@ -47,9 +48,11 @@ public: void SetModeOnly(bool modeOnly) { this->modeOnly = modeOnly; }; void SetRecordingLength(int length) { reclength = length; }; void SetRecording(const cRecording *recording); + void SetTimeShiftValues(int current, int total); void SetTitle(const char *title); void SetCurrent(const char *current); void SetTotal(const char *total); + void SetTimeshiftTimes(int current, int total); void SetEndTime(int current, int total); void SetProgressbar(int current, int total); void SetMarks(const cMarks *marks, int current, int total); diff --git a/coreengine/viewelement.c b/coreengine/viewelement.c index a30608f..abd5562 100644 --- a/coreengine/viewelement.c +++ b/coreengine/viewelement.c @@ -169,6 +169,8 @@ cViewElement *cViewElement::CreateViewElement(const char *name, const char *view e = new cVeDrCurrentTime(); else if (!strcmp(name, "totaltime")) e = new cVeDrTotalTime(); + else if (!strcmp(name, "timeshifttimes")) + e = new cVeDrTimeshiftTimes(); else if (!strcmp(name, "endtime")) e = new cVeDrEndTime(); else if (!strcmp(name, "progressbar") && !strcmp(viewname, "displayreplay")) 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(); } diff --git a/coreengine/viewelementsdisplayreplay.h b/coreengine/viewelementsdisplayreplay.h index f6d28e5..0cc4be6 100644 --- a/coreengine/viewelementsdisplayreplay.h +++ b/coreengine/viewelementsdisplayreplay.h @@ -43,11 +43,12 @@ class cVeDrCurrentTime : public cViewElement { private: bool changed; char *current; + bool timeshiftActive; public: cVeDrCurrentTime(void); virtual ~cVeDrCurrentTime(void); void SetTokenContainer(void); - void Set(const char *current); + void Set(const char *current, bool timeshiftActive = false); bool Parse(bool forced = false); }; @@ -64,7 +65,25 @@ public: cVeDrTotalTime(void); virtual ~cVeDrTotalTime(void); void SetTokenContainer(void); - void Set(const char *total, bool timeshiftActive, const char *timeshiftDuration); + void Set(const char *total, const char *timeshiftDuration = NULL, bool timeshiftActive = false); + bool Parse(bool forced = false); +}; + +/****************************************************************** +* cVeDrTimeshiftTimes +******************************************************************/ +class cVeDrTimeshiftTimes : public cViewElement { +private: + cString start; + cString playbacktime; + cString timeshiftrest; + bool changed; + bool timeshiftActive; +public: + cVeDrTimeshiftTimes(void); + virtual ~cVeDrTimeshiftTimes(void); + void SetTokenContainer(void); + void Set(cString start, cString playbacktime, cString timeshiftrest, bool timeshiftActive = false); bool Parse(bool forced = false); }; @@ -74,12 +93,13 @@ public: class cVeDrEndTime : public cViewElement { private: cString end; + bool timeshiftActive; bool changed; public: cVeDrEndTime(void); virtual ~cVeDrEndTime(void); void SetTokenContainer(void); - void Set(cString end); + void Set(cString end, bool timeshiftActive = false); bool Parse(bool forced = false); }; @@ -97,7 +117,7 @@ public: cVeDrProgressBar(void); virtual ~cVeDrProgressBar(void); void SetTokenContainer(void); - void Set(int current, int total, bool timeshiftActive, int timeshiftTotal); + void Set(int current, int total, bool timeshiftActive = false, int timeshiftTotal = 0); bool Parse(bool forced = false); }; @@ -121,7 +141,7 @@ public: cVeDrCutMarks(void); virtual ~cVeDrCutMarks(void); void SetTokenContainer(void); - void Set(const cMarks *marks, int current, int total, bool timeshiftActive, int timeshiftTotal); + void Set(const cMarks *marks, int current, int total, bool timeshiftActive = false, int timeshiftTotal = 0); void Reset(void); bool Parse(bool forced = false); }; diff --git a/displayreplay.c b/displayreplay.c index 2a8b646..1cec745 100644 --- a/displayreplay.c +++ b/displayreplay.c @@ -53,8 +53,10 @@ void cSDDisplayReplay::SetMode(bool Play, bool Forward, int Speed) { void cSDDisplayReplay::SetProgress(int Current, int Total) { if (ok) { + view->SetTimeShiftValues(Current, Total); view->SetProgressbar(Current, Total); view->SetMarks(marks, Current, Total); + view->SetTimeshiftTimes(Current, Total); view->SetEndTime(Current, Total); view->DelayOnPause(); } diff --git a/dtd/displayreplay.dtd b/dtd/displayreplay.dtd index d3e2859..c226c12 100644 --- a/dtd/displayreplay.dtd +++ b/dtd/displayreplay.dtd @@ -4,7 +4,7 @@ + + + -%functions; \ No newline at end of file +%functions; diff --git a/skins/estuary4vdr/globals.xml b/skins/estuary4vdr/globals.xml index eb5fa60..6a77984 100644 --- a/skins/estuary4vdr/globals.xml +++ b/skins/estuary4vdr/globals.xml @@ -242,6 +242,27 @@ Időzítő kereső Cerca timer + + start + Beginn + Alkaa + Rajt + Inizio + + + rest + Rest + Loput + Maradék + Riposo + + + playback + Wiedergabe + Toisto + Lejátszás + Riproduzione + end Ende diff --git a/skins/estuary4vdr/xmlfiles/displayreplay.xml b/skins/estuary4vdr/xmlfiles/displayreplay.xml index 0e8b33a..3295d0d 100644 --- a/skins/estuary4vdr/xmlfiles/displayreplay.xml +++ b/skins/estuary4vdr/xmlfiles/displayreplay.xml @@ -16,15 +16,15 @@ - + @@ -38,7 +38,7 @@ - + @@ -73,29 +73,46 @@ - + + + + - - - + + + + + + + + + + + + + + + + + - + - + - + @@ -103,7 +120,7 @@ - + @@ -115,6 +132,18 @@ + + + + + + + + + + + + diff --git a/skinskeleton/xmlfiles/displayreplay.xml b/skinskeleton/xmlfiles/displayreplay.xml index ed548ba..7e2a1aa 100644 --- a/skinskeleton/xmlfiles/displayreplay.xml +++ b/skinskeleton/xmlfiles/displayreplay.xml @@ -76,7 +76,8 @@ @@ -89,8 +90,18 @@ + + + + From 15aa722410efcbf474a3b68ec67ec8b23d19f0f2 Mon Sep 17 00:00:00 2001 From: kamel5 Date: Mon, 15 Feb 2021 12:36:55 +0100 Subject: [PATCH 15/17] Move SetTimeShiftValues --- coreengine/viewdisplayreplay.c | 2 +- displayreplay.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/coreengine/viewdisplayreplay.c b/coreengine/viewdisplayreplay.c index c3aeb00..02d0998 100644 --- a/coreengine/viewdisplayreplay.c +++ b/coreengine/viewdisplayreplay.c @@ -304,7 +304,7 @@ void cViewReplay::SetEndTime(int current, int total) { } void cViewReplay::SetProgressbar(int current, int total) { -// SetTimeShiftValues(current, total); + SetTimeShiftValues(current, total); if (veProgressbar) veProgressbar->Set(current, total, timeShiftActive, timeShiftFramesTotal); Render((int)eVeDisplayReplay::progressbar); diff --git a/displayreplay.c b/displayreplay.c index 1cec745..37e87ff 100644 --- a/displayreplay.c +++ b/displayreplay.c @@ -53,7 +53,6 @@ void cSDDisplayReplay::SetMode(bool Play, bool Forward, int Speed) { void cSDDisplayReplay::SetProgress(int Current, int Total) { if (ok) { - view->SetTimeShiftValues(Current, Total); view->SetProgressbar(Current, Total); view->SetMarks(marks, Current, Total); view->SetTimeshiftTimes(Current, Total); From 99d2bc6a8636ce30384d2d10180b1e12dec431b4 Mon Sep 17 00:00:00 2001 From: kamel5 Date: Mon, 15 Feb 2021 13:19:49 +0100 Subject: [PATCH 16/17] Eliminate SetRecordingLength --- coreengine/viewdisplayreplay.c | 9 ++++----- coreengine/viewdisplayreplay.h | 1 - displayreplay.c | 9 --------- displayreplay.h | 1 - 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/coreengine/viewdisplayreplay.c b/coreengine/viewdisplayreplay.c index 02d0998..30986bb 100644 --- a/coreengine/viewdisplayreplay.c +++ b/coreengine/viewdisplayreplay.c @@ -154,7 +154,6 @@ void cViewReplay::ClearVariables(void) { lastFlush = 0; lastFlushModeOnly = 0; message = false; - reclength = -1; timeShiftActive = false; timeShiftFramesTotal = -1; timeShiftLength = -1; @@ -216,7 +215,7 @@ void cViewReplay::SetTimeShiftValues(int current, int total) { time_t liveEventStop = eventEnde->EndTime(); // Begin of timeshift recording time_t recordingStart = time(0) - recording->LengthInSeconds(); - // actual timeshiftlength + // actual timeshiftlength in sec timeShiftLength = liveEventStop - recordingStart; // timeshiftlength until end of live program timeShiftFramesTotal = total * ((double)timeShiftLength / (double)recording->LengthInSeconds()); @@ -275,7 +274,7 @@ void cViewReplay::SetTotal(const char *total) { } void cViewReplay::SetTimeshiftTimes(int current, int total) { - if (!veTimeshiftTimes || reclength == 0) + if (!veTimeshiftTimes || !recording) return; time_t recordingStart = 0; time_t playbackTime = 0; @@ -289,10 +288,10 @@ void cViewReplay::SetTimeshiftTimes(int current, int total) { } void cViewReplay::SetEndTime(int current, int total) { - if (!veEndTime || reclength == 0) + if (!veEndTime || !recording) return; int totalLength = total; - int recordingLength = reclength; + int recordingLength = recording->LengthInSeconds(); if (timeShiftActive && timeShiftFramesTotal > 0) { totalLength = timeShiftFramesTotal; recordingLength = timeShiftLength; diff --git a/coreengine/viewdisplayreplay.h b/coreengine/viewdisplayreplay.h index 5746ac2..8e61f3b 100644 --- a/coreengine/viewdisplayreplay.h +++ b/coreengine/viewdisplayreplay.h @@ -46,7 +46,6 @@ public: virtual ~cViewReplay(void); void PreCache(void); void SetModeOnly(bool modeOnly) { this->modeOnly = modeOnly; }; - void SetRecordingLength(int length) { reclength = length; }; void SetRecording(const cRecording *recording); void SetTimeShiftValues(int current, int total); void SetTitle(const char *title); diff --git a/displayreplay.c b/displayreplay.c index 37e87ff..60079ff 100644 --- a/displayreplay.c +++ b/displayreplay.c @@ -1,7 +1,6 @@ #include "displayreplay.h" cSDDisplayReplay::cSDDisplayReplay(cViewReplay *replayView, bool ModeOnly) { - init = true; view = replayView; ok = view->Init(); if (!ok) @@ -16,10 +15,6 @@ cSDDisplayReplay::~cSDDisplayReplay() { void cSDDisplayReplay::SetRecording(const cRecording *Recording) { if (ok) { view->SetRecording(Recording); - if (init) { - view->SetRecordingLength(Recording->LengthInSeconds()); - init = false; - } } } @@ -27,10 +22,6 @@ void cSDDisplayReplay::SetTitle(const char *Title) { if (!ok) return; view->SetTitle(Title); - if (init) { - view->SetRecordingLength(0); - init = false; - } } void cSDDisplayReplay::SetMode(bool Play, bool Forward, int Speed) { diff --git a/displayreplay.h b/displayreplay.h index 1ee635d..10f086d 100644 --- a/displayreplay.h +++ b/displayreplay.h @@ -8,7 +8,6 @@ class cSDDisplayReplay : public cSkinDisplayReplay { private: bool ok; - bool init; cViewReplay *view; public: cSDDisplayReplay(cViewReplay *replayView, bool ModeOnly); From 402044d4c4cbf626ddc57cef48bf0d0ddc88790a Mon Sep 17 00:00:00 2001 From: kamel5 Date: Mon, 8 Feb 2021 17:38:34 +0100 Subject: [PATCH 17/17] Version 1.2.13 --- HISTORY | 14 ++++++++++++++ skindesigner.c | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/HISTORY b/HISTORY index aa71d55..8c65fca 100644 --- a/HISTORY +++ b/HISTORY @@ -478,3 +478,17 @@ Version 1.2.11 (buggy) Version 1.2.12 - [pbiering] added token for recordings: isRecording - [pbiering] fix crash caused by cVeDmDetailheaderRec::Parse introduced in 1.2.10 + +Version 1.2.13 +- [kamel5] A bug with timeshift in connection with global timers has been fixed +- [kamel5] Fixed a bug in timeshift mode that prevented the progress bar from updating in pause mode +- [kamel5] Update Skin estuary4vdr +- Token eCeMenuSchedulesIT::durationminutes added +- Token eLeMenuDefaultIT::devstatus added +- [kamel5] An error with the remaining time in the channel display has been fixed +- [kamel5] Revision cViewReplay::SetTimeShiftValues +- [kamel5] In timeshift mode, the title of the actual playback position is displayed +- [kamel5] Add token recstart to displayreplay +- [kamel5] Add tokens eventstart and eventstop to eDRRecTitleST +- [kamel5] Disabled timeshift display for non timeshift recordings +- [kamel5] Add element timeShiftTimes with tokens recstart, playbacktime and timeshiftrest to displayreplay diff --git a/skindesigner.c b/skindesigner.c index 55ff83c..25290d5 100644 --- a/skindesigner.c +++ b/skindesigner.c @@ -21,7 +21,7 @@ #endif -static const char *VERSION = "1.2.12"; +static const char *VERSION = "1.2.13"; static const char *DESCRIPTION = trNOOP("Skin Designer"); class cPluginSkinDesigner : public cPlugin, public skindesignerapi::SkindesignerAPI {