mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
Eliminate a look sequence report in displayreplay
This commit is contained in:
parent
9278f18cb9
commit
8a04a17fc0
@ -157,6 +157,8 @@ void cViewReplay::ClearVariables(void) {
|
|||||||
veEndTime->Set(cString(""));
|
veEndTime->Set(cString(""));
|
||||||
if (veCutMarks)
|
if (veCutMarks)
|
||||||
veCutMarks->Reset();
|
veCutMarks->Reset();
|
||||||
|
timersLoaded = false;
|
||||||
|
globalTimers.ClearTimers();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cViewReplay::SetTimeShift(int framesTotal, int timeShiftLength) {
|
void cViewReplay::SetTimeShift(int framesTotal, int timeShiftLength) {
|
||||||
@ -180,6 +182,44 @@ void cViewReplay::SetRecording(const cRecording *recording) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cViewReplay::GetTimers(void) {
|
||||||
|
if (!timersLoaded) {
|
||||||
|
timersLoaded = true;
|
||||||
|
globalTimers.LoadTimers();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void cViewReplay::SetTimeShiftValues(const cRecording *recording) {
|
||||||
|
//check for instant recording
|
||||||
|
const char *recName = recording->Name();
|
||||||
|
if (recName && *recName == '@')
|
||||||
|
return;
|
||||||
|
bool isTimeShift = false;
|
||||||
|
#if APIVERSNUM >= 20101
|
||||||
|
int usage = recording->IsInUse();
|
||||||
|
if (usage & ruTimer)
|
||||||
|
isTimeShift = true;
|
||||||
|
else {
|
||||||
|
if (globalTimers.IsRecording(recording))
|
||||||
|
isTimeShift = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (!isTimeShift)
|
||||||
|
return;
|
||||||
|
const cRecordingInfo *recInfo = recording->Info();
|
||||||
|
if (!recInfo)
|
||||||
|
return;
|
||||||
|
const cEvent *event = recInfo->GetEvent();
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
void cViewReplay::SetTitle(const char *title) {
|
void cViewReplay::SetTitle(const char *title) {
|
||||||
if (veRecTitle) {
|
if (veRecTitle) {
|
||||||
veRecTitle->Set(title);
|
veRecTitle->Set(title);
|
||||||
|
@ -30,6 +30,8 @@ private:
|
|||||||
int timeShiftFramesTotal;
|
int timeShiftFramesTotal;
|
||||||
int timeShiftLength;
|
int timeShiftLength;
|
||||||
cString timeShiftDuration;
|
cString timeShiftDuration;
|
||||||
|
bool timersLoaded;
|
||||||
|
cGlobalTimers globalTimers;
|
||||||
void SetViewElements(void);
|
void SetViewElements(void);
|
||||||
void ClearVariables(void);
|
void ClearVariables(void);
|
||||||
void SetViewElementObjects(void);
|
void SetViewElementObjects(void);
|
||||||
@ -43,6 +45,8 @@ public:
|
|||||||
void SetTimeShift(int framesTotal, int timeShiftLength);
|
void SetTimeShift(int framesTotal, int timeShiftLength);
|
||||||
void SetRecording(const cRecording *recording);
|
void SetRecording(const cRecording *recording);
|
||||||
void SetTitle(const char *title);
|
void SetTitle(const char *title);
|
||||||
|
void GetTimers(void);
|
||||||
|
void SetTimeShiftValues(const cRecording *recording);
|
||||||
void SetCurrent(const char *current);
|
void SetCurrent(const char *current);
|
||||||
void SetTotal(const char *total);
|
void SetTotal(const char *total);
|
||||||
void SetEndTime(int current, int total);
|
void SetEndTime(int current, int total);
|
||||||
|
@ -18,7 +18,7 @@ void cSDDisplayReplay::SetRecording(const cRecording *Recording) {
|
|||||||
view->SetRecording(Recording);
|
view->SetRecording(Recording);
|
||||||
if (init) {
|
if (init) {
|
||||||
view->SetRecordingLength(Recording->LengthInSeconds());
|
view->SetRecordingLength(Recording->LengthInSeconds());
|
||||||
SetTimeShiftValues(Recording);
|
view->SetTimeShiftValues(Recording);
|
||||||
init = false;
|
init = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -78,38 +78,6 @@ void cSDDisplayReplay::SetMessage(eMessageType Type, const char *Text) {
|
|||||||
void cSDDisplayReplay::Flush(void) {
|
void cSDDisplayReplay::Flush(void) {
|
||||||
if (!ok)
|
if (!ok)
|
||||||
return;
|
return;
|
||||||
|
view->GetTimers();
|
||||||
view->Flush();
|
view->Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cSDDisplayReplay::SetTimeShiftValues(const cRecording *recording) {
|
|
||||||
//check for instant recording
|
|
||||||
const char *recName = recording->Name();
|
|
||||||
if (recName && *recName == '@')
|
|
||||||
return;
|
|
||||||
bool isTimeShift = false;
|
|
||||||
#if APIVERSNUM >= 20101
|
|
||||||
int usage = recording->IsInUse();
|
|
||||||
if (usage & ruTimer)
|
|
||||||
isTimeShift = true;
|
|
||||||
else {
|
|
||||||
cGlobalTimers globalTimers;
|
|
||||||
globalTimers.LoadTimers();
|
|
||||||
if (globalTimers.IsRecording(recording))
|
|
||||||
isTimeShift = true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (!isTimeShift)
|
|
||||||
return;
|
|
||||||
const cRecordingInfo *recInfo = recording->Info();
|
|
||||||
if (!recInfo)
|
|
||||||
return;
|
|
||||||
const cEvent *event = recInfo->GetEvent();
|
|
||||||
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;
|
|
||||||
view->SetTimeShift(framesTotal, recLength);
|
|
||||||
}
|
|
||||||
|
@ -10,7 +10,6 @@ private:
|
|||||||
bool ok;
|
bool ok;
|
||||||
bool init;
|
bool init;
|
||||||
cViewReplay *view;
|
cViewReplay *view;
|
||||||
void SetTimeShiftValues(const cRecording *recording);
|
|
||||||
public:
|
public:
|
||||||
cSDDisplayReplay(cViewReplay *replayView, bool ModeOnly);
|
cSDDisplayReplay(cViewReplay *replayView, bool ModeOnly);
|
||||||
virtual ~cSDDisplayReplay();
|
virtual ~cSDDisplayReplay();
|
||||||
|
Loading…
Reference in New Issue
Block a user