fixed bug that onpause view potentially starts during setting cutting marks

This commit is contained in:
louis 2016-03-22 16:55:46 +01:00
parent 842fc1a254
commit 65b5d74b7a
8 changed files with 44 additions and 4 deletions

View File

@ -11,6 +11,7 @@ cAnimation::cAnimation(cScrollable *scrollable) : cThread("scroller") {
this->shiftable = NULL; this->shiftable = NULL;
this->blinkable = NULL; this->blinkable = NULL;
waitOnWakeup = false; waitOnWakeup = false;
keepSleeping = false;
doAnimation = true; doAnimation = true;
modeIn = false; modeIn = false;
blinkFunc = -1; blinkFunc = -1;
@ -23,6 +24,7 @@ cAnimation::cAnimation(cDetachable *detachable, bool wait, bool animation) : cTh
this->shiftable = NULL; this->shiftable = NULL;
this->blinkable = NULL; this->blinkable = NULL;
waitOnWakeup = wait; waitOnWakeup = wait;
keepSleeping = false;
doAnimation = animation; doAnimation = animation;
modeIn = false; modeIn = false;
blinkFunc = -1; blinkFunc = -1;
@ -35,6 +37,7 @@ cAnimation::cAnimation(cFadable *fadable, bool fadein) : cThread("fadable") {
this->shiftable = NULL; this->shiftable = NULL;
this->blinkable = NULL; this->blinkable = NULL;
waitOnWakeup = false; waitOnWakeup = false;
keepSleeping = false;
doAnimation = true; doAnimation = true;
modeIn = fadein; modeIn = fadein;
blinkFunc = -1; blinkFunc = -1;
@ -47,6 +50,7 @@ cAnimation::cAnimation(cShiftable *shiftable, cPoint &start, cPoint &end, bool s
this->shiftable = shiftable; this->shiftable = shiftable;
this->blinkable = NULL; this->blinkable = NULL;
waitOnWakeup = false; waitOnWakeup = false;
keepSleeping = false;
doAnimation = true; doAnimation = true;
modeIn = shiftin; modeIn = shiftin;
shiftstart = start; shiftstart = start;
@ -61,6 +65,7 @@ cAnimation::cAnimation(cBlinkable *blinkable, int func) : cThread("blinking") {
this->shiftable = NULL; this->shiftable = NULL;
this->blinkable = blinkable; this->blinkable = blinkable;
waitOnWakeup = false; waitOnWakeup = false;
keepSleeping = false;
doAnimation = true; doAnimation = true;
modeIn = false; modeIn = false;
blinkFunc = func; blinkFunc = func;
@ -75,6 +80,11 @@ void cAnimation::WakeUp(void) {
sleepWait.Signal(); sleepWait.Signal();
} }
void cAnimation::ResetSleep(void) {
keepSleeping = true;
sleepWait.Signal();
}
void cAnimation::Stop(bool deletePixmaps) { void cAnimation::Stop(bool deletePixmaps) {
sleepWait.Signal(); sleepWait.Signal();
Cancel(2); Cancel(2);
@ -100,7 +110,10 @@ void cAnimation::Sleep(int duration) {
//sleep should wake up itself, so no infinit wait allowed //sleep should wake up itself, so no infinit wait allowed
if (duration <= 0) if (duration <= 0)
return; return;
sleepWait.Wait(duration); do {
keepSleeping = false;
sleepWait.Wait(duration);
} while (keepSleeping);
} }
void cAnimation::Wait(void) { void cAnimation::Wait(void) {

View File

@ -98,6 +98,7 @@ private:
cShiftable *shiftable; cShiftable *shiftable;
cBlinkable *blinkable; cBlinkable *blinkable;
bool waitOnWakeup; bool waitOnWakeup;
bool keepSleeping;
bool doAnimation; bool doAnimation;
bool modeIn; bool modeIn;
int blinkFunc; int blinkFunc;
@ -118,6 +119,7 @@ public:
cAnimation(cBlinkable *blinkable, int func); cAnimation(cBlinkable *blinkable, int func);
~cAnimation(void); ~cAnimation(void);
void WakeUp(void); void WakeUp(void);
void ResetSleep(void);
void Fade(void); void Fade(void);
void Shift(void); void Shift(void);
void Stop(bool deletePixmaps); void Stop(bool deletePixmaps);

View File

@ -268,6 +268,12 @@ void cViewReplay::ClearOnPause(void) {
onPause->Close(); onPause->Close();
} }
void cViewReplay::DelayOnPause(void) {
if (!veOnPause->Started())
return;
veOnPause->ResetSleep();
}
void cViewReplay::Flush(void) { void cViewReplay::Flush(void) {
if (init) { if (init) {
sdOsd.LockFlush(); sdOsd.LockFlush();
@ -284,7 +290,7 @@ void cViewReplay::Flush(void) {
} }
time_t now = time(0); time_t now = time(0);
if (now != lastFlush) { if (!modeOnly && (now != lastFlush)) {
Render((int)eVeDisplayReplay::datetime); Render((int)eVeDisplayReplay::datetime);
Render((int)eVeDisplayReplay::time); Render((int)eVeDisplayReplay::time);
Render((int)eVeDisplayChannel::customtokens); Render((int)eVeDisplayChannel::customtokens);

View File

@ -52,6 +52,7 @@ public:
void SetMessage(eMessageType type, const char *text); void SetMessage(eMessageType type, const char *text);
void StartOnPause(const char *recfilename); void StartOnPause(const char *recfilename);
void ClearOnPause(void); void ClearOnPause(void);
void DelayOnPause(void);
void Flush(void); void Flush(void);
}; };

View File

@ -601,6 +601,7 @@ bool cVeDrJump::Parse(bool force) {
* cVeDrOnPause * cVeDrOnPause
******************************************************************/ ******************************************************************/
cVeDrOnPause::cVeDrOnPause(void) { cVeDrOnPause::cVeDrOnPause(void) {
started = false;
actorsIndex = -1; actorsIndex = -1;
recfilename = NULL; recfilename = NULL;
} }
@ -609,6 +610,11 @@ cVeDrOnPause::~cVeDrOnPause(void) {
free(recfilename); free(recfilename);
} }
void cVeDrOnPause::Close(void) {
started = false;
cViewElement::Close();
}
void cVeDrOnPause::SetTokenContainer(void) { void cVeDrOnPause::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer(); tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{name}", (int)eDROnpauseST::name); tokenContainer->DefineStringToken("{name}", (int)eDROnpauseST::name);
@ -716,6 +722,7 @@ void cVeDrOnPause::Set(const char *recfilename) {
return; return;
free(this->recfilename); free(this->recfilename);
this->recfilename = strdup(recfilename); this->recfilename = strdup(recfilename);
started = true;
} }
bool cVeDrOnPause::Parse(bool force) { bool cVeDrOnPause::Parse(bool force) {
@ -774,6 +781,12 @@ bool cVeDrOnPause::Parse(bool force) {
return true; return true;
} }
void cVeDrOnPause::ResetSleep(void) {
if (!detacher)
return;
detacher->ResetSleep();
}
/****************************************************************** /******************************************************************
* cVeDrScraperContent * cVeDrScraperContent
******************************************************************/ ******************************************************************/

View File

@ -178,15 +178,19 @@ public:
******************************************************************/ ******************************************************************/
class cVeDrOnPause : public cViewElement, public cScrapManager { class cVeDrOnPause : public cViewElement, public cScrapManager {
private: private:
bool started;
int actorsIndex; int actorsIndex;
char *recfilename; char *recfilename;
public: public:
cVeDrOnPause(void); cVeDrOnPause(void);
virtual ~cVeDrOnPause(void); virtual ~cVeDrOnPause(void);
void Close(void);
int Delay(void) { return attribs->Delay() * 1000; }; int Delay(void) { return attribs->Delay() * 1000; };
void SetTokenContainer(void); void SetTokenContainer(void);
void Set(const char *recfilename); void Set(const char *recfilename);
bool Parse(bool forced = false); bool Parse(bool forced = false);
bool Started(void) { return started; };
void ResetSleep(void);
}; };
/****************************************************************** /******************************************************************

View File

@ -51,6 +51,7 @@ void cSDDisplayReplay::SetProgress(int Current, int Total) {
view->SetProgressbar(Current, Total); view->SetProgressbar(Current, Total);
view->SetMarks(marks, Current, Total); view->SetMarks(marks, Current, Total);
view->SetEndTime(Current, Total); view->SetEndTime(Current, Total);
view->DelayOnPause();
} }
} }

View File

@ -189,10 +189,10 @@
</onpause> </onpause>
<onpausemodeonly delay="20" fadetime="{fadetime}"> <onpausemodeonly delay="20" fadetime="{fadetime}">
<area x="0" y="0" width="100%" height="100%" layer="7"> <area x="0" y="0" width="100%" height="100%" layer="6">
<fill color="{clrSemiTransBlack}" /> <fill color="{clrSemiTransBlack}" />
</area> </area>
<area x="0" y="0" width="100%" height="100%" layer="6"> <area x="0" y="0" width="100%" height="100%" layer="7">
<drawtext align="center" valign="center" font="{semibold}" fontsize="25%" color="{clrWhite}" text="{tr(pause)}" /> <drawtext align="center" valign="center" font="{semibold}" fontsize="25%" color="{clrWhite}" text="{tr(pause)}" />
<drawimage condition="{isseries}" imagetype="image" path="{seriesbanner1path}" align="center" y="10" width="{areawidth}*0.5" height="{areawidth} * 0.5 * {seriesbanner1height} / {seriesbanner1width}"/> <drawimage condition="{isseries}" imagetype="image" path="{seriesbanner1path}" align="center" y="10" width="{areawidth}*0.5" height="{areawidth} * 0.5 * {seriesbanner1height} / {seriesbanner1width}"/>
<drawimage condition="{ismovie}" imagetype="image" path="{posterpath}" x="10" y="10" width="{areaheight} * 0.4 * {posterwidth} / {posterheight}" height="{areaheight} * 0.4"/> <drawimage condition="{ismovie}" imagetype="image" path="{posterpath}" x="10" y="10" width="{areaheight} * 0.4 * {posterwidth} / {posterheight}" height="{areaheight} * 0.4"/>