optimized flushes when more animations are running in parallel

This commit is contained in:
louis 2016-05-01 06:35:13 +02:00
parent f45af8f826
commit 5b2401caf1
34 changed files with 156 additions and 76 deletions

View File

@ -14,7 +14,6 @@ cAnimation::cAnimation(cScrollable *scrollable) : cThread("scroller") {
keepSleeping = false; keepSleeping = false;
doAnimation = true; doAnimation = true;
modeIn = false; modeIn = false;
doFlush = true;
blinkFunc = -1; blinkFunc = -1;
} }
@ -28,7 +27,6 @@ cAnimation::cAnimation(cDetachable *detachable, bool wait, bool animation) : cTh
keepSleeping = false; keepSleeping = false;
doAnimation = animation; doAnimation = animation;
modeIn = false; modeIn = false;
doFlush = true;
blinkFunc = -1; blinkFunc = -1;
} }
@ -42,11 +40,10 @@ cAnimation::cAnimation(cFadable *fadable, bool fadein) : cThread("fadable") {
keepSleeping = false; keepSleeping = false;
doAnimation = true; doAnimation = true;
modeIn = fadein; modeIn = fadein;
doFlush = true;
blinkFunc = -1; blinkFunc = -1;
} }
cAnimation::cAnimation(cShiftable *shiftable, cPoint &start, cPoint &end, bool shiftin, bool doFlush) : cThread("shiftable") { cAnimation::cAnimation(cShiftable *shiftable, cPoint &start, cPoint &end, bool shiftin) : cThread("shiftable") {
this->scrollable = NULL; this->scrollable = NULL;
this->detachable = NULL; this->detachable = NULL;
this->fadable = NULL; this->fadable = NULL;
@ -58,7 +55,6 @@ cAnimation::cAnimation(cShiftable *shiftable, cPoint &start, cPoint &end, bool s
modeIn = shiftin; modeIn = shiftin;
shiftstart = start; shiftstart = start;
shiftend = end; shiftend = end;
this->doFlush = doFlush;
blinkFunc = -1; blinkFunc = -1;
} }
@ -72,7 +68,6 @@ cAnimation::cAnimation(cBlinkable *blinkable, int func) : cThread("blinking") {
keepSleeping = false; keepSleeping = false;
doAnimation = true; doAnimation = true;
modeIn = false; modeIn = false;
doFlush = true;
blinkFunc = func; blinkFunc = func;
} }
@ -100,14 +95,19 @@ void cAnimation::Stop(bool deletePixmaps) {
void cAnimation::Action(void) { void cAnimation::Action(void) {
if (scrollable) { if (scrollable) {
Scroll(); Scroll();
scrollable->UnregisterAnimation();
} else if (detachable) { } else if (detachable) {
Detach(); Detach();
} else if (fadable) { } else if (fadable) {
Fade(); Fade();
fadable->UnregisterAnimation();
} else if (shiftable) { } else if (shiftable) {
Shift(); Shift();
shiftable->UnregisterAnimation();
} else if (blinkable) { } else if (blinkable) {
blinkable->RegisterAnimation();
Blink(); Blink();
blinkable->UnregisterAnimation();
} }
} }
@ -129,7 +129,8 @@ void cAnimation::Wait(void) {
void cAnimation::Scroll(void) { void cAnimation::Scroll(void) {
int delay = scrollable->ScrollDelay(); int delay = scrollable->ScrollDelay();
Sleep(delay); Sleep(delay);
if (!Running()) return; scrollable->RegisterAnimation();
if (!Running()) return;
eOrientation orientation = scrollable->ScrollOrientation(); eOrientation orientation = scrollable->ScrollOrientation();
int scrollTotal = 0; int scrollTotal = 0;
@ -200,7 +201,7 @@ void cAnimation::Scroll(void) {
scrollable->SetDrawPort(drawPortPoint); scrollable->SetDrawPort(drawPortPoint);
if (!Running()) return; if (!Running()) return;
scrollable->Flush(); scrollable->Flush(true);
if (orientation == eOrientation::horizontal && !carriageReturn && (drawPortX == 0)) { if (orientation == eOrientation::horizontal && !carriageReturn && (drawPortX == 0)) {
scrollDelta *= -1; scrollDelta *= -1;
@ -229,7 +230,7 @@ void cAnimation::Detach(void) {
detachable->RenderDetached(); detachable->RenderDetached();
if (!Running()) return; if (!Running()) return;
if (!doAnimation) if (!doAnimation)
detachable->Flush(); detachable->Flush(false);
if (!Running()) return; if (!Running()) return;
if (doAnimation) { if (doAnimation) {
detachable->StartAnimation(); detachable->StartAnimation();
@ -253,12 +254,13 @@ void cAnimation::Fade(void) {
if (delay > 0) if (delay > 0)
Sleep(delay); Sleep(delay);
} }
fadable->RegisterAnimation();
while (Running() || !modeIn) { while (Running() || !modeIn) {
uint64_t now = cTimeMs::Now(); uint64_t now = cTimeMs::Now();
if (Running() || !modeIn) if (Running() || !modeIn)
fadable->SetTransparency(transparency, !modeIn); fadable->SetTransparency(transparency, !modeIn);
if (Running() || !modeIn) if (Running() || !modeIn)
fadable->Flush(); fadable->Flush(true);
int delta = cTimeMs::Now() - now; int delta = cTimeMs::Now() - now;
if ((Running() || !modeIn) && (delta < frametime)) { if ((Running() || !modeIn) && (delta < frametime)) {
Sleep(frametime - delta); Sleep(frametime - delta);
@ -266,10 +268,10 @@ void cAnimation::Fade(void) {
if ((int)(now - start) > fadetime) { if ((int)(now - start) > fadetime) {
if ((Running() && modeIn) && transparency > 0) { if ((Running() && modeIn) && transparency > 0) {
fadable->SetTransparency(0); fadable->SetTransparency(0);
fadable->Flush(); fadable->Flush(true);
} else if (!modeIn && transparency < 100) { } else if (!modeIn && transparency < 100) {
fadable->SetTransparency(100, true); fadable->SetTransparency(100, true);
fadable->Flush(); fadable->Flush(true);
} }
break; break;
} }
@ -322,7 +324,7 @@ void cAnimation::Shift(void) {
if (delay > 0) if (delay > 0)
Sleep(delay); Sleep(delay);
} }
shiftable->RegisterAnimation();
shiftable->SetStartShifting(); shiftable->SetStartShifting();
uint64_t start = cTimeMs::Now(); uint64_t start = cTimeMs::Now();
bool finished = false; bool finished = false;
@ -330,8 +332,8 @@ void cAnimation::Shift(void) {
uint64_t now = cTimeMs::Now(); uint64_t now = cTimeMs::Now();
if (Running() || !modeIn) if (Running() || !modeIn)
shiftable->SetPosition(pos, shiftend); shiftable->SetPosition(pos, shiftend);
if ((Running() || !modeIn) && doFlush) if (Running() || !modeIn)
shiftable->Flush(); shiftable->Flush(true);
int delta = cTimeMs::Now() - now; int delta = cTimeMs::Now() - now;
if ((Running() || !modeIn) && (delta < frametime)) { if ((Running() || !modeIn) && (delta < frametime)) {
cCondWait::SleepMs(frametime - delta); cCondWait::SleepMs(frametime - delta);
@ -340,7 +342,7 @@ void cAnimation::Shift(void) {
finished = true; finished = true;
if ((Running() && modeIn) && pos != shiftend) { if ((Running() && modeIn) && pos != shiftend) {
shiftable->SetPosition(shiftend, shiftend); shiftable->SetPosition(shiftend, shiftend);
shiftable->Flush(); shiftable->Flush(true);
} }
break; break;
} }
@ -370,7 +372,7 @@ void cAnimation::Blink(void) {
if (Running()) if (Running())
blinkable->DoBlink(blinkFunc, blinkOn); blinkable->DoBlink(blinkFunc, blinkOn);
if (Running()) if (Running())
blinkable->Flush(); blinkable->Flush(true);
blinkOn = !blinkOn; blinkOn = !blinkOn;
} }
} }

View File

@ -24,7 +24,9 @@ public:
virtual void StartScrolling(void) = 0; virtual void StartScrolling(void) = 0;
virtual void StopScrolling(void) = 0; virtual void StopScrolling(void) = 0;
virtual void SetDrawPort(cPoint &point) = 0; virtual void SetDrawPort(cPoint &point) = 0;
virtual void Flush(void) = 0; virtual void RegisterAnimation(void) = 0;
virtual void UnregisterAnimation(void) = 0;
virtual void Flush(bool animFlush) = 0;
}; };
/****************************************************************** /******************************************************************
@ -39,7 +41,9 @@ public:
virtual void ParseDetached(void) = 0; virtual void ParseDetached(void) = 0;
virtual void RenderDetached(void) = 0; virtual void RenderDetached(void) = 0;
virtual void StartAnimation(void) = 0; virtual void StartAnimation(void) = 0;
virtual void Flush(void) = 0; virtual void RegisterAnimation(void) = 0;
virtual void UnregisterAnimation(void) = 0;
virtual void Flush(bool animFlush) = 0;
}; };
/****************************************************************** /******************************************************************
@ -54,7 +58,9 @@ public:
virtual int Delay(void) = 0; virtual int Delay(void) = 0;
virtual int FadeTime(void) = 0; virtual int FadeTime(void) = 0;
virtual void SetTransparency(int transparency, bool force = false) = 0; virtual void SetTransparency(int transparency, bool force = false) = 0;
virtual void Flush(void) = 0; virtual void RegisterAnimation(void) = 0;
virtual void UnregisterAnimation(void) = 0;
virtual void Flush(bool animFlush) = 0;
}; };
/****************************************************************** /******************************************************************
@ -72,7 +78,9 @@ public:
virtual void SetPosition(cPoint &position, cPoint &reference, bool force = false) = 0; virtual void SetPosition(cPoint &position, cPoint &reference, bool force = false) = 0;
virtual void SetStartShifting(void) = 0; virtual void SetStartShifting(void) = 0;
virtual void SetEndShifting(void) = 0; virtual void SetEndShifting(void) = 0;
virtual void Flush(void) = 0; virtual void RegisterAnimation(void) = 0;
virtual void UnregisterAnimation(void) = 0;
virtual void Flush(bool animFlush) = 0;
}; };
/****************************************************************** /******************************************************************
@ -85,7 +93,9 @@ protected:
public: public:
virtual int BlinkFreq(int func) = 0; virtual int BlinkFreq(int func) = 0;
virtual void DoBlink(int func, bool on) = 0; virtual void DoBlink(int func, bool on) = 0;
virtual void Flush(void) = 0; virtual void RegisterAnimation(void) = 0;
virtual void UnregisterAnimation(void) = 0;
virtual void Flush(bool animFlush) = 0;
}; };
/****************************************************************** /******************************************************************
@ -106,7 +116,6 @@ private:
int blinkFunc; int blinkFunc;
cPoint shiftstart; cPoint shiftstart;
cPoint shiftend; cPoint shiftend;
bool doFlush;
void Sleep(int duration); void Sleep(int duration);
void Wait(void); void Wait(void);
void Scroll(void); void Scroll(void);
@ -118,7 +127,7 @@ public:
cAnimation(cScrollable *scrollable); cAnimation(cScrollable *scrollable);
cAnimation(cDetachable *detachable, bool wait, bool animation); cAnimation(cDetachable *detachable, bool wait, bool animation);
cAnimation(cFadable *fadable, bool fadein); cAnimation(cFadable *fadable, bool fadein);
cAnimation(cShiftable *shiftable, cPoint &start, cPoint &end, bool shiftin, bool doFlush = true); cAnimation(cShiftable *shiftable, cPoint &start, cPoint &end, bool shiftin);
cAnimation(cBlinkable *blinkable, int func); cAnimation(cBlinkable *blinkable, int func);
~cAnimation(void); ~cAnimation(void);
void WakeUp(void); void WakeUp(void);

View File

@ -491,8 +491,11 @@ void cArea::Debug(bool full) {
} }
} }
void cArea::Flush(void) { void cArea::Flush(bool animFlush) {
sdOsd->Flush(); if (animFlush)
sdOsd->AnimatedFlush();
else
sdOsd->Flush();
} }
/****************************************************************** /******************************************************************
* Private Functions * Private Functions
@ -570,6 +573,14 @@ void cArea::StopBlinkers(void) {
blinkers.Clear(); blinkers.Clear();
} }
void cArea::RegisterAnimation(void) {
sdOsd->AddAnimation();
}
void cArea::UnregisterAnimation(void) {
sdOsd->RemoveAnimation();
}
/****************************************************************** /******************************************************************
* cAreaContainer * cAreaContainer
******************************************************************/ ******************************************************************/

View File

@ -133,9 +133,11 @@ public:
void DoBlink(int func, bool on); void DoBlink(int func, bool on);
void StopBlinkers(void); void StopBlinkers(void);
//Common //Common
void RegisterAnimation(void);
void UnregisterAnimation(void);
const char *Name(void) { return attribs->Name(); }; const char *Name(void) { return attribs->Name(); };
bool BackgroundArea(void) { return attribs->BackgroundArea(); }; bool BackgroundArea(void) { return attribs->BackgroundArea(); };
void Flush(void); void Flush(bool animFlush);
void Debug(bool full = false); void Debug(bool full = false);
}; };

View File

@ -3,6 +3,8 @@
cSdOsd::cSdOsd(void) { cSdOsd::cSdOsd(void) {
osd = NULL; osd = NULL;
flushLocked = false; flushLocked = false;
animsRunning = 0;
animsFlushed = 0;
} }
cSdOsd::~cSdOsd(void) { cSdOsd::~cSdOsd(void) {
@ -48,6 +50,10 @@ void cSdOsd::DeleteOsd(void) {
delete osd; delete osd;
osd = NULL; osd = NULL;
Unlock(); Unlock();
animsRunningMutex.Lock();
animsRunning = 0;
animsFlushed = 0;
animsRunningMutex.Unlock();
} }
cPixmap *cSdOsd::CreatePixmap(int layer, cRect &viewPort, cRect &drawPort) { cPixmap *cSdOsd::CreatePixmap(int layer, cRect &viewPort, cRect &drawPort) {
@ -63,7 +69,33 @@ void cSdOsd::DestroyPixmap(cPixmap *pix) {
} }
} }
void cSdOsd::Flush(void) { void cSdOsd::AddAnimation(void) {
if (osd && !flushLocked) animsRunningMutex.Lock();
osd->Flush(); animsRunning++;
animsRunningMutex.Unlock();
}
void cSdOsd::RemoveAnimation(void) {
animsRunningMutex.Lock();
animsRunning--;
animsRunningMutex.Unlock();
}
void cSdOsd::AnimatedFlush(void) {
if (osd && !flushLocked) {
animsRunningMutex.Lock();
if (animsFlushed + 1 >= animsRunning) {
animsFlushed = 0;
osd->Flush();
} else {
animsFlushed++;
}
animsRunningMutex.Unlock();
}
}
void cSdOsd::Flush(void) {
if (osd && !flushLocked) {
osd->Flush();
}
} }

View File

@ -9,6 +9,9 @@ private:
cOsd *osd; cOsd *osd;
cMutex mutex; cMutex mutex;
bool flushLocked; bool flushLocked;
int animsRunning;
int animsFlushed;
cMutex animsRunningMutex;
public: public:
cSdOsd(void); cSdOsd(void);
virtual ~cSdOsd(void); virtual ~cSdOsd(void);
@ -20,6 +23,9 @@ public:
void DeleteOsd(void); void DeleteOsd(void);
cPixmap *CreatePixmap(int layer, cRect &viewPort, cRect &drawPort); cPixmap *CreatePixmap(int layer, cRect &viewPort, cRect &drawPort);
void DestroyPixmap(cPixmap *pix); void DestroyPixmap(cPixmap *pix);
void AddAnimation(void);
void RemoveAnimation(void);
void AnimatedFlush(void);
void Flush(void); void Flush(void);
}; };

View File

@ -160,8 +160,6 @@ void cView::PreCache(void) {
for (int i=0; i < numViewElements; i++) { for (int i=0; i < numViewElements; i++) {
if (!viewElements[i]) if (!viewElements[i])
continue; continue;
if (FadeTime() > 0 || ShiftTime() > 0)
viewElements[i]->SetAnimatedView();
viewElements[i]->SetContainer(contX, contY, attribs->Width(), attribs->Height()); viewElements[i]->SetContainer(contX, contY, attribs->Width(), attribs->Height());
viewElements[i]->Cache(); viewElements[i]->Cache();
} }
@ -169,8 +167,6 @@ void cView::PreCache(void) {
for (int i=0; i < numViewElements; i++) { for (int i=0; i < numViewElements; i++) {
if (!viewElementsHorizontal[i]) if (!viewElementsHorizontal[i])
continue; continue;
if (FadeTime() > 0 || ShiftTime() > 0)
viewElementsHorizontal[i]->SetAnimatedView();
viewElementsHorizontal[i]->SetContainer(contX, contY, attribs->Width(), attribs->Height()); viewElementsHorizontal[i]->SetContainer(contX, contY, attribs->Width(), attribs->Height());
viewElementsHorizontal[i]->Cache(); viewElementsHorizontal[i]->Cache();
} }
@ -278,7 +274,15 @@ void cView::SetPosition(cPoint &position, cPoint &reference, bool force) {
} }
} }
void cView::Flush(void) { void cView::RegisterAnimation(void) {
sdOsd.AddAnimation();
}
void cView::UnregisterAnimation(void) {
sdOsd.RemoveAnimation();
}
void cView::Flush(bool animFlush) {
if (init) { if (init) {
init = false; init = false;
StartAnimation(); StartAnimation();
@ -292,7 +296,10 @@ void cView::Flush(void) {
WakeViewElements(); WakeViewElements();
menuInit = false; menuInit = false;
} }
sdOsd.Flush(); if (animFlush)
sdOsd.AnimatedFlush();
else
sdOsd.Flush();
} }
void cView::Debug(void) { void cView::Debug(void) {

View File

@ -78,7 +78,7 @@ public:
void Clear(int ve, bool forceClearBackground = false); void Clear(int ve, bool forceClearBackground = false);
void Render(int ve, bool force = false); void Render(int ve, bool force = false);
virtual void Close(void); virtual void Close(void);
virtual void Flush(void); virtual void Flush(bool animFlush);
virtual void Debug(void); virtual void Debug(void);
bool Detached(void) { return false; }; bool Detached(void) { return false; };
int Delay(void) { return 0; }; int Delay(void) { return 0; };
@ -91,6 +91,8 @@ public:
virtual void SetPosition(cPoint &position, cPoint &reference, bool force = false); virtual void SetPosition(cPoint &position, cPoint &reference, bool force = false);
void SetStartShifting(void) { shifting = true; }; void SetStartShifting(void) { shifting = true; };
void SetEndShifting(void) { shifting = false; }; void SetEndShifting(void) { shifting = false; };
void RegisterAnimation(void);
void UnregisterAnimation(void);
}; };
#endif //__VIEW_H #endif //__VIEW_H

View File

@ -166,7 +166,7 @@ void cViewChannel::SetMessage(eMessageType type, const char *text) {
} }
} }
void cViewChannel::Flush(void) { void cViewChannel::Flush(bool animFlush) {
if (init) { if (init) {
sdOsd.LockFlush(); sdOsd.LockFlush();
Render((int)eVeDisplayChannel::background); Render((int)eVeDisplayChannel::background);
@ -198,6 +198,6 @@ void cViewChannel::Flush(void) {
Render((int)eVeDisplayChannel::time); Render((int)eVeDisplayChannel::time);
} }
channelChange = false; channelChange = false;
cView::Flush(); cView::Flush(animFlush);
} }

View File

@ -25,7 +25,7 @@ public:
void SetChannel(const cChannel *channel, int number); void SetChannel(const cChannel *channel, int number);
void SetEvents(const cEvent *present, const cEvent *following); void SetEvents(const cEvent *present, const cEvent *following);
void SetMessage(eMessageType type, const char *text); void SetMessage(eMessageType type, const char *text);
void Flush(void); void Flush(bool animFlush);
}; };
#endif //__VIEWDISPLAYCHANNEL_H #endif //__VIEWDISPLAYCHANNEL_H

View File

@ -566,7 +566,7 @@ void cViewMenu::Clear(void) {
activeSubview->ClearViewList(); activeSubview->ClearViewList();
} }
void cViewMenu::Flush(void) { void cViewMenu::Flush(bool animFlush) {
if (init) { if (init) {
sdOsd.LockFlush(); sdOsd.LockFlush();
} }
@ -591,7 +591,7 @@ void cViewMenu::Flush(void) {
detailViewInit = false; detailViewInit = false;
} }
activeSubview->DrawDynamicVEs(); activeSubview->DrawDynamicVEs();
cView::Flush(); cView::Flush(animFlush);
} }
void cViewMenu::SetTransparency(int transparency, bool forceDetached) { void cViewMenu::SetTransparency(int transparency, bool forceDetached) {

View File

@ -101,7 +101,7 @@ public:
bool Init(void); bool Init(void);
void Close(void); void Close(void);
void Clear(void); void Clear(void);
void Flush(void); void Flush(bool animFlush);
void SetTransparency(int transparency, bool forceDetached = false); void SetTransparency(int transparency, bool forceDetached = false);
void Debug(void); void Debug(void);
}; };

View File

@ -43,12 +43,12 @@ void cViewMessage::SetMessage(eMessageType type, const char *text) {
veMessage->Set(type, text); veMessage->Set(type, text);
} }
void cViewMessage::Flush(void) { void cViewMessage::Flush(bool animFlush) {
if (init) { if (init) {
sdOsd.LockFlush(); sdOsd.LockFlush();
Render((int)eVeDisplayMessage::background); Render((int)eVeDisplayMessage::background);
} }
Render((int)eVeDisplayMessage::message); Render((int)eVeDisplayMessage::message);
cView::Flush(); cView::Flush(animFlush);
} }

View File

@ -13,7 +13,7 @@ public:
cViewMessage(void); cViewMessage(void);
virtual ~cViewMessage(void); virtual ~cViewMessage(void);
void SetMessage(eMessageType type, const char *text); void SetMessage(eMessageType type, const char *text);
void Flush(void); void Flush(bool animFlush);
}; };
#endif //__VIEWDISPLAYMESSAGE_H #endif //__VIEWDISPLAYMESSAGE_H

View File

@ -352,13 +352,13 @@ void cViewPlugin::ClearTab(int viewId) {
tab->Clear(); tab->Clear();
} }
void cViewPlugin::Flush(void) { void cViewPlugin::Flush(bool animFlush) {
if (viewChanged) { if (viewChanged) {
viewChanged = false; viewChanged = false;
newTvFrame = views[newViewId]->GetTvFrame(); newTvFrame = views[newViewId]->GetTvFrame();
menuInit = true; menuInit = true;
} }
cView::Flush(); cView::Flush(animFlush);
} }
bool cViewPlugin::ChannelLogoExists(string channelId) { bool cViewPlugin::ChannelLogoExists(string channelId) {

View File

@ -64,7 +64,7 @@ public:
void TabDown(int viewId); void TabDown(int viewId);
void DisplayTabs(int viewId); void DisplayTabs(int viewId);
void ClearTab(int viewId); void ClearTab(int viewId);
void Flush(void); void Flush(bool animFlush);
bool ChannelLogoExists(string channelId); bool ChannelLogoExists(string channelId);
string GetEpgImagePath(void); string GetEpgImagePath(void);
}; };

View File

@ -276,7 +276,7 @@ void cViewReplay::DelayOnPause(void) {
veOnPause->ResetSleep(); veOnPause->ResetSleep();
} }
void cViewReplay::Flush(void) { void cViewReplay::Flush(bool animFlush) {
if (init) { if (init) {
sdOsd.LockFlush(); sdOsd.LockFlush();
if (!modeOnly) { if (!modeOnly) {
@ -303,7 +303,7 @@ void cViewReplay::Flush(void) {
SetProgressModeOnly(); SetProgressModeOnly();
} }
cView::Flush(); cView::Flush(animFlush);
} }
void cViewReplay::SetProgressModeOnly(void) { void cViewReplay::SetProgressModeOnly(void) {

View File

@ -53,7 +53,7 @@ public:
void StartOnPause(const char *recfilename); void StartOnPause(const char *recfilename);
void ClearOnPause(void); void ClearOnPause(void);
void DelayOnPause(void); void DelayOnPause(void);
void Flush(void); void Flush(bool animFlush);
}; };
#endif //__VIEWDISPLAYREPLAY_H1 #endif //__VIEWDISPLAYREPLAY_H1

View File

@ -107,7 +107,7 @@ void cViewTracks::SetCurrentTrack(int index) {
change = true; change = true;
} }
void cViewTracks::Flush(void) { void cViewTracks::Flush(bool animFlush) {
if (init) { if (init) {
sdOsd.LockFlush(); sdOsd.LockFlush();
Render((int)eVeDisplayTracks::background); Render((int)eVeDisplayTracks::background);
@ -118,5 +118,5 @@ void cViewTracks::Flush(void) {
viewList->Draw(); viewList->Draw();
change = false; change = false;
} }
cView::Flush(); cView::Flush(animFlush);
} }

View File

@ -23,7 +23,7 @@ public:
void SetTracks(const char * const *tracks); void SetTracks(const char * const *tracks);
void SetAudiochannel(int audioChannel); void SetAudiochannel(int audioChannel);
void SetCurrentTrack(int index); void SetCurrentTrack(int index);
void Flush(void); void Flush(bool animFlush);
}; };
#endif //__VIEWDISPLAYTRACKS_H #endif //__VIEWDISPLAYTRACKS_H

View File

@ -40,13 +40,13 @@ void cViewVolume::SetVolume(int current, int total, bool mute) {
veVolume->Set(current, total, mute); veVolume->Set(current, total, mute);
} }
void cViewVolume::Flush(void) { void cViewVolume::Flush(bool animFlush) {
if (init) { if (init) {
sdOsd.LockFlush(); sdOsd.LockFlush();
Render((int)eVeDisplayVolume::background); Render((int)eVeDisplayVolume::background);
} }
Render((int)eVeDisplayVolume::volume); Render((int)eVeDisplayVolume::volume);
cView::Flush(); cView::Flush(animFlush);
} }

View File

@ -13,7 +13,7 @@ public:
cViewVolume(void); cViewVolume(void);
virtual ~cViewVolume(void); virtual ~cViewVolume(void);
void SetVolume(int current, int total, bool mute); void SetVolume(int current, int total, bool mute);
void Flush(void); void Flush(bool animFlush);
}; };
#endif //__VIEWDISPLAYVOLUME_H #endif //__VIEWDISPLAYVOLUME_H

View File

@ -15,7 +15,6 @@ cViewElement::cViewElement(void) {
detached = false; detached = false;
waitOnWakeup = true; waitOnWakeup = true;
startAnimation = true; startAnimation = true;
viewAnimated = false;
globals = NULL; globals = NULL;
tokenContainer = NULL; tokenContainer = NULL;
attribs = new cViewElementAttribs((int)eViewElementAttribs::count); attribs = new cViewElementAttribs((int)eViewElementAttribs::count);
@ -35,7 +34,6 @@ cViewElement::cViewElement(const cViewElement &other) {
detached = false; detached = false;
waitOnWakeup = true; waitOnWakeup = true;
startAnimation = true; startAnimation = true;
viewAnimated = false;
globals = other.globals; globals = other.globals;
container.Set(other.container.X(), other.container.Y(), other.container.Width(), other.container.Height()); container.Set(other.container.X(), other.container.Y(), other.container.Width(), other.container.Height());
tokenContainer = NULL; tokenContainer = NULL;
@ -436,7 +434,7 @@ void cViewElement::StartAnimation(void) {
SetPosition(start, ref); SetPosition(start, ref);
sdOsd->Flush(); sdOsd->Flush();
delete shifter; delete shifter;
shifter = new cAnimation((cShiftable*)this, start, ref, true, !viewAnimated); shifter = new cAnimation((cShiftable*)this, start, ref, true);
shifter->Start(); shifter->Start();
} else if (FadeTime() > 0) { } else if (FadeTime() > 0) {
SetTransparency(100); SetTransparency(100);
@ -471,8 +469,19 @@ cRect cViewElement::CoveredArea(void) {
return unionArea; return unionArea;
} }
void cViewElement::Flush(void) { void cViewElement::RegisterAnimation(void) {
sdOsd->Flush(); sdOsd->AddAnimation();
}
void cViewElement::UnregisterAnimation(void) {
sdOsd->RemoveAnimation();
}
void cViewElement::Flush(bool animFlush) {
if (animFlush)
sdOsd->AnimatedFlush();
else
sdOsd->Flush();
} }
bool cViewElement::Parse(bool forced) { bool cViewElement::Parse(bool forced) {

View File

@ -27,7 +27,6 @@ protected:
bool waitOnWakeup; bool waitOnWakeup;
bool scrollingStarted; bool scrollingStarted;
bool startAnimation; bool startAnimation;
bool viewAnimated;
cGlobals *globals; cGlobals *globals;
cRect container; cRect container;
cViewElementAttribs *attribs; cViewElementAttribs *attribs;
@ -55,7 +54,6 @@ public:
bool Detached(void); bool Detached(void);
void SetContainer(int x, int y, int width, int height); void SetContainer(int x, int y, int width, int height);
void SetAttributes(vector<stringpair> &attributes); void SetAttributes(vector<stringpair> &attributes);
void SetAnimatedView(void) { viewAnimated = true; };
void AddArea(cAreaNode *area); void AddArea(cAreaNode *area);
void SetAreaX(int x); void SetAreaX(int x);
void SetAreaY(int y); void SetAreaY(int y);
@ -88,8 +86,10 @@ public:
virtual void SetPosition(cPoint &position, cPoint &reference, bool force = false); virtual void SetPosition(cPoint &position, cPoint &reference, bool force = false);
void SetStartShifting(void) { }; void SetStartShifting(void) { };
void SetEndShifting(void) { }; void SetEndShifting(void) { };
void RegisterAnimation(void);
void UnregisterAnimation(void);
cRect CoveredArea(void); cRect CoveredArea(void);
void Flush(void); void Flush(bool animFlush);
virtual bool Parse(bool forced = false); virtual bool Parse(bool forced = false);
cFunction *GetFunction(const char *name); cFunction *GetFunction(const char *name);
virtual void Debug(bool full = false); virtual void Debug(bool full = false);

View File

@ -32,5 +32,5 @@ void cSDDisplayChannel::SetMessage(eMessageType Type, const char *Text) {
void cSDDisplayChannel::Flush(void) { void cSDDisplayChannel::Flush(void) {
if (!ok) if (!ok)
return; return;
view->Flush(); view->Flush(false);
} }

View File

@ -165,7 +165,7 @@ bool cSDDisplayMenu::SetPluginText(skindesignerapi::cTokenContainer *tk) {
void cSDDisplayMenu::Flush(void) { void cSDDisplayMenu::Flush(void) {
if (view) if (view)
view->Flush(); view->Flush(false);
} }
void cSDDisplayMenu::SetCurrentRecording(void) { void cSDDisplayMenu::SetCurrentRecording(void) {

View File

@ -21,5 +21,5 @@ void cSDDisplayMessage::SetMessage(eMessageType Type, const char *Text) {
void cSDDisplayMessage::Flush(void) { void cSDDisplayMessage::Flush(void) {
if (!ok) if (!ok)
return; return;
view->Flush(); view->Flush(false);
} }

View File

@ -78,7 +78,7 @@ void cSDDisplayReplay::SetMessage(eMessageType Type, const char *Text) {
void cSDDisplayReplay::Flush(void) { void cSDDisplayReplay::Flush(void) {
if (!ok) if (!ok)
return; return;
view->Flush(); view->Flush(false);
} }
void cSDDisplayReplay::SetTimeShiftValues(const cRecording *recording) { void cSDDisplayReplay::SetTimeShiftValues(const cRecording *recording) {

View File

@ -27,5 +27,5 @@ void cSDDisplayTracks::SetAudioChannel(int AudioChannel) {
void cSDDisplayTracks::Flush(void) { void cSDDisplayTracks::Flush(void) {
if (!ok) if (!ok)
return; return;
view->Flush(); view->Flush(false);
} }

View File

@ -22,5 +22,5 @@ void cSDDisplayVolume::SetVolume(int Current, int Total, bool Mute) {
void cSDDisplayVolume::Flush(void) { void cSDDisplayVolume::Flush(void) {
if (!ok) if (!ok)
return; return;
view->Flush(); view->Flush(false);
} }

View File

@ -3,7 +3,7 @@
NAME = skindesignerapi NAME = skindesignerapi
LIBNAME = lib$(NAME) LIBNAME = lib$(NAME)
MAJOR = 0 MAJOR = 0
MINOR = 1.0 MINOR = 1.1
VERSION = $(MAJOR).$(MINOR) VERSION = $(MAJOR).$(MINOR)
SONAME = $(LIBNAME).so.$(MAJOR) SONAME = $(LIBNAME).so.$(MAJOR)

View File

@ -198,5 +198,5 @@ skindesignerapi::cViewTab *skindesignerapi::cOsdView::GetViewTabs(void) {
void skindesignerapi::cOsdView::Display(void) { void skindesignerapi::cOsdView::Display(void) {
if (displayPlugin) if (displayPlugin)
displayPlugin->Flush(); displayPlugin->Flush(false);
} }

View File

@ -47,7 +47,7 @@ public:
virtual void TabDown(int viewId) = 0; virtual void TabDown(int viewId) = 0;
virtual void DisplayTabs(int viewId) = 0; virtual void DisplayTabs(int viewId) = 0;
virtual void ClearTab(int viewId) = 0; virtual void ClearTab(int viewId) = 0;
virtual void Flush(void) = 0; virtual void Flush(bool animFlush) = 0;
virtual bool ChannelLogoExists(string channelId) = 0; virtual bool ChannelLogoExists(string channelId) = 0;
virtual string GetEpgImagePath(void) = 0; virtual string GetEpgImagePath(void) = 0;
}; };

View File

@ -22,7 +22,7 @@ private:
//token containers //token containers
char **stringTokens; char **stringTokens;
int *intTokens; int *intTokens;
vector<char***>loopTokens; vector<char***> loopTokens;
//mapping id --> name //mapping id --> name
string *stNames; string *stNames;
string *itNames; string *itNames;