mirror of
				https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
				synced 2023-10-19 15:58:31 +00:00 
			
		
		
		
	fixed blinking for animated views
This commit is contained in:
		
							
								
								
									
										2
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								HISTORY
									
									
									
									
									
								
							@@ -321,3 +321,5 @@ Version 0.4.5
 | 
			
		||||
- fixed bug that detached viewelements were not cleared
 | 
			
		||||
  correctly
 | 
			
		||||
- implemented shiftout for views
 | 
			
		||||
- fixed blinking for animated views
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -344,6 +344,11 @@ void cPixmapContainer::SetDrawPortPoint(int num, const cPoint &Point) {
 | 
			
		||||
*            to ensure that a proper lock is set before accessing pixmaps
 | 
			
		||||
****************************************************************************/
 | 
			
		||||
 | 
			
		||||
int cPixmapContainer::AnimationDelay(void) {
 | 
			
		||||
    int animTime = max(shiftTime, fadeTime);
 | 
			
		||||
    return animTime + 100;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void cPixmapContainer::FadeIn(void) {
 | 
			
		||||
    if (!fadeTime) {
 | 
			
		||||
        for (int i = 0; i < numPixmaps; i++) {
 | 
			
		||||
 
 | 
			
		||||
@@ -72,6 +72,7 @@ protected:
 | 
			
		||||
    void SetShiftMode(int mode) { shiftMode = mode; };
 | 
			
		||||
    void SetStartPos(int posX, int posY) { startPos.SetX(posX); startPos.SetY(posY); };
 | 
			
		||||
    bool IsAnimated(void) { return (shiftTime > 0); };
 | 
			
		||||
    int AnimationDelay(void);
 | 
			
		||||
    void FadeIn(void);
 | 
			
		||||
    void FadeOut(void);
 | 
			
		||||
    void ShiftIn(void);
 | 
			
		||||
 
 | 
			
		||||
@@ -3,6 +3,7 @@
 | 
			
		||||
using namespace std;
 | 
			
		||||
 | 
			
		||||
cAnimation::cAnimation(eAnimType animType, int animFreq, cRect &pos, int layer) : cPixmapContainer(1) {
 | 
			
		||||
    delay = 0;
 | 
			
		||||
    this->animType = animType;
 | 
			
		||||
    this->animFreq = animFreq;
 | 
			
		||||
    this->pos = pos;
 | 
			
		||||
@@ -16,6 +17,7 @@ cAnimation::~cAnimation() {
 | 
			
		||||
void cAnimation::Action(void) {
 | 
			
		||||
    CreatePixmap(0, layer+1, pos);
 | 
			
		||||
    bool init = true;
 | 
			
		||||
    DoSleep(delay);
 | 
			
		||||
    while (Running()) {
 | 
			
		||||
        if (animType == atBlink) {
 | 
			
		||||
            if (!blinkOn) {
 | 
			
		||||
 
 | 
			
		||||
@@ -8,6 +8,7 @@
 | 
			
		||||
using namespace std;
 | 
			
		||||
 | 
			
		||||
class cAnimation : public cPixmapContainer {
 | 
			
		||||
    int delay;
 | 
			
		||||
protected:
 | 
			
		||||
    eAnimType animType;
 | 
			
		||||
    int animFreq;
 | 
			
		||||
@@ -19,7 +20,7 @@ protected:
 | 
			
		||||
public:
 | 
			
		||||
    cAnimation(eAnimType animType, int animFreq, cRect &pos, int layer);
 | 
			
		||||
    virtual ~cAnimation();
 | 
			
		||||
    void SetAnimationFadeTime(int fadeTime) { SetFadeTime(fadeTime); };
 | 
			
		||||
    void SetDelay(int delay) { this->delay = delay; };
 | 
			
		||||
    virtual void Stop(void);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										12
									
								
								views/view.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								views/view.c
									
									
									
									
									
								
							@@ -1016,9 +1016,7 @@ void cView::DrawAnimatedImage(int numPix, cTemplateFunction *func, cRect &pos, c
 | 
			
		||||
 | 
			
		||||
    cAnimatedImage *anim = new cAnimatedImage(animType, animFreq, posAnim, layer);
 | 
			
		||||
    animations.insert(pair<int, cAnimation*>(animCat, anim));
 | 
			
		||||
    if (tmplView) {
 | 
			
		||||
        anim->SetAnimationFadeTime(tmplView->GetNumericParameter(ptFadeTime));
 | 
			
		||||
    }
 | 
			
		||||
    anim->SetDelay(AnimationDelay());
 | 
			
		||||
    anim->SetImage(image);
 | 
			
		||||
    anim->Start();
 | 
			
		||||
}
 | 
			
		||||
@@ -1034,9 +1032,7 @@ void cView::DrawAnimatedText(int numPix, cTemplateFunction *func, cPoint &pos, s
 | 
			
		||||
    
 | 
			
		||||
    cAnimatedText *anim = new cAnimatedText(animType, animFreq, posAnim, layer);
 | 
			
		||||
    animations.insert(pair<int, cAnimation*>(animCat, anim));
 | 
			
		||||
    if (tmplView) {
 | 
			
		||||
        anim->SetAnimationFadeTime(tmplView->GetNumericParameter(ptFadeTime));
 | 
			
		||||
    }
 | 
			
		||||
    anim->SetDelay(AnimationDelay());
 | 
			
		||||
    anim->SetText(text);
 | 
			
		||||
    anim->SetFont(fontName);
 | 
			
		||||
    anim->SetFontSize(fontSize);
 | 
			
		||||
@@ -1053,9 +1049,7 @@ void cView::DrawAnimatedOsdObject(int numPix, cTemplateFunction *func, cRect &po
 | 
			
		||||
 | 
			
		||||
    cAnimatedOsdObject *anim = new cAnimatedOsdObject(funcType, animType, animFreq, posAnim, layer);
 | 
			
		||||
    animations.insert(pair<int, cAnimation*>(animCat, anim));
 | 
			
		||||
    if (tmplView) {
 | 
			
		||||
        anim->SetAnimationFadeTime(tmplView->GetNumericParameter(ptFadeTime));
 | 
			
		||||
    }
 | 
			
		||||
    anim->SetDelay(AnimationDelay());
 | 
			
		||||
    anim->SetColor(col);
 | 
			
		||||
    anim->SetQuadrant(quadrant);
 | 
			
		||||
    anim->Start();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user