Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

progressbar: moved UpdateState() calls from Render() to Process()

  • Loading branch information...
commit 97733f733665030128aeb142f6f67c35771b5562 1 parent e66ce8f
@opdenkamp authored
View
18 xbmc/dialogs/GUIDialogExtendedProgressBar.cpp
@@ -85,7 +85,7 @@ bool CGUIDialogExtendedProgressBar::OnMessage(CGUIMessage& message)
m_iLastSwitchTime = XbmcThreads::SystemClockMillis();
CGUIDialog::OnMessage(message);
- UpdateState();
+ UpdateState(0);
return true;
}
break;
@@ -94,15 +94,15 @@ bool CGUIDialogExtendedProgressBar::OnMessage(CGUIMessage& message)
return CGUIDialog::OnMessage(message);
}
-void CGUIDialogExtendedProgressBar::Render()
+void CGUIDialogExtendedProgressBar::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
if (m_active)
- UpdateState();
+ UpdateState(currentTime);
- CGUIDialog::Render();
+ CGUIDialog::Process(currentTime, dirtyregions);
}
-void CGUIDialogExtendedProgressBar::UpdateState()
+void CGUIDialogExtendedProgressBar::UpdateState(unsigned int currentTime)
{
bool bNoItemsLeft(false);
string strHeader;
@@ -127,10 +127,10 @@ void CGUIDialogExtendedProgressBar::UpdateState()
}
// update the current item ptr
- unsigned int iNow = XbmcThreads::SystemClockMillis();
- if (iNow - m_iLastSwitchTime >= ITEM_SWITCH_TIME_MS)
+ if (currentTime > m_iLastSwitchTime &&
+ currentTime - m_iLastSwitchTime >= ITEM_SWITCH_TIME_MS)
{
- m_iLastSwitchTime = iNow;
+ m_iLastSwitchTime = currentTime;
// select next item
if (++m_iCurrentItem > m_handles.size() - 1)
@@ -149,7 +149,7 @@ void CGUIDialogExtendedProgressBar::UpdateState()
}
else
{
- bNoItemsLeft = true;
+ bNoItemsLeft = true;
}
}
View
4 xbmc/dialogs/GUIDialogExtendedProgressBar.h
@@ -57,12 +57,12 @@ class CGUIDialogExtendedProgressBar : public CGUIDialog
CGUIDialogExtendedProgressBar(void);
virtual ~CGUIDialogExtendedProgressBar(void) {};
virtual bool OnMessage(CGUIMessage& message);
- virtual void Render();
+ virtual void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions);
CGUIDialogProgressBarHandle *GetHandle(const std::string &strTitle);
protected:
- void UpdateState();
+ void UpdateState(unsigned int currentTime);
CCriticalSection m_critSection;
unsigned int m_iCurrentItem;
Please sign in to comment.
Something went wrong with that request. Please try again.