mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
fixed bug that onpause view potentially starts during setting cutting marks
This commit is contained in:
parent
48afaeed63
commit
cacde1887c
3
HISTORY
3
HISTORY
@ -172,3 +172,6 @@ Version 0.1.5
|
||||
additional skin caching at startup
|
||||
|
||||
Version 0.1.6
|
||||
|
||||
- fixed bug that onpause view potentially starts during setting cutting
|
||||
marks
|
||||
|
@ -16,7 +16,6 @@ cSDDisplayReplay::cSDDisplayReplay(cTemplate *replayTemplate, bool ModeOnly) {
|
||||
doOutput = false;
|
||||
return;
|
||||
}
|
||||
replayView->DrawBackground(modeOnly);
|
||||
}
|
||||
|
||||
cSDDisplayReplay::~cSDDisplayReplay() {
|
||||
@ -46,6 +45,7 @@ void cSDDisplayReplay::SetMode(bool Play, bool Forward, int Speed) {
|
||||
void cSDDisplayReplay::SetProgress(int Current, int Total) {
|
||||
if (!doOutput)
|
||||
return;
|
||||
replayView->DelayOnPause();
|
||||
replayView->DrawProgressBar(Current, Total);
|
||||
replayView->DrawMarks(marks, Current, Total);
|
||||
}
|
||||
@ -83,6 +83,7 @@ void cSDDisplayReplay::Flush(void) {
|
||||
}
|
||||
|
||||
if (initial) {
|
||||
replayView->DrawBackground(modeOnly);
|
||||
replayView->DrawCustomTokens();
|
||||
replayView->DoFadeIn();
|
||||
initial = false;
|
||||
|
@ -6,6 +6,7 @@ cDisplayReplayOnPauseView::cDisplayReplayOnPauseView(cTemplateViewElement *tmplV
|
||||
tmplViewElement->SetPixOffset(0);
|
||||
delay = tmplViewElement->GetNumericParameter(ptDelay) * 1000;
|
||||
SetFadeTime(tmplViewElement->GetNumericParameter(ptFadeTime));
|
||||
resetSleep = false;
|
||||
}
|
||||
|
||||
cDisplayReplayOnPauseView::~cDisplayReplayOnPauseView() {
|
||||
@ -83,7 +84,20 @@ void cDisplayReplayOnPauseView::Render(void) {
|
||||
}
|
||||
|
||||
void cDisplayReplayOnPauseView::Action(void) {
|
||||
DoSleep(delay);
|
||||
bool doContinue;
|
||||
int sleepSlice = 10;
|
||||
do {
|
||||
doContinue = false;
|
||||
for (int i = 0; Running() && (i*sleepSlice < delay); i++) {
|
||||
cCondWait::SleepMs(sleepSlice);
|
||||
if (resetSleep) {
|
||||
doContinue = true;
|
||||
resetSleep = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while (doContinue);
|
||||
|
||||
if (!Running())
|
||||
return;
|
||||
Render();
|
||||
|
@ -8,10 +8,12 @@
|
||||
class cDisplayReplayOnPauseView : public cView, public cViewHelpers {
|
||||
private:
|
||||
int delay;
|
||||
bool resetSleep;
|
||||
virtual void Action(void);
|
||||
public:
|
||||
cDisplayReplayOnPauseView(cTemplateViewElement *tmplViewElement);
|
||||
virtual ~cDisplayReplayOnPauseView();
|
||||
void ResetSleep(void) { resetSleep = true; };
|
||||
void Render(void);
|
||||
void Flush(void) { DoFlush(); };
|
||||
};
|
||||
|
@ -379,6 +379,12 @@ void cDisplayReplayView::ClearOnPause(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void cDisplayReplayView::DelayOnPause(void) {
|
||||
if (onPauseView) {
|
||||
onPauseView->ResetSleep();
|
||||
}
|
||||
}
|
||||
|
||||
void cDisplayReplayView::DrawCustomTokens(void) {
|
||||
if (!ViewElementImplemented(veCustomTokens)) {
|
||||
return;
|
||||
|
@ -33,6 +33,7 @@ public:
|
||||
void DrawMessage(eMessageType type, const char *text);
|
||||
void DrawOnPause(bool modeOnly);
|
||||
void ClearOnPause(void);
|
||||
void DelayOnPause(void);
|
||||
void DrawCustomTokens(void);
|
||||
void DoFadeIn(void) { Start(); };
|
||||
void Flush(void) { DoFlush(); };
|
||||
|
Loading…
Reference in New Issue
Block a user