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.
This commit is contained in:
kamel5 2021-02-12 15:20:34 +01:00
parent 1fc5379e2e
commit afa9cb77a3
11 changed files with 248 additions and 37 deletions

View File

@ -129,6 +129,7 @@ enum class eVeDisplayReplay {
recinfo, recinfo,
currenttime, currenttime,
totaltime, totaltime,
timeshifttimes,
endtime, endtime,
progressbar, progressbar,
cutmarks, cutmarks,
@ -1522,6 +1523,11 @@ enum class eDRCurrentTimeST {
count count
}; };
enum class eDRCurrentTimeIT {
timeshift = 0,
count
};
enum class eDRTotalTimeST { enum class eDRTotalTimeST {
rectotal = 0, rectotal = 0,
timeshifttotal, timeshifttotal,
@ -1533,11 +1539,28 @@ enum class eDRTotalTimeIT {
count count
}; };
enum class eDRTimeshiftTimesST {
recstart = 0,
playbacktime,
timeshiftrest,
count
};
enum class eDRTimeshiftTimesIT {
timeshift = 0,
count
};
enum class eDREndTimeST { enum class eDREndTimeST {
recend = 0, recend = 0,
count count
}; };
enum class eDREndTimeIT {
timeshift = 0,
count
};
enum class eDRProgressbarIT { enum class eDRProgressbarIT {
current = 0, current = 0,
total, total,

View File

@ -6,6 +6,7 @@
cViewReplay::cViewReplay(void) { cViewReplay::cViewReplay(void) {
veCustomTokens = NULL; veCustomTokens = NULL;
veTimeshiftTimes = NULL;
veEndTime = NULL; veEndTime = NULL;
veMessage = NULL; veMessage = NULL;
veScraperContent = NULL; veScraperContent = NULL;
@ -45,6 +46,7 @@ void cViewReplay::SetViewElements(void) {
viewElementNames.insert(pair<string, int>("rectitle", (int)eVeDisplayReplay::rectitle)); viewElementNames.insert(pair<string, int>("rectitle", (int)eVeDisplayReplay::rectitle));
viewElementNames.insert(pair<string, int>("recinfo", (int)eVeDisplayReplay::recinfo)); viewElementNames.insert(pair<string, int>("recinfo", (int)eVeDisplayReplay::recinfo));
viewElementNames.insert(pair<string, int>("currenttime", (int)eVeDisplayReplay::currenttime)); viewElementNames.insert(pair<string, int>("currenttime", (int)eVeDisplayReplay::currenttime));
viewElementNames.insert(pair<string, int>("timeshifttimes", (int)eVeDisplayReplay::timeshifttimes));
viewElementNames.insert(pair<string, int>("endtime", (int)eVeDisplayReplay::endtime)); viewElementNames.insert(pair<string, int>("endtime", (int)eVeDisplayReplay::endtime));
viewElementNames.insert(pair<string, int>("totaltime", (int)eVeDisplayReplay::totaltime)); viewElementNames.insert(pair<string, int>("totaltime", (int)eVeDisplayReplay::totaltime));
viewElementNames.insert(pair<string, int>("progressbar", (int)eVeDisplayReplay::progressbar)); viewElementNames.insert(pair<string, int>("progressbar", (int)eVeDisplayReplay::progressbar));
@ -92,6 +94,10 @@ void cViewReplay::SetViewElementObjects(void) {
{ {
veTotalTime = dynamic_cast<cVeDrTotalTime*>(viewElements[i]); veTotalTime = dynamic_cast<cVeDrTotalTime*>(viewElements[i]);
} }
else if (dynamic_cast<cVeDrTimeshiftTimes*>(viewElements[i]))
{
veTimeshiftTimes = dynamic_cast<cVeDrTimeshiftTimes*>(viewElements[i]);
}
else if (dynamic_cast<cVeDrEndTime*>(viewElements[i])) else if (dynamic_cast<cVeDrEndTime*>(viewElements[i]))
{ {
veEndTime = dynamic_cast<cVeDrEndTime*>(viewElements[i]); veEndTime = dynamic_cast<cVeDrEndTime*>(viewElements[i]);
@ -153,8 +159,11 @@ void cViewReplay::ClearVariables(void) {
timeShiftFramesTotal = -1; timeShiftFramesTotal = -1;
timeShiftLength = -1; timeShiftLength = -1;
timeShiftDuration = ""; timeShiftDuration = "";
timeshiftrest = "";
if (veCustomTokens) if (veCustomTokens)
veCustomTokens->Reset(); veCustomTokens->Reset();
if (veTimeshiftTimes)
veTimeshiftTimes->Set(cString(""), cString(""), cString(""));
if (veEndTime) if (veEndTime)
veEndTime->Set(cString("")); veEndTime->Set(cString(""));
if (veCutMarks) if (veCutMarks)
@ -200,17 +209,20 @@ void cViewReplay::SetTimeShiftValues(int current, int total) {
if (!Schedule) if (!Schedule)
return; return;
// Get event at actual recording position // Get event at actual recording position
const cEvent *eventEnde = Schedule->GetEventAround(time(NULL)); const cEvent *eventEnde = Schedule->GetEventAround(time(0));
if (!eventEnde) if (!eventEnde)
return; return;
double fps = recording->FramesPerSecond(); // End of live program
time_t liveEventStop = eventEnde->EndTime(); time_t liveEventStop = eventEnde->EndTime();
// Begin of timeshift recording
time_t recordingStart = time(0) - recording->LengthInSeconds(); time_t recordingStart = time(0) - recording->LengthInSeconds();
timeShiftFramesTotal = (liveEventStop - recordingStart) * fps; // actual timeshiftlength
timeShiftLength = liveEventStop - recordingStart; timeShiftLength = liveEventStop - recordingStart;
// Get event at actual replay position // timeshiftlength until end of live program
int secondsafter = (int)(recording->LengthInSeconds() * (1.0 - (double)current / (double)total)); timeShiftFramesTotal = total * ((double)timeShiftLength / (double)recording->LengthInSeconds());
const cEvent *eventReplay = Schedule->GetEventAround(time(NULL) - secondsafter); // 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 // Display title at replay position
if (eventReplay && eventReplay != lastEvent && veRecTitle) { if (eventReplay && eventReplay != lastEvent && veRecTitle) {
veRecTitle->Set(recording, eventReplay, true); veRecTitle->Set(recording, eventReplay, true);
@ -220,6 +232,9 @@ void cViewReplay::SetTimeShiftValues(int current, int total) {
int mins = (timeShiftLength / 60) % 60; int mins = (timeShiftLength / 60) % 60;
int hours = (timeShiftLength / 3600) % 24; int hours = (timeShiftLength / 3600) % 24;
timeShiftDuration = cString::sprintf("%d:%02d", hours, mins); 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) { void cViewReplay::SetRecording(const cRecording *recording) {
@ -249,16 +264,30 @@ void cViewReplay::SetTitle(const char *title) {
void cViewReplay::SetCurrent(const char *current) { void cViewReplay::SetCurrent(const char *current) {
if (veCurrentTime) if (veCurrentTime)
veCurrentTime->Set(current); veCurrentTime->Set(current, timeShiftActive);
Render((int)eVeDisplayReplay::currenttime); Render((int)eVeDisplayReplay::currenttime);
} }
void cViewReplay::SetTotal(const char *total) { void cViewReplay::SetTotal(const char *total) {
if (veTotalTime) if (veTotalTime)
veTotalTime->Set(total, timeShiftActive, *timeShiftDuration); veTotalTime->Set(total, *timeShiftDuration, timeShiftActive);
Render((int)eVeDisplayReplay::totaltime); 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) { void cViewReplay::SetEndTime(int current, int total) {
if (!veEndTime || reclength == 0) if (!veEndTime || reclength == 0)
return; return;
@ -270,12 +299,12 @@ void cViewReplay::SetEndTime(int current, int total) {
} }
double rest = (double)(totalLength - current) / (double)totalLength; double rest = (double)(totalLength - current) / (double)totalLength;
time_t end = time(0) + rest * recordingLength; time_t end = time(0) + rest * recordingLength;
veEndTime->Set(TimeString(end)); veEndTime->Set(TimeString(end), timeShiftActive);
Render((int)eVeDisplayReplay::endtime); Render((int)eVeDisplayReplay::endtime);
} }
void cViewReplay::SetProgressbar(int current, int total) { void cViewReplay::SetProgressbar(int current, int total) {
SetTimeShiftValues(current, total); // SetTimeShiftValues(current, total);
if (veProgressbar) if (veProgressbar)
veProgressbar->Set(current, total, timeShiftActive, timeShiftFramesTotal); veProgressbar->Set(current, total, timeShiftActive, timeShiftFramesTotal);
Render((int)eVeDisplayReplay::progressbar); Render((int)eVeDisplayReplay::progressbar);

View File

@ -12,6 +12,7 @@ private:
cVeDrScraperContent *veScraperContent; cVeDrScraperContent *veScraperContent;
cVeDrCurrentTime *veCurrentTime; cVeDrCurrentTime *veCurrentTime;
cVeDrTotalTime *veTotalTime; cVeDrTotalTime *veTotalTime;
cVeDrTimeshiftTimes *veTimeshiftTimes;
cVeDrEndTime *veEndTime; cVeDrEndTime *veEndTime;
cVeDrProgressBar *veProgressbar; cVeDrProgressBar *veProgressbar;
cVeDrCutMarks *veCutMarks; cVeDrCutMarks *veCutMarks;
@ -31,11 +32,11 @@ private:
bool timeShiftActive; bool timeShiftActive;
int timeShiftFramesTotal; int timeShiftFramesTotal;
int timeShiftLength; int timeShiftLength;
cString timeshiftrest;
cString timeShiftDuration; cString timeShiftDuration;
bool timersLoaded; bool timersLoaded;
cGlobalTimers globalTimers; cGlobalTimers globalTimers;
void GetGlobalTimers(void); void GetGlobalTimers(void);
void SetTimeShiftValues(int current, int total);
void SetViewElements(void); void SetViewElements(void);
void ClearVariables(void); void ClearVariables(void);
void SetViewElementObjects(void); void SetViewElementObjects(void);
@ -47,9 +48,11 @@ public:
void SetModeOnly(bool modeOnly) { this->modeOnly = modeOnly; }; void SetModeOnly(bool modeOnly) { this->modeOnly = modeOnly; };
void SetRecordingLength(int length) { reclength = length; }; void SetRecordingLength(int length) { reclength = length; };
void SetRecording(const cRecording *recording); void SetRecording(const cRecording *recording);
void SetTimeShiftValues(int current, int total);
void SetTitle(const char *title); void SetTitle(const char *title);
void SetCurrent(const char *current); void SetCurrent(const char *current);
void SetTotal(const char *total); void SetTotal(const char *total);
void SetTimeshiftTimes(int current, int total);
void SetEndTime(int current, int total); void SetEndTime(int current, int total);
void SetProgressbar(int current, int total); void SetProgressbar(int current, int total);
void SetMarks(const cMarks *marks, int current, int total); void SetMarks(const cMarks *marks, int current, int total);

View File

@ -169,6 +169,8 @@ cViewElement *cViewElement::CreateViewElement(const char *name, const char *view
e = new cVeDrCurrentTime(); e = new cVeDrCurrentTime();
else if (!strcmp(name, "totaltime")) else if (!strcmp(name, "totaltime"))
e = new cVeDrTotalTime(); e = new cVeDrTotalTime();
else if (!strcmp(name, "timeshifttimes"))
e = new cVeDrTimeshiftTimes();
else if (!strcmp(name, "endtime")) else if (!strcmp(name, "endtime"))
e = new cVeDrEndTime(); e = new cVeDrEndTime();
else if (!strcmp(name, "progressbar") && !strcmp(viewname, "displayreplay")) else if (!strcmp(name, "progressbar") && !strcmp(viewname, "displayreplay"))

View File

@ -10,6 +10,7 @@ cVeDrRecTitle::cVeDrRecTitle(void) {
recording = NULL; recording = NULL;
event = NULL; event = NULL;
title = NULL; title = NULL;
timeshiftActive = false;
} }
cVeDrRecTitle::~cVeDrRecTitle(void) { cVeDrRecTitle::~cVeDrRecTitle(void) {
@ -163,6 +164,7 @@ bool cVeDrRecInfo::Parse(bool force) {
cVeDrCurrentTime::cVeDrCurrentTime(void) { cVeDrCurrentTime::cVeDrCurrentTime(void) {
changed = true; changed = true;
current = NULL; current = NULL;
timeshiftActive = false;
} }
cVeDrCurrentTime::~cVeDrCurrentTime(void) { cVeDrCurrentTime::~cVeDrCurrentTime(void) {
@ -172,14 +174,16 @@ cVeDrCurrentTime::~cVeDrCurrentTime(void) {
void cVeDrCurrentTime::SetTokenContainer(void) { void cVeDrCurrentTime::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer(); tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{reccurrent}", (int)eDRCurrentTimeST::reccurrent); tokenContainer->DefineStringToken("{reccurrent}", (int)eDRCurrentTimeST::reccurrent);
tokenContainer->DefineIntToken("{timeshift}", (int)eDRCurrentTimeIT::timeshift);
InheritTokenContainer(); InheritTokenContainer();
} }
void cVeDrCurrentTime::Set(const char *current) { void cVeDrCurrentTime::Set(const char *current, bool timeshiftActive) {
if (!current) if (!current)
return; return;
free(this->current); free(this->current);
this->current = strdup(current); this->current = strdup(current);
this->timeshiftActive = timeshiftActive;
changed = true; changed = true;
} }
@ -188,6 +192,7 @@ bool cVeDrCurrentTime::Parse(bool force) {
return false; return false;
tokenContainer->Clear(); tokenContainer->Clear();
tokenContainer->AddStringToken((int)eDRCurrentTimeST::reccurrent, current); tokenContainer->AddStringToken((int)eDRCurrentTimeST::reccurrent, current);
tokenContainer->AddIntToken((int)eDRCurrentTimeIT::timeshift, timeshiftActive);
SetDirty(); SetDirty();
changed = false; changed = false;
return true; return true;
@ -199,8 +204,8 @@ bool cVeDrCurrentTime::Parse(bool force) {
cVeDrTotalTime::cVeDrTotalTime(void) { cVeDrTotalTime::cVeDrTotalTime(void) {
changed = true; changed = true;
total = NULL; total = NULL;
timeshiftActive = false;
timeshiftDuration = NULL; timeshiftDuration = NULL;
timeshiftActive = false;
} }
cVeDrTotalTime::~cVeDrTotalTime(void) { cVeDrTotalTime::~cVeDrTotalTime(void) {
@ -216,7 +221,7 @@ void cVeDrTotalTime::SetTokenContainer(void) {
InheritTokenContainer(); 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) if (!total)
return; return;
free(this->total); free(this->total);
@ -241,11 +246,59 @@ bool cVeDrTotalTime::Parse(bool force) {
return true; 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::cVeDrEndTime(void) { cVeDrEndTime::cVeDrEndTime(void) {
changed = true;
end = ""; end = "";
timeshiftActive = false;
} }
cVeDrEndTime::~cVeDrEndTime(void) { cVeDrEndTime::~cVeDrEndTime(void) {
@ -254,10 +307,12 @@ cVeDrEndTime::~cVeDrEndTime(void) {
void cVeDrEndTime::SetTokenContainer(void) { void cVeDrEndTime::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer(); tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{recend}", (int)eDREndTimeST::recend); tokenContainer->DefineStringToken("{recend}", (int)eDREndTimeST::recend);
tokenContainer->DefineIntToken("{timeshift}", (int)eDREndTimeIT::timeshift);
InheritTokenContainer(); InheritTokenContainer();
} }
void cVeDrEndTime::Set(cString end) { void cVeDrEndTime::Set(cString end, bool timeshiftActive) {
this->timeshiftActive = timeshiftActive;
if (strcmp(*this->end, *end)) { if (strcmp(*this->end, *end)) {
this->end = end; this->end = end;
changed = true; changed = true;
@ -269,6 +324,7 @@ bool cVeDrEndTime::Parse(bool force) {
return false; return false;
tokenContainer->Clear(); tokenContainer->Clear();
tokenContainer->AddStringToken((int)eDREndTimeST::recend, *end); tokenContainer->AddStringToken((int)eDREndTimeST::recend, *end);
tokenContainer->AddIntToken((int)eDREndTimeIT::timeshift, timeshiftActive);
SetDirty(); SetDirty();
changed = false; changed = false;
return true; return true;
@ -280,8 +336,8 @@ bool cVeDrEndTime::Parse(bool force) {
cVeDrProgressBar::cVeDrProgressBar(void) { cVeDrProgressBar::cVeDrProgressBar(void) {
current = -1; current = -1;
total = -1; total = -1;
timeshiftActive = false;
timeshiftTotal = -1; timeshiftTotal = -1;
timeshiftActive = false;
changed = true; changed = true;
} }
@ -304,6 +360,7 @@ void cVeDrProgressBar::Set(int current, int total, bool timeshiftActive, int tim
this->total = total; this->total = total;
this->timeshiftActive = timeshiftActive; this->timeshiftActive = timeshiftActive;
this->timeshiftTotal = timeshiftTotal; this->timeshiftTotal = timeshiftTotal;
changed = true; changed = true;
} }
@ -327,6 +384,7 @@ bool cVeDrProgressBar::Parse(bool force) {
cVeDrCutMarks::cVeDrCutMarks(void) { cVeDrCutMarks::cVeDrCutMarks(void) {
cutmarksIndex = -1; cutmarksIndex = -1;
lastMarks = NULL; lastMarks = NULL;
timeshiftActive = false;
Reset(); Reset();
} }

View File

@ -43,11 +43,12 @@ class cVeDrCurrentTime : public cViewElement {
private: private:
bool changed; bool changed;
char *current; char *current;
bool timeshiftActive;
public: public:
cVeDrCurrentTime(void); cVeDrCurrentTime(void);
virtual ~cVeDrCurrentTime(void); virtual ~cVeDrCurrentTime(void);
void SetTokenContainer(void); void SetTokenContainer(void);
void Set(const char *current); void Set(const char *current, bool timeshiftActive = false);
bool Parse(bool forced = false); bool Parse(bool forced = false);
}; };
@ -64,7 +65,25 @@ public:
cVeDrTotalTime(void); cVeDrTotalTime(void);
virtual ~cVeDrTotalTime(void); virtual ~cVeDrTotalTime(void);
void SetTokenContainer(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); bool Parse(bool forced = false);
}; };
@ -74,12 +93,13 @@ public:
class cVeDrEndTime : public cViewElement { class cVeDrEndTime : public cViewElement {
private: private:
cString end; cString end;
bool timeshiftActive;
bool changed; bool changed;
public: public:
cVeDrEndTime(void); cVeDrEndTime(void);
virtual ~cVeDrEndTime(void); virtual ~cVeDrEndTime(void);
void SetTokenContainer(void); void SetTokenContainer(void);
void Set(cString end); void Set(cString end, bool timeshiftActive = false);
bool Parse(bool forced = false); bool Parse(bool forced = false);
}; };
@ -97,7 +117,7 @@ public:
cVeDrProgressBar(void); cVeDrProgressBar(void);
virtual ~cVeDrProgressBar(void); virtual ~cVeDrProgressBar(void);
void SetTokenContainer(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); bool Parse(bool forced = false);
}; };
@ -121,7 +141,7 @@ public:
cVeDrCutMarks(void); cVeDrCutMarks(void);
virtual ~cVeDrCutMarks(void); virtual ~cVeDrCutMarks(void);
void SetTokenContainer(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); void Reset(void);
bool Parse(bool forced = false); bool Parse(bool forced = false);
}; };

View File

@ -53,8 +53,10 @@ void cSDDisplayReplay::SetMode(bool Play, bool Forward, int Speed) {
void cSDDisplayReplay::SetProgress(int Current, int Total) { void cSDDisplayReplay::SetProgress(int Current, int Total) {
if (ok) { if (ok) {
view->SetTimeShiftValues(Current, Total);
view->SetProgressbar(Current, Total); view->SetProgressbar(Current, Total);
view->SetMarks(marks, Current, Total); view->SetMarks(marks, Current, Total);
view->SetTimeshiftTimes(Current, Total);
view->SetEndTime(Current, Total); view->SetEndTime(Current, Total);
view->DelayOnPause(); view->DelayOnPause();
} }

View File

@ -4,7 +4,7 @@
<!ELEMENT displayreplay (background | backgroundmodeonly |datetime | time | <!ELEMENT displayreplay (background | backgroundmodeonly |datetime | time |
scrapercontent | currentweather | rectitle | recinfo | currenttime | scrapercontent | currentweather | rectitle | recinfo | currenttime |
totaltime | endtime | progressbar | cutmarks | controlicons | totaltime | timeshifttimes | endtime | progressbar | cutmarks | controlicons |
controliconsmodeonly | progressmodeonly | jump | message | onpause | controliconsmodeonly | progressmodeonly | jump | message | onpause |
onpausemodeonly | customtokens)*> onpausemodeonly | customtokens)*>
<!ATTLIST displayreplay <!ATTLIST displayreplay
@ -153,6 +153,19 @@
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT timeshifttimes (areacontainer|area|areascroll)*>
<!ATTLIST timeshifttimes
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED
condition CDATA #IMPLIED
>
<!ELEMENT endtime (areacontainer|area|areascroll)*> <!ELEMENT endtime (areacontainer|area|areascroll)*>
<!ATTLIST endtime <!ATTLIST endtime
delay CDATA #IMPLIED delay CDATA #IMPLIED
@ -289,4 +302,4 @@
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
%functions; %functions;

View File

@ -242,6 +242,27 @@
<trans lang="hu_HU">Időzítő kereső</trans> <trans lang="hu_HU">Időzítő kereső</trans>
<trans lang="it_IT">Cerca timer</trans> <trans lang="it_IT">Cerca timer</trans>
</token> </token>
<token name="tr(start)">
<trans lang="en_EN">start</trans>
<trans lang="de_DE">Beginn</trans>
<trans lang="fi_FI">Alkaa</trans>
<trans lang="hu_HU">Rajt</trans>
<trans lang="it_IT">Inizio</trans>
</token>
<token name="tr(rest)">
<trans lang="en_EN">rest</trans>
<trans lang="de_DE">Rest</trans>
<trans lang="fi_FI">Loput</trans>
<trans lang="hu_HU">Maradék</trans>
<trans lang="it_IT">Riposo</trans>
</token>
<token name="tr(playback)">
<trans lang="en_EN">playback</trans>
<trans lang="de_DE">Wiedergabe</trans>
<trans lang="fi_FI">Toisto</trans>
<trans lang="hu_HU">Lejátszás</trans>
<trans lang="it_IT">Riproduzione</trans>
</token>
<token name="tr(end)"> <token name="tr(end)">
<trans lang="en_EN">end</trans> <trans lang="en_EN">end</trans>
<trans lang="de_DE">Ende</trans> <trans lang="de_DE">Ende</trans>

View File

@ -16,15 +16,15 @@
</backgroundmodeonly> </backgroundmodeonly>
<datetime> <datetime>
<area x="75%" y="75%" width="13%" height="6%" layer="2"> <area x="85%" y="75%" width="14%" height="6%" layer="2">
<drawtext align="right" y="0" fontsize="{areaheight}*{replaydatetimesize}/100" font="{regular}" color="{fontdefault}" text="{daynameshort} {day}.{monthnameshort}" /> <drawtext align="right" y="0" fontsize="{areaheight}*{replaydatetimesize}/100" font="{regular}" color="{fontdefault}" text="{daynameshort} {day}.{monthnameshort}" />
</area> </area>
</datetime> </datetime>
<time> <time>
<area x="89%" y="75%" width="11%" height="6%" layer="2"> <area x="80%" y="80%" width="19%" height="5%" layer="2">
<drawtext name="clock" x="0" y="0" fontsize="{areaheight}*{replaydatetimesize}/100" font="{regular}" color="{fontdefault}" text="{hour}:{printf('%02d', min)}" /> <drawtext name="clocksec" align="right" y="{height(clock)} - {height(clocksec)} - 1" fontsize="{areaheight}*{replaydatetimesize}*0.8/100" font="{regular}" color="{fontdefault}" text=":{printf('%02d', sec)}" />
<drawtext name="clocksec" x="{posx(clock)} + {width(clock)}" y="{height(clock)} - {height(clocksec)} - 1" fontsize="{areaheight}*{replaydatetimesize}*0.8/100" font="{regular}" color="{fontdefault}" text=":{printf('%02d', sec)}" /> <drawtext name="clock" x="{posx(clocksec)} - {width(clock)}" y="0" fontsize="{areaheight}*{replaydatetimesize}/100" font="{regular}" color="{fontdefault}" text="{hour}:{printf('%02d', min)}" />
</area> </area>
</time> </time>
@ -38,7 +38,7 @@
</scrapercontent> </scrapercontent>
<rectitle> <rectitle>
<area condition="{timeshift}" x="12%" y="75%" width="63%" height="6%" layer="2"> <area condition="{timeshift}" x="12%" y="75%" width="73%" height="6%" layer="2">
<drawtext name="eventtime" align="right" y="0" fontsize="{areaheight}*{replaytitlesize}/100" font="{bold}" color="{fontactive}" text= "{eventstart} - {eventstop}" /> <drawtext name="eventtime" align="right" y="0" fontsize="{areaheight}*{replaytitlesize}/100" font="{bold}" color="{fontactive}" text= "{eventstart} - {eventstop}" />
<drawtext name="title" x="0" y="0" width="{areawidth} - {width(eventtime)} - 2" fontsize="{areaheight}*{replaytitlesize}/100" font="{regular}" color="{fontdefault}" text="{rectitle}" /> <drawtext name="title" x="0" y="0" width="{areawidth} - {width(eventtime)} - 2" fontsize="{areaheight}*{replaytitlesize}/100" font="{regular}" color="{fontdefault}" text="{rectitle}" />
<drawtext condition="isset{title} ++ isset{recsubtitle}" x="{width(title)}" y="0" width="{areawidth} - {width(title)} - {width(eventtime)} - 2" fontsize="{areaheight}*{replaytitlesize}/100" font="{regular}" color="{fontdefault}" text=" - {recsubtitle}" /> <drawtext condition="isset{title} ++ isset{recsubtitle}" x="{width(title)}" y="0" width="{areawidth} - {width(title)} - {width(eventtime)} - 2" fontsize="{areaheight}*{replaytitlesize}/100" font="{regular}" color="{fontdefault}" text=" - {recsubtitle}" />
@ -73,29 +73,46 @@
</recinfo> </recinfo>
<currenttime> <currenttime>
<area x="12%" y="86%" width="15%" height="5%" layer="2"> <area condition="not{timeshift}" x="12%" y="87%" width="15%" height="5%" layer="2">
<drawtext x="0" y="0" fontsize="{areaheight}*{replaycurrenttotaltimesize}/100" font="{regular}" color="{fontdefault}" text="{reccurrent}" /> <drawtext x="0" y="0" fontsize="{areaheight}*{replaycurrenttotaltimesize}/100" font="{regular}" color="{fontdefault}" text="{reccurrent}" />
</area> </area>
<area condition="{timeshift}" x="12%" y="90%" width="15%" height="5%" layer="2">
<drawtext x="0" y="0" fontsize="{areaheight}*{replaycurrenttotaltimesize}/100" font="{regular}" color="{fontdefault}" text="({reccurrent})" />
</area>
</currenttime> </currenttime>
<totaltime> <totaltime>
<area x="80%" y="86%" width="19%" height="5%" layer="2"> <area condition="not{timeshift}" x="80%" y="87%" width="19%" height="5%" layer="2">
<drawtext condition="not{timeshift}" align="right" y="0" fontsize="{areaheight}*{replaycurrenttotaltimesize}/100" font="{regular}" color="{fontdefault}" text="{rectotal}" /> <drawtext align="right" y="0" fontsize="{areaheight}*{replaycurrenttotaltimesize}/100" font="{regular}" color="{fontdefault}" text="{rectotal}" />
<drawtext condition="{timeshift}" align="right" y="0" font="{regular}" fontsize="{areaheight}*{replaycurrenttotaltimesize}/100" color="{fontdefault}" text="{timeshifttotal} ({rectotal})" /> </area>
<area condition="{timeshift}" x="80%" y="90%" width="19%" height="5%" layer="2">
<drawtext align="right" y="0" font="{regular}" fontsize="{areaheight}*{replaycurrenttotaltimesize}/100" color="{fontdefault}" text="{timeshifttotal} ({rectotal})" />
</area> </area>
</totaltime> </totaltime>
<timeshifttimes>
<area condition="{timeshift}" x="12%" y="81%" width="19%" height="5%" layer="2">
<drawtext align="left" y="0" fontsize="{areaheight}*{replayendtimesize}/100" font="{regular}" color="{fontdefault}" text="{tr(start)}: {recstart}" />
</area>
<area condition="{timeshift}" x="40%" y="81%" width="20%" height="5%" layer="2">
<drawtext name="rest" align="center" y="0" fontsize="{areaheight}*{replayendtimesize}/100" font="{regular}" color="{fontdefault}" text="TS {tr(rest)}: -{timeshiftrest}" />
</area>
<area condition="{timeshift}" x="12%" y="87%" width="19%" height="5%" layer="2">
<drawtext align="left" y="0" fontsize="{areaheight}*{replayendtimesize}/100" font="{regular}" color="{fontdefault}" text="{tr(playback)}: {playbacktime}" />
</area>
</timeshifttimes>
<endtime> <endtime>
<area x="80%" y="90%" width="19%" height="5%" layer="2"> <area condition="{timeshift}" x="80%" y="87%" width="19%" height="5%" layer="2">
<drawtext align="right" y="0" fontsize="{areaheight}*{replayendtimesize}/100" font="{regular}" color="{fontdefault}" text="{tr(end)}: {recend}" /> <drawtext align="right" y="0" fontsize="{areaheight}*{replayendtimesize}/100" font="{regular}" color="{fontdefault}" text="{tr(end)}: {recend}" />
</area> </area>
</endtime> </endtime>
<progressbar> <progressbar>
<area background="true" x="12%" y="83%" width="87%" height="3%" layer="2"> <area background="true" x="12%" y="84%" width="87%" height="3%" layer="2">
<fill color="{progressbarback}" /> <fill color="{progressbarback}" />
</area> </area>
<area x="12%" y="83%" width="87%" height="3%" layer="3"> <area x="12%" y="84%" width="87%" height="3%" layer="3">
<drawrectangle condition="not{timeshift}" x="0" y="0" width="{areawidth}*{current}/{total}" height="100%" color="{progressbar}" /> <drawrectangle condition="not{timeshift}" x="0" y="0" width="{areawidth}*{current}/{total}" height="100%" color="{progressbar}" />
<drawrectangle condition="{timeshift}" x="0" y="{areaheight}*0.2" width="{total}/{timeshifttotal}*{areawidth}" height="{areaheight}*0.6" color="{progressbartimeshift}" /> <drawrectangle condition="{timeshift}" x="0" y="{areaheight}*0.2" width="{total}/{timeshifttotal}*{areawidth}" height="{areaheight}*0.6" color="{progressbartimeshift}" />
<drawrectangle condition="{timeshift}" x="0" y="0" width="{current}/{timeshifttotal}*{areawidth}" height="{areaheight}" color="{progressbar}" /> <drawrectangle condition="{timeshift}" x="0" y="0" width="{current}/{timeshifttotal}*{areawidth}" height="{areaheight}" color="{progressbar}" />
@ -103,7 +120,7 @@
</progressbar> </progressbar>
<cutmarks> <cutmarks>
<area condition="not{timeshift}" x="12%" y="83%" width="87%" height="3%" layer="4"> <area condition="not{timeshift}" x="12%" y="84%" width="87%" height="3%" layer="4">
<loop name="marks" x="0" y="0" orientation="absolute"> <loop name="marks" x="0" y="0" orientation="absolute">
<!-- draw mark --> <!-- draw mark -->
<drawrectangle x="{marks[position]}/{marks[total]}*{areawidth}-2" y="0" width="4" height="100%" color="{cutmark}" /> <drawrectangle x="{marks[position]}/{marks[total]}*{areawidth}-2" y="0" width="4" height="100%" color="{cutmark}" />
@ -115,6 +132,18 @@
<drawrectangle condition="{marks[startmark]}" x="{marks[position]}/{marks[total]}*{areawidth}" y="30%" width="{marks[endposition]}/{marks[total]}*{areawidth} - {marks[position]}/{marks[total]}*{areawidth}" height="40%" color="{cutmark}" /> <drawrectangle condition="{marks[startmark]}" x="{marks[position]}/{marks[total]}*{areawidth}" y="30%" width="{marks[endposition]}/{marks[total]}*{areawidth} - {marks[position]}/{marks[total]}*{areawidth}" height="40%" color="{cutmark}" />
</loop> </loop>
</area> </area>
<area condition="{timeshift}" x="12%" y="84%" width="87%" height="3%" layer="4">
<loop name="marks" x="0" y="0" orientation="absolute">
<!-- draw mark -->
<drawrectangle x="{marks[position]}/{marks[timeshifttotal]}*{areawidth}-2" y="0" width="4" height="100%" color="{cutmark}" />
<drawrectangle condition="{marks[startmark]}" x="{marks[position]}/{marks[timeshifttotal]}*{areawidth}" y="0" width="5" height="2" color="{cutmark}" />
<drawrectangle condition="{marks[startmark]}" x="{marks[position]}/{marks[timeshifttotal]}*{areawidth}" y="{areaheight}-2" width="5" height="2" color="{cutmark}" />
<drawrectangle condition="not{marks[startmark]}" x="{marks[position]}/{marks[timeshifttotal]}*{areawidth}-5" y="0" width="5" height="2" color="{cutmark}" />
<drawrectangle condition="not{marks[startmark]}" x="{marks[position]}/{marks[timeshifttotal]}*{areawidth}-5" y="{areaheight}-2" width="5" height="2" color="{cutmark}" />
<!-- draw bar to next mark if mark is startmark-->
<drawrectangle condition="{marks[startmark]}" x="{marks[position]}/{marks[timeshifttotal]}*{areawidth}" y="30%" width="{marks[endposition]}/{marks[timeshifttotal]}*{areawidth} - {marks[position]}/{marks[timeshifttotal]}*{areawidth}" height="40%" color="{cutmark}" />
</loop>
</area>
</cutmarks> </cutmarks>
<controlicons> <controlicons>

View File

@ -76,7 +76,8 @@
</recinfo> </recinfo>
<!-- Available Variables currenttime: <!-- Available Variables currenttime:
{reccurrent} Current Time in hh:mm:ss {reccurrent} Current Time in hh:mm:ss
{timeshift} true if a timeshifted recording is displayed
--> -->
<currenttime> <currenttime>
</currenttime> </currenttime>
@ -89,8 +90,18 @@
<totaltime> <totaltime>
</totaltime> </totaltime>
<!-- Available Variables timeshifttimes:
{recstart} Start Time in hh:mm
{playbacktime} actual replaying time in timeshift mode in hh:mm
{timeshiftrest} Rest of unseen timeshift buffer in hh:mm
{timeshift} true if a timeshifted recording is displayed
-->
<timeshifttimes>
</timeshifttimes>
<!-- Available Variables endtime: <!-- Available Variables endtime:
{recend} End Time in hh:mm {recend} End Time in hh:mm
{timeshift} true if a timeshifted recording is displayed
--> -->
<endtime> <endtime>
</endtime> </endtime>