aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Sommerfeld <kai.sommerfeld@gmx.com>2015-08-10 09:24:16 +0200
committerKai Sommerfeld <kai.sommerfeld@gmx.com>2015-08-10 09:24:16 +0200
commit3689e2092cb6cc32cec1d1c1b040cc6cae83d844 (patch)
tree9d553da4211bf02621e9fb95faecc682123ae0f1
parent6bc0e835c4106943034febecc68077c6914f73cb (diff)
parent6a86762719efb9ceaf125072127916238d4ea709 (diff)
Merge pull request #7771 from ksooo/fix-epg-window-update-count-control-isengard
[EPG] Fix: Respect view mode changes of EPG window when controlling number of epg data updates
-rw-r--r--xbmc/epg/GUIEPGGridContainer.cpp16
-rw-r--r--xbmc/epg/GUIEPGGridContainer.h3
-rw-r--r--xbmc/pvr/windows/GUIWindowPVRGuide.cpp10
-rw-r--r--xbmc/pvr/windows/GUIWindowPVRGuide.h3
4 files changed, 13 insertions, 19 deletions
diff --git a/xbmc/epg/GUIEPGGridContainer.cpp b/xbmc/epg/GUIEPGGridContainer.cpp
index 5d28b97f0a..113948a4e1 100644
--- a/xbmc/epg/GUIEPGGridContainer.cpp
+++ b/xbmc/epg/GUIEPGGridContainer.cpp
@@ -44,8 +44,6 @@ 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)
@@ -158,8 +156,8 @@ 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)
{
Reset();
@@ -803,7 +801,7 @@ bool CGUIEPGGridContainer::OnMessage(CGUIMessage& message)
return true;
case GUI_MSG_LABEL_BIND:
- if (message.GetPointer() && m_nextUpdateTimeout.IsTimePast())
+ if (message.GetPointer())
{
CSingleLock lock(m_critSection);
@@ -889,10 +887,7 @@ 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)
@@ -901,10 +896,7 @@ 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)
{
@@ -919,10 +911,7 @@ 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;
- }
}
}
}
@@ -935,7 +924,6 @@ 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 5ef003001f..7ad182456a 100644
--- a/xbmc/epg/GUIEPGGridContainer.h
+++ b/xbmc/epg/GUIEPGGridContainer.h
@@ -24,7 +24,6 @@
#include "guilib/GUIControl.h"
#include "guilib/GUIListItemLayout.h"
#include "guilib/IGUIContainer.h"
-#include "threads/SystemClock.h"
namespace EPG
{
@@ -229,7 +228,5 @@ namespace EPG
float m_channelScrollOffset;
CCriticalSection m_critSection;
-
- XbmcThreads::EndTime m_nextUpdateTimeout;
};
}
diff --git a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
index c829ff3449..dbb599b12c 100644
--- a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
+++ b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
@@ -33,6 +33,8 @@
#include "pvr/addons/PVRClients.h"
#include "pvr/timers/PVRTimers.h"
+#define MAX_UPDATE_FREQUENCY 3000 // limit to maximum one update/refresh in x milliseconds
+
using namespace PVR;
using namespace EPG;
@@ -259,6 +261,7 @@ bool CGUIWindowPVRGuide::OnMessage(CGUIMessage& message)
{
// let's set the view mode first before update
CGUIWindowPVRBase::OnMessage(message);
+ m_nextUpdateTimeout.SetExpired();
Refresh(true);
bReturn = true;
break;
@@ -271,9 +274,12 @@ bool CGUIWindowPVRGuide::OnMessage(CGUIMessage& message)
case ObservableMessageEpgContainer:
{
m_bUpdateRequired = true;
- /* update the current window if the EPG timeline view is visible */
- if (IsActive() && m_viewControl.GetCurrentControl() == GUIDE_VIEW_TIMELINE)
+ // do not allow more than MAX_UPDATE_FREQUENCY updates
+ if (IsActive() && m_nextUpdateTimeout.IsTimePast())
+ {
Refresh(true);
+ m_nextUpdateTimeout.Set(MAX_UPDATE_FREQUENCY);
+ }
bReturn = true;
break;
}
diff --git a/xbmc/pvr/windows/GUIWindowPVRGuide.h b/xbmc/pvr/windows/GUIWindowPVRGuide.h
index cc815b2fa7..af30eb6176 100644
--- a/xbmc/pvr/windows/GUIWindowPVRGuide.h
+++ b/xbmc/pvr/windows/GUIWindowPVRGuide.h
@@ -22,6 +22,7 @@
#include "GUIWindowPVRBase.h"
#include "epg/GUIEPGGridContainer.h"
+#include "threads/SystemClock.h"
class CSetting;
@@ -65,5 +66,7 @@ namespace PVR
CPVRChannelGroupPtr m_cachedChannelGroup;
bool m_bUpdateRequired;
+
+ XbmcThreads::EndTime m_nextUpdateTimeout;
};
}