mirror of
				https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
				synced 2023-10-19 15:58:31 +00:00 
			
		
		
		
	fixed bug that onpause view potentially starts during setting cutting marks
This commit is contained in:
		@@ -11,6 +11,7 @@ cAnimation::cAnimation(cScrollable *scrollable) : cThread("scroller") {
 | 
			
		||||
    this->shiftable = NULL;
 | 
			
		||||
    this->blinkable = NULL;
 | 
			
		||||
    waitOnWakeup = false;
 | 
			
		||||
    keepSleeping = false;
 | 
			
		||||
    doAnimation = true;
 | 
			
		||||
    modeIn = false;
 | 
			
		||||
    blinkFunc = -1;
 | 
			
		||||
@@ -23,6 +24,7 @@ cAnimation::cAnimation(cDetachable *detachable, bool wait, bool animation) : cTh
 | 
			
		||||
    this->shiftable = NULL;
 | 
			
		||||
    this->blinkable = NULL;
 | 
			
		||||
    waitOnWakeup = wait;
 | 
			
		||||
    keepSleeping = false;
 | 
			
		||||
    doAnimation = animation;
 | 
			
		||||
    modeIn = false;
 | 
			
		||||
    blinkFunc = -1;
 | 
			
		||||
@@ -35,6 +37,7 @@ cAnimation::cAnimation(cFadable *fadable, bool fadein) : cThread("fadable") {
 | 
			
		||||
    this->shiftable = NULL;
 | 
			
		||||
    this->blinkable = NULL;
 | 
			
		||||
    waitOnWakeup = false;
 | 
			
		||||
    keepSleeping = false;
 | 
			
		||||
    doAnimation = true;
 | 
			
		||||
    modeIn = fadein;
 | 
			
		||||
    blinkFunc = -1;
 | 
			
		||||
@@ -47,6 +50,7 @@ cAnimation::cAnimation(cShiftable *shiftable, cPoint &start, cPoint &end, bool s
 | 
			
		||||
    this->shiftable = shiftable;
 | 
			
		||||
    this->blinkable = NULL;
 | 
			
		||||
    waitOnWakeup = false;
 | 
			
		||||
    keepSleeping = false;
 | 
			
		||||
    doAnimation = true;
 | 
			
		||||
    modeIn = shiftin;
 | 
			
		||||
    shiftstart = start;
 | 
			
		||||
@@ -61,6 +65,7 @@ cAnimation::cAnimation(cBlinkable *blinkable, int func) : cThread("blinking") {
 | 
			
		||||
    this->shiftable = NULL;
 | 
			
		||||
    this->blinkable = blinkable;
 | 
			
		||||
    waitOnWakeup = false;
 | 
			
		||||
    keepSleeping = false;
 | 
			
		||||
    doAnimation = true;
 | 
			
		||||
    modeIn = false;
 | 
			
		||||
    blinkFunc = func;
 | 
			
		||||
@@ -75,6 +80,11 @@ void cAnimation::WakeUp(void) {
 | 
			
		||||
    sleepWait.Signal();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void cAnimation::ResetSleep(void) {
 | 
			
		||||
    keepSleeping = true;
 | 
			
		||||
    sleepWait.Signal();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void cAnimation::Stop(bool deletePixmaps) { 
 | 
			
		||||
    sleepWait.Signal();
 | 
			
		||||
    Cancel(2);
 | 
			
		||||
@@ -100,7 +110,10 @@ void cAnimation::Sleep(int duration) {
 | 
			
		||||
    //sleep should wake up itself, so no infinit wait allowed
 | 
			
		||||
    if (duration <= 0)
 | 
			
		||||
        return;
 | 
			
		||||
    do {
 | 
			
		||||
        keepSleeping = false;
 | 
			
		||||
        sleepWait.Wait(duration);
 | 
			
		||||
    } while (keepSleeping);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void cAnimation::Wait(void) {
 | 
			
		||||
 
 | 
			
		||||
@@ -98,6 +98,7 @@ private:
 | 
			
		||||
    cShiftable  *shiftable;
 | 
			
		||||
    cBlinkable  *blinkable;
 | 
			
		||||
    bool waitOnWakeup;
 | 
			
		||||
    bool keepSleeping;
 | 
			
		||||
    bool doAnimation;
 | 
			
		||||
    bool modeIn;
 | 
			
		||||
    int blinkFunc;
 | 
			
		||||
@@ -118,6 +119,7 @@ public:
 | 
			
		||||
    cAnimation(cBlinkable  *blinkable, int func);
 | 
			
		||||
    ~cAnimation(void);
 | 
			
		||||
    void WakeUp(void);
 | 
			
		||||
    void ResetSleep(void);
 | 
			
		||||
    void Fade(void);
 | 
			
		||||
    void Shift(void);
 | 
			
		||||
    void Stop(bool deletePixmaps);
 | 
			
		||||
 
 | 
			
		||||
@@ -268,6 +268,12 @@ void cViewReplay::ClearOnPause(void) {
 | 
			
		||||
    onPause->Close();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void cViewReplay::DelayOnPause(void) {
 | 
			
		||||
    if (!veOnPause->Started())
 | 
			
		||||
        return;
 | 
			
		||||
    veOnPause->ResetSleep();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void cViewReplay::Flush(void) {
 | 
			
		||||
    if (init) {
 | 
			
		||||
        sdOsd.LockFlush();
 | 
			
		||||
@@ -284,7 +290,7 @@ void cViewReplay::Flush(void) {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    time_t now = time(0);
 | 
			
		||||
    if (now != lastFlush) {
 | 
			
		||||
    if (!modeOnly && (now != lastFlush)) {
 | 
			
		||||
        Render((int)eVeDisplayReplay::datetime);
 | 
			
		||||
        Render((int)eVeDisplayReplay::time);
 | 
			
		||||
        Render((int)eVeDisplayChannel::customtokens);
 | 
			
		||||
 
 | 
			
		||||
@@ -52,6 +52,7 @@ public:
 | 
			
		||||
    void SetMessage(eMessageType type, const char *text);
 | 
			
		||||
    void StartOnPause(const char *recfilename);
 | 
			
		||||
    void ClearOnPause(void);
 | 
			
		||||
    void DelayOnPause(void);
 | 
			
		||||
    void Flush(void);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -601,6 +601,7 @@ bool cVeDrJump::Parse(bool force) {
 | 
			
		||||
* cVeDrOnPause
 | 
			
		||||
******************************************************************/
 | 
			
		||||
cVeDrOnPause::cVeDrOnPause(void) {
 | 
			
		||||
    started = false;
 | 
			
		||||
    actorsIndex = -1;
 | 
			
		||||
    recfilename = NULL;
 | 
			
		||||
}
 | 
			
		||||
@@ -609,6 +610,11 @@ cVeDrOnPause::~cVeDrOnPause(void) {
 | 
			
		||||
    free(recfilename);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void cVeDrOnPause::Close(void) {
 | 
			
		||||
    started = false;
 | 
			
		||||
    cViewElement::Close();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void cVeDrOnPause::SetTokenContainer(void) {
 | 
			
		||||
    tokenContainer = new skindesignerapi::cTokenContainer();
 | 
			
		||||
    tokenContainer->DefineStringToken("{name}", (int)eDROnpauseST::name);
 | 
			
		||||
@@ -716,6 +722,7 @@ void cVeDrOnPause::Set(const char *recfilename) {
 | 
			
		||||
        return;
 | 
			
		||||
    free(this->recfilename);
 | 
			
		||||
    this->recfilename = strdup(recfilename);
 | 
			
		||||
    started = true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool cVeDrOnPause::Parse(bool force) {
 | 
			
		||||
@@ -774,6 +781,12 @@ bool cVeDrOnPause::Parse(bool force) {
 | 
			
		||||
    return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void cVeDrOnPause::ResetSleep(void) {
 | 
			
		||||
    if (!detacher)
 | 
			
		||||
        return;
 | 
			
		||||
    detacher->ResetSleep();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/******************************************************************
 | 
			
		||||
* cVeDrScraperContent
 | 
			
		||||
******************************************************************/
 | 
			
		||||
 
 | 
			
		||||
@@ -178,15 +178,19 @@ public:
 | 
			
		||||
******************************************************************/
 | 
			
		||||
class cVeDrOnPause : public cViewElement, public cScrapManager {
 | 
			
		||||
private:
 | 
			
		||||
    bool started;
 | 
			
		||||
    int actorsIndex;
 | 
			
		||||
    char *recfilename;
 | 
			
		||||
public:
 | 
			
		||||
    cVeDrOnPause(void);
 | 
			
		||||
    virtual ~cVeDrOnPause(void);
 | 
			
		||||
    void Close(void);
 | 
			
		||||
    int Delay(void) { return attribs->Delay() * 1000; };
 | 
			
		||||
    void SetTokenContainer(void);
 | 
			
		||||
    void Set(const char *recfilename);
 | 
			
		||||
    bool Parse(bool forced = false);
 | 
			
		||||
    bool Started(void) { return started; };
 | 
			
		||||
    void ResetSleep(void);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/******************************************************************
 | 
			
		||||
 
 | 
			
		||||
@@ -51,6 +51,7 @@ void cSDDisplayReplay::SetProgress(int Current, int Total) {
 | 
			
		||||
        view->SetProgressbar(Current, Total);
 | 
			
		||||
        view->SetMarks(marks, Current, Total);
 | 
			
		||||
        view->SetEndTime(Current, Total);
 | 
			
		||||
        view->DelayOnPause();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -189,10 +189,10 @@
 | 
			
		||||
    </onpause>
 | 
			
		||||
 | 
			
		||||
    <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}" />
 | 
			
		||||
        </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)}" />
 | 
			
		||||
            <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"/>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user