diff options
-rw-r--r-- | xbmc/epg/GUIEPGGridContainer.cpp | 16 | ||||
-rw-r--r-- | xbmc/epg/GUIEPGGridContainer.h | 3 |
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; }; } |