2016-02-06 09:55:15 +01:00
|
|
|
#include "viewdisplayreplay.h"
|
|
|
|
|
|
|
|
/************************************************************************************
|
|
|
|
* cViewReplay
|
|
|
|
************************************************************************************/
|
|
|
|
|
|
|
|
cViewReplay::cViewReplay(void) {
|
|
|
|
veCustomTokens = NULL;
|
2021-02-12 15:20:34 +01:00
|
|
|
veTimeshiftTimes = NULL;
|
2016-02-06 09:55:15 +01:00
|
|
|
veEndTime = NULL;
|
|
|
|
veMessage = NULL;
|
|
|
|
veScraperContent = NULL;
|
|
|
|
veRecTitle = NULL;
|
|
|
|
veRecInfo = NULL;
|
|
|
|
veCurrentTime = NULL;
|
|
|
|
veTotalTime = NULL;
|
|
|
|
veProgressbar = NULL;
|
|
|
|
veCutMarks = NULL;
|
|
|
|
veProgressModeOnly = NULL;
|
|
|
|
veControlIcons = NULL;
|
|
|
|
veControlIconsModeOnly = NULL;
|
|
|
|
veJump = NULL;
|
|
|
|
veOnPause = NULL;
|
|
|
|
veOnPauseModeOnly = NULL;
|
|
|
|
ClearVariables();
|
|
|
|
viewId = eViewType::DisplayReplay;
|
|
|
|
viewName = strdup("displayreplay");
|
|
|
|
numViewElements = (int)eVeDisplayReplay::count;
|
|
|
|
viewElements = new cViewElement*[numViewElements];
|
|
|
|
for (int i=0; i < numViewElements; i++) {
|
|
|
|
viewElements[i] = NULL;
|
|
|
|
}
|
|
|
|
SetViewElements();
|
|
|
|
}
|
|
|
|
|
|
|
|
cViewReplay::~cViewReplay() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void cViewReplay::SetViewElements(void) {
|
|
|
|
viewElementNames.insert(pair<string, int>("background", (int)eVeDisplayReplay::background));
|
|
|
|
viewElementNames.insert(pair<string, int>("backgroundmodeonly", (int)eVeDisplayReplay::backgroundmodeonly));
|
|
|
|
viewElementNames.insert(pair<string, int>("datetime", (int)eVeDisplayReplay::datetime));
|
|
|
|
viewElementNames.insert(pair<string, int>("time", (int)eVeDisplayReplay::time));
|
|
|
|
viewElementNames.insert(pair<string, int>("scrapercontent", (int)eVeDisplayReplay::scrapercontent));
|
2016-03-20 13:49:17 +01:00
|
|
|
viewElementNames.insert(pair<string, int>("currentweather", (int)eVeDisplayReplay::currentweather));
|
2016-02-06 09:55:15 +01:00
|
|
|
viewElementNames.insert(pair<string, int>("rectitle", (int)eVeDisplayReplay::rectitle));
|
|
|
|
viewElementNames.insert(pair<string, int>("recinfo", (int)eVeDisplayReplay::recinfo));
|
|
|
|
viewElementNames.insert(pair<string, int>("currenttime", (int)eVeDisplayReplay::currenttime));
|
2021-02-12 15:20:34 +01:00
|
|
|
viewElementNames.insert(pair<string, int>("timeshifttimes", (int)eVeDisplayReplay::timeshifttimes));
|
2016-02-06 09:55:15 +01:00
|
|
|
viewElementNames.insert(pair<string, int>("endtime", (int)eVeDisplayReplay::endtime));
|
|
|
|
viewElementNames.insert(pair<string, int>("totaltime", (int)eVeDisplayReplay::totaltime));
|
|
|
|
viewElementNames.insert(pair<string, int>("progressbar", (int)eVeDisplayReplay::progressbar));
|
|
|
|
viewElementNames.insert(pair<string, int>("cutmarks", (int)eVeDisplayReplay::cutmarks));
|
|
|
|
viewElementNames.insert(pair<string, int>("cutmarks", (int)eVeDisplayReplay::cutmarks));
|
|
|
|
viewElementNames.insert(pair<string, int>("controlicons", (int)eVeDisplayReplay::controlicons));
|
|
|
|
viewElementNames.insert(pair<string, int>("controliconsmodeonly", (int)eVeDisplayReplay::controliconsmodeonly));
|
|
|
|
viewElementNames.insert(pair<string, int>("progressmodeonly", (int)eVeDisplayReplay::progressmodeonly));
|
|
|
|
viewElementNames.insert(pair<string, int>("jump", (int)eVeDisplayReplay::jump));
|
|
|
|
viewElementNames.insert(pair<string, int>("message", (int)eVeDisplayReplay::message));
|
|
|
|
viewElementNames.insert(pair<string, int>("onpause", (int)eVeDisplayReplay::onpause));
|
|
|
|
viewElementNames.insert(pair<string, int>("onpausemodeonly", (int)eVeDisplayReplay::onpausemodeonly));
|
|
|
|
viewElementNames.insert(pair<string, int>("customtokens", (int)eVeDisplayReplay::customtokens));
|
|
|
|
}
|
|
|
|
|
|
|
|
void cViewReplay::SetViewElementObjects(void) {
|
|
|
|
for (int i = 0; i < numViewElements; i++) {
|
|
|
|
if (!viewElements[i])
|
|
|
|
continue;
|
|
|
|
if (dynamic_cast<cVeMessage*>(viewElements[i]))
|
|
|
|
{
|
|
|
|
veMessage = dynamic_cast<cVeMessage*>(viewElements[i]);
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<cVeDrScraperContent*>(viewElements[i]))
|
|
|
|
{
|
|
|
|
veScraperContent = dynamic_cast<cVeDrScraperContent*>(viewElements[i]);
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<cVeCustomTokens*>(viewElements[i]))
|
|
|
|
{
|
|
|
|
veCustomTokens = dynamic_cast<cVeCustomTokens*>(viewElements[i]);
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<cVeDrRecTitle*>(viewElements[i]))
|
|
|
|
{
|
|
|
|
veRecTitle = dynamic_cast<cVeDrRecTitle*>(viewElements[i]);
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<cVeDrRecInfo*>(viewElements[i]))
|
|
|
|
{
|
|
|
|
veRecInfo = dynamic_cast<cVeDrRecInfo*>(viewElements[i]);
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<cVeDrCurrentTime*>(viewElements[i]))
|
|
|
|
{
|
|
|
|
veCurrentTime = dynamic_cast<cVeDrCurrentTime*>(viewElements[i]);
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<cVeDrTotalTime*>(viewElements[i]))
|
|
|
|
{
|
|
|
|
veTotalTime = dynamic_cast<cVeDrTotalTime*>(viewElements[i]);
|
|
|
|
}
|
2021-02-12 15:20:34 +01:00
|
|
|
else if (dynamic_cast<cVeDrTimeshiftTimes*>(viewElements[i]))
|
|
|
|
{
|
|
|
|
veTimeshiftTimes = dynamic_cast<cVeDrTimeshiftTimes*>(viewElements[i]);
|
|
|
|
}
|
2016-02-06 09:55:15 +01:00
|
|
|
else if (dynamic_cast<cVeDrEndTime*>(viewElements[i]))
|
|
|
|
{
|
|
|
|
veEndTime = dynamic_cast<cVeDrEndTime*>(viewElements[i]);
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<cVeDrProgressBar*>(viewElements[i]))
|
|
|
|
{
|
|
|
|
veProgressbar = dynamic_cast<cVeDrProgressBar*>(viewElements[i]);
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<cVeDrCutMarks*>(viewElements[i]))
|
|
|
|
{
|
|
|
|
veCutMarks = dynamic_cast<cVeDrCutMarks*>(viewElements[i]);
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<cVeDrProgressModeonly*>(viewElements[i]))
|
|
|
|
{
|
|
|
|
veProgressModeOnly = dynamic_cast<cVeDrProgressModeonly*>(viewElements[i]);
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<cVeDrControlIcons*>(viewElements[i]) && (i == (int)eVeDisplayReplay::controlicons))
|
|
|
|
{
|
|
|
|
veControlIcons = dynamic_cast<cVeDrControlIcons*>(viewElements[i]);
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<cVeDrControlIcons*>(viewElements[i]) && i == (int)eVeDisplayReplay::controliconsmodeonly)
|
|
|
|
{
|
|
|
|
veControlIconsModeOnly = dynamic_cast<cVeDrControlIcons*>(viewElements[i]);
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<cVeDrJump*>(viewElements[i]))
|
|
|
|
{
|
|
|
|
veJump = dynamic_cast<cVeDrJump*>(viewElements[i]);
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<cVeDrOnPause*>(viewElements[i]) && i == (int)eVeDisplayReplay::onpause)
|
|
|
|
{
|
|
|
|
veOnPause = dynamic_cast<cVeDrOnPause*>(viewElements[i]);
|
|
|
|
veOnPause->SetDetached();
|
|
|
|
veOnPause->UnsetWaitOnWakeup();
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<cVeDrOnPause*>(viewElements[i]) && i == (int)eVeDisplayReplay::onpausemodeonly)
|
|
|
|
{
|
|
|
|
veOnPauseModeOnly = dynamic_cast<cVeDrOnPause*>(viewElements[i]);
|
|
|
|
veOnPauseModeOnly->SetDetached();
|
|
|
|
veOnPauseModeOnly->UnsetWaitOnWakeup();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-07-22 15:21:09 +02:00
|
|
|
void cViewReplay::PreCache(void) {
|
|
|
|
cView::PreCache();
|
|
|
|
SetViewelementsAnimOut();
|
|
|
|
}
|
|
|
|
|
2016-02-06 09:55:15 +01:00
|
|
|
void cViewReplay::ClearVariables(void) {
|
|
|
|
cView::ClearVariables();
|
2021-02-08 15:22:40 +01:00
|
|
|
recording = NULL;
|
2021-02-11 16:45:08 +01:00
|
|
|
lastEvent = NULL;
|
2016-02-06 09:55:15 +01:00
|
|
|
modeOnly = false;
|
|
|
|
lastFlush = 0;
|
2016-03-20 13:33:28 +01:00
|
|
|
lastFlushModeOnly = 0;
|
2016-02-06 09:55:15 +01:00
|
|
|
message = false;
|
|
|
|
reclength = -1;
|
|
|
|
timeShiftActive = false;
|
|
|
|
timeShiftFramesTotal = -1;
|
|
|
|
timeShiftLength = -1;
|
|
|
|
timeShiftDuration = "";
|
2021-02-12 15:20:34 +01:00
|
|
|
timeshiftrest = "";
|
2016-02-06 09:55:15 +01:00
|
|
|
if (veCustomTokens)
|
|
|
|
veCustomTokens->Reset();
|
2021-02-12 15:20:34 +01:00
|
|
|
if (veTimeshiftTimes)
|
|
|
|
veTimeshiftTimes->Set(cString(""), cString(""), cString(""));
|
2016-02-06 09:55:15 +01:00
|
|
|
if (veEndTime)
|
|
|
|
veEndTime->Set(cString(""));
|
|
|
|
if (veCutMarks)
|
|
|
|
veCutMarks->Reset();
|
2019-06-21 14:07:00 +02:00
|
|
|
timersLoaded = false;
|
|
|
|
globalTimers.ClearTimers();
|
2016-02-06 09:55:15 +01:00
|
|
|
}
|
|
|
|
|
2021-02-08 10:58:00 +01:00
|
|
|
void cViewReplay::GetGlobalTimers(void) {
|
2019-06-21 14:07:00 +02:00
|
|
|
if (!timersLoaded) {
|
|
|
|
timersLoaded = true;
|
|
|
|
globalTimers.LoadTimers();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-11 16:45:08 +01:00
|
|
|
void cViewReplay::SetTimeShiftValues(int current, int total) {
|
2021-02-01 13:31:08 +01:00
|
|
|
if (!recording)
|
|
|
|
return;
|
2021-02-14 18:23:16 +01:00
|
|
|
const char *recName = recording->Name();
|
|
|
|
if (recName && *recName != '@')
|
|
|
|
return;
|
2021-02-10 16:02:44 +01:00
|
|
|
timeShiftActive = false;
|
2019-06-21 14:07:00 +02:00
|
|
|
#if APIVERSNUM >= 20101
|
|
|
|
int usage = recording->IsInUse();
|
|
|
|
if (usage & ruTimer)
|
2021-02-10 16:02:44 +01:00
|
|
|
timeShiftActive = true;
|
2019-06-21 14:07:00 +02:00
|
|
|
else {
|
2021-02-08 10:58:00 +01:00
|
|
|
GetGlobalTimers();
|
2019-06-21 14:07:00 +02:00
|
|
|
if (globalTimers.IsRecording(recording))
|
2021-02-10 16:02:44 +01:00
|
|
|
timeShiftActive = true;
|
2019-06-21 14:07:00 +02:00
|
|
|
}
|
|
|
|
#endif
|
2021-02-10 16:02:44 +01:00
|
|
|
if (!timeShiftActive)
|
2019-06-21 14:07:00 +02:00
|
|
|
return;
|
|
|
|
const cRecordingInfo *recInfo = recording->Info();
|
|
|
|
if (!recInfo)
|
|
|
|
return;
|
2021-02-10 16:02:44 +01:00
|
|
|
const cSchedule *Schedule = NULL;
|
|
|
|
{
|
|
|
|
LOCK_SCHEDULES_READ;
|
|
|
|
Schedule = Schedules->GetSchedule(recInfo->ChannelID());
|
|
|
|
}
|
|
|
|
if (!Schedule)
|
|
|
|
return;
|
2021-02-11 16:45:08 +01:00
|
|
|
// Get event at actual recording position
|
2021-02-12 15:20:34 +01:00
|
|
|
const cEvent *eventEnde = Schedule->GetEventAround(time(0));
|
2021-02-11 16:45:08 +01:00
|
|
|
if (!eventEnde)
|
2019-06-21 14:07:00 +02:00
|
|
|
return;
|
2021-02-12 15:20:34 +01:00
|
|
|
// End of live program
|
2021-02-11 16:45:08 +01:00
|
|
|
time_t liveEventStop = eventEnde->EndTime();
|
2021-02-12 15:20:34 +01:00
|
|
|
// Begin of timeshift recording
|
2019-06-21 14:07:00 +02:00
|
|
|
time_t recordingStart = time(0) - recording->LengthInSeconds();
|
2021-02-12 15:20:34 +01:00
|
|
|
// actual timeshiftlength
|
2021-02-10 16:02:44 +01:00
|
|
|
timeShiftLength = liveEventStop - recordingStart;
|
2021-02-12 15:20:34 +01:00
|
|
|
// 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);
|
2021-02-11 16:45:08 +01:00
|
|
|
// Display title at replay position
|
|
|
|
if (eventReplay && eventReplay != lastEvent && veRecTitle) {
|
2021-02-12 15:20:34 +01:00
|
|
|
veRecTitle->Set(recording, eventReplay, true);
|
2021-02-11 16:45:08 +01:00
|
|
|
veRecTitle->Parse();
|
|
|
|
lastEvent = eventReplay;
|
|
|
|
}
|
2021-02-10 16:02:44 +01:00
|
|
|
int mins = (timeShiftLength / 60) % 60;
|
|
|
|
int hours = (timeShiftLength / 3600) % 24;
|
|
|
|
timeShiftDuration = cString::sprintf("%d:%02d", hours, mins);
|
2021-02-12 15:20:34 +01:00
|
|
|
mins = (timeShiftSecondsAfter / 60) % 60;
|
|
|
|
hours = (timeShiftSecondsAfter / 3600) % 24;
|
|
|
|
timeshiftrest = cString::sprintf("%d:%02d", hours, mins);
|
2019-06-21 14:07:00 +02:00
|
|
|
}
|
|
|
|
|
2021-02-11 16:45:08 +01:00
|
|
|
void cViewReplay::SetRecording(const cRecording *recording) {
|
|
|
|
this->recording = recording;
|
|
|
|
if (veRecTitle) {
|
|
|
|
veRecTitle->Set(recording);
|
|
|
|
}
|
|
|
|
if (veRecInfo) {
|
|
|
|
veRecInfo->Set(recording);
|
|
|
|
}
|
|
|
|
if (veScraperContent) {
|
|
|
|
veScraperContent->Set(recording);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-06 09:55:15 +01:00
|
|
|
void cViewReplay::SetTitle(const char *title) {
|
|
|
|
if (veRecTitle) {
|
|
|
|
veRecTitle->Set(title);
|
|
|
|
}
|
2021-02-01 13:31:08 +01:00
|
|
|
if (veRecInfo) {
|
|
|
|
veRecInfo->Set(NULL);
|
|
|
|
}
|
|
|
|
if (veScraperContent) {
|
|
|
|
veScraperContent->Set(NULL);
|
|
|
|
}
|
2016-02-06 09:55:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void cViewReplay::SetCurrent(const char *current) {
|
|
|
|
if (veCurrentTime)
|
2021-02-12 15:20:34 +01:00
|
|
|
veCurrentTime->Set(current, timeShiftActive);
|
2016-02-06 09:55:15 +01:00
|
|
|
Render((int)eVeDisplayReplay::currenttime);
|
|
|
|
}
|
|
|
|
|
|
|
|
void cViewReplay::SetTotal(const char *total) {
|
|
|
|
if (veTotalTime)
|
2021-02-12 15:20:34 +01:00
|
|
|
veTotalTime->Set(total, *timeShiftDuration, timeShiftActive);
|
2016-02-06 09:55:15 +01:00
|
|
|
Render((int)eVeDisplayReplay::totaltime);
|
|
|
|
}
|
|
|
|
|
2021-02-12 15:20:34 +01:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2016-02-06 09:55:15 +01:00
|
|
|
void cViewReplay::SetEndTime(int current, int total) {
|
2021-02-01 13:31:08 +01:00
|
|
|
if (!veEndTime || reclength == 0)
|
2016-02-06 09:55:15 +01:00
|
|
|
return;
|
|
|
|
int totalLength = total;
|
|
|
|
int recordingLength = reclength;
|
|
|
|
if (timeShiftActive && timeShiftFramesTotal > 0) {
|
|
|
|
totalLength = timeShiftFramesTotal;
|
|
|
|
recordingLength = timeShiftLength;
|
|
|
|
}
|
|
|
|
double rest = (double)(totalLength - current) / (double)totalLength;
|
2021-02-01 13:31:08 +01:00
|
|
|
time_t end = time(0) + rest * recordingLength;
|
2021-02-12 15:20:34 +01:00
|
|
|
veEndTime->Set(TimeString(end), timeShiftActive);
|
2016-02-06 09:55:15 +01:00
|
|
|
Render((int)eVeDisplayReplay::endtime);
|
|
|
|
}
|
|
|
|
|
|
|
|
void cViewReplay::SetProgressbar(int current, int total) {
|
2021-02-12 15:20:34 +01:00
|
|
|
// SetTimeShiftValues(current, total);
|
2016-02-06 09:55:15 +01:00
|
|
|
if (veProgressbar)
|
|
|
|
veProgressbar->Set(current, total, timeShiftActive, timeShiftFramesTotal);
|
|
|
|
Render((int)eVeDisplayReplay::progressbar);
|
|
|
|
}
|
|
|
|
|
|
|
|
void cViewReplay::SetMarks(const cMarks *marks, int current, int total) {
|
|
|
|
if (veCutMarks)
|
|
|
|
veCutMarks->Set(marks, current, total, timeShiftActive, timeShiftFramesTotal);
|
|
|
|
Render((int)eVeDisplayReplay::cutmarks);
|
|
|
|
}
|
|
|
|
|
|
|
|
void cViewReplay::SetControlIcons(bool play, bool forward, int speed) {
|
|
|
|
if (!modeOnly) {
|
|
|
|
if (veControlIcons)
|
|
|
|
veControlIcons->Set(play, forward, speed);
|
|
|
|
Render((int)eVeDisplayReplay::controlicons);
|
|
|
|
} else {
|
|
|
|
if (veControlIconsModeOnly)
|
|
|
|
veControlIconsModeOnly->Set(play, forward, speed);
|
|
|
|
Render((int)eVeDisplayReplay::controliconsmodeonly);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void cViewReplay::SetJump(const char *jump) {
|
|
|
|
if (veJump) {
|
|
|
|
if (!jump)
|
|
|
|
veJump->Clear();
|
|
|
|
else
|
|
|
|
veJump->Set(jump);
|
|
|
|
}
|
|
|
|
Render((int)eVeDisplayReplay::jump);
|
|
|
|
}
|
|
|
|
|
|
|
|
void cViewReplay::SetMessage(eMessageType type, const char *text) {
|
|
|
|
if (veMessage) {
|
|
|
|
if (text)
|
|
|
|
veMessage->Set(type, text);
|
|
|
|
else
|
|
|
|
veMessage->Clear();
|
|
|
|
}
|
|
|
|
Render((int)eVeDisplayReplay::message);
|
|
|
|
}
|
|
|
|
|
|
|
|
void cViewReplay::StartOnPause(const char *recfilename) {
|
|
|
|
cVeDrOnPause *onPause = (!modeOnly) ? veOnPause : veOnPauseModeOnly;
|
|
|
|
if (!onPause)
|
|
|
|
return;
|
|
|
|
onPause->Set(recfilename);
|
|
|
|
onPause->Parse(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
void cViewReplay::ClearOnPause(void) {
|
|
|
|
cVeDrOnPause *onPause = (!modeOnly) ? veOnPause : veOnPauseModeOnly;
|
|
|
|
if (!onPause)
|
|
|
|
return;
|
|
|
|
onPause->Close();
|
|
|
|
}
|
|
|
|
|
2016-03-22 16:55:46 +01:00
|
|
|
void cViewReplay::DelayOnPause(void) {
|
2016-03-22 22:45:28 +01:00
|
|
|
if (!veOnPause)
|
|
|
|
return;
|
2016-03-22 16:55:46 +01:00
|
|
|
if (!veOnPause->Started())
|
|
|
|
return;
|
|
|
|
veOnPause->ResetSleep();
|
|
|
|
}
|
|
|
|
|
2016-07-22 15:21:09 +02:00
|
|
|
void cViewReplay::Flush(void) {
|
2016-02-06 09:55:15 +01:00
|
|
|
if (init) {
|
|
|
|
if (!modeOnly) {
|
|
|
|
Render((int)eVeDisplayReplay::background);
|
|
|
|
Render((int)eVeDisplayReplay::rectitle);
|
|
|
|
Render((int)eVeDisplayReplay::recinfo);
|
|
|
|
Render((int)eVeDisplayReplay::scrapercontent);
|
2016-03-20 13:49:17 +01:00
|
|
|
Render((int)eVeDisplayReplay::currentweather);
|
2016-02-13 09:46:42 +01:00
|
|
|
Render((int)eVeDisplayReplay::customtokens);
|
2016-02-06 09:55:15 +01:00
|
|
|
} else {
|
|
|
|
Render((int)eVeDisplayReplay::backgroundmodeonly);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-20 13:33:28 +01:00
|
|
|
time_t now = time(0);
|
2016-03-22 16:55:46 +01:00
|
|
|
if (!modeOnly && (now != lastFlush)) {
|
2016-03-20 13:33:28 +01:00
|
|
|
Render((int)eVeDisplayReplay::datetime);
|
|
|
|
Render((int)eVeDisplayReplay::time);
|
|
|
|
Render((int)eVeDisplayChannel::customtokens);
|
|
|
|
lastFlush = now;
|
|
|
|
}
|
|
|
|
|
2016-02-06 09:55:15 +01:00
|
|
|
if (modeOnly) {
|
|
|
|
SetProgressModeOnly();
|
|
|
|
}
|
|
|
|
|
2016-07-22 15:21:09 +02:00
|
|
|
cView::Flush();
|
2016-02-06 09:55:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void cViewReplay::SetProgressModeOnly(void) {
|
|
|
|
if (!veProgressModeOnly)
|
|
|
|
return;
|
|
|
|
time_t now = time(0);
|
2016-03-20 13:33:28 +01:00
|
|
|
if (now == lastFlushModeOnly) {
|
2016-02-06 09:55:15 +01:00
|
|
|
return;
|
|
|
|
}
|
2016-03-20 13:33:28 +01:00
|
|
|
lastFlushModeOnly = now;
|
2016-02-06 09:55:15 +01:00
|
|
|
|
|
|
|
cControl *control = cControl::Control();
|
|
|
|
if (!control)
|
|
|
|
return;
|
|
|
|
double fps = control->FramesPerSecond();
|
|
|
|
int current = 0;
|
|
|
|
int total = 0;
|
|
|
|
if (!control->GetIndex(current, total))
|
|
|
|
return;
|
|
|
|
veProgressModeOnly->Set(fps, current, total);
|
|
|
|
if (veProgressModeOnly->Parse())
|
|
|
|
veProgressModeOnly->Render();
|
2016-07-22 15:21:09 +02:00
|
|
|
}
|