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