aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Sommerfeld <kai.sommerfeld@gmx.com>2015-07-13 10:03:54 +0200
committerKai Sommerfeld <kai.sommerfeld@gmx.com>2015-07-17 23:59:03 +0200
commit4cc430e80a9e2da317125145a600721912aeda32 (patch)
treed629662e6f780b531b7db106b4f203c187af2eb5
parent17a34f5f318f5ad54d5a23192454e8b5d2edf31d (diff)
[EPG] Reduce lagging of EPG window during EPG data grid updates.
-rw-r--r--xbmc/epg/GUIEPGGridContainer.cpp16
-rw-r--r--xbmc/epg/GUIEPGGridContainer.h3
2 files changed, 18 insertions, 1 deletions
diff --git a/xbmc/epg/GUIEPGGridContainer.cpp b/xbmc/epg/GUIEPGGridContainer.cpp
index d75fc7ad50..5d28b97f0a 100644
--- a/xbmc/epg/GUIEPGGridContainer.cpp
+++ b/xbmc/epg/GUIEPGGridContainer.cpp
@@ -44,6 +44,8 @@ using namespace EPG;
#define BLOCKJUMP 4 // how many blocks are jumped with each analogue scroll action
#define BLOCK_SCROLL_OFFSET 60 / MINSPERBLOCK // how many blocks are jumped if we are at left/right edge of grid
+#define MAX_UPDATE_FREQUENCY 3000 // Do at maximum 1 grid data update in MAX_UPDATE_FREQUENCY milliseconds
+
CGUIEPGGridContainer::CGUIEPGGridContainer(int parentID, int controlID, float posX, float posY, float width,
float height, int scrollTime, int preloadItems, int timeBlocks, int rulerUnit,
const CTextureInfo& progressIndicatorTexture)
@@ -156,6 +158,7 @@ CGUIEPGGridContainer::CGUIEPGGridContainer(const CGUIEPGGridContainer &other)
m_channelScrollLastTime = other.m_channelScrollLastTime;
m_channelScrollSpeed = other.m_channelScrollSpeed;
m_channelScrollOffset = other.m_channelScrollOffset;
+ m_nextUpdateTimeout = other.m_nextUpdateTimeout;
}
CGUIEPGGridContainer::~CGUIEPGGridContainer(void)
{
@@ -800,7 +803,7 @@ bool CGUIEPGGridContainer::OnMessage(CGUIMessage& message)
return true;
case GUI_MSG_LABEL_BIND:
- if (message.GetPointer())
+ if (message.GetPointer() && m_nextUpdateTimeout.IsTimePast())
{
CSingleLock lock(m_critSection);
@@ -886,7 +889,10 @@ bool CGUIEPGGridContainer::OnMessage(CGUIMessage& message)
{
// Grid index got recreated. Do cursors and offsets still point to the same epg tag?
if (prevSelectedEpgTag == GetSelectedEpgInfoTag())
+ {
+ m_nextUpdateTimeout.Set(MAX_UPDATE_FREQUENCY); // TODO ksooo: Refactor to have only one return statement.
return true;
+ }
int newChannelCursor = GetChannel(prevSelectedEpgTag);
if (newChannelCursor >= 0)
@@ -895,7 +901,10 @@ bool CGUIEPGGridContainer::OnMessage(CGUIMessage& message)
if (newBlockCursor >= 0)
{
if (newChannelCursor == m_channelCursor && newBlockCursor == m_blockCursor)
+ {
+ m_nextUpdateTimeout.Set(MAX_UPDATE_FREQUENCY); // TODO ksooo: Refactor to have only one return statement.
return true;
+ }
if (newBlockCursor > 0 && newBlockCursor != m_blockCursor)
{
@@ -910,7 +919,10 @@ bool CGUIEPGGridContainer::OnMessage(CGUIMessage& message)
}
if (newBlockCursor > 0)
+ {
+ m_nextUpdateTimeout.Set(MAX_UPDATE_FREQUENCY); // TODO ksooo: Refactor to have only one return statement.
return true;
+ }
}
}
}
@@ -922,6 +934,8 @@ bool CGUIEPGGridContainer::OnMessage(CGUIMessage& message)
SetInvalid();
GoToNow();
+
+ m_nextUpdateTimeout.Set(MAX_UPDATE_FREQUENCY); // TODO ksooo: Refactor to have only one return statement.
return true;
}
break;
diff --git a/xbmc/epg/GUIEPGGridContainer.h b/xbmc/epg/GUIEPGGridContainer.h
index 7ad182456a..5ef003001f 100644
--- a/xbmc/epg/GUIEPGGridContainer.h
+++ b/xbmc/epg/GUIEPGGridContainer.h
@@ -24,6 +24,7 @@
#include "guilib/GUIControl.h"
#include "guilib/GUIListItemLayout.h"
#include "guilib/IGUIContainer.h"
+#include "threads/SystemClock.h"
namespace EPG
{
@@ -228,5 +229,7 @@ namespace EPG
float m_channelScrollOffset;
CCriticalSection m_critSection;
+
+ XbmcThreads::EndTime m_nextUpdateTimeout;
};
}