From 64599db339e6aa4b3921fd84836920023714f8c8 Mon Sep 17 00:00:00 2001 From: kamel5 Date: Thu, 11 Feb 2021 16:45:08 +0100 Subject: 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/viewelementsdisplayreplay.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'coreengine/viewelementsdisplayreplay.c') 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) { -- cgit v1.2.3