summaryrefslogtreecommitdiff
path: root/coreengine/viewdisplayreplay.c
diff options
context:
space:
mode:
authorkamel5 <vdr.kamel5 (at) gmx (dot) net>2021-02-11 16:45:08 +0100
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2021-02-11 17:39:18 +0100
commit64599db339e6aa4b3921fd84836920023714f8c8 (patch)
tree1e139abd5e98aaf905c2f11016a610fa3c8e84cf /coreengine/viewdisplayreplay.c
parent628a28201b797635486aad40fad042c4c4222656 (diff)
downloadvdr-plugin-skindesigner-64599db339e6aa4b3921fd84836920023714f8c8.tar.gz
vdr-plugin-skindesigner-64599db339e6aa4b3921fd84836920023714f8c8.tar.bz2
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.
Diffstat (limited to 'coreengine/viewdisplayreplay.c')
-rw-r--r--coreengine/viewdisplayreplay.c49
1 files changed, 29 insertions, 20 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);