Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

pvr: EPG content-progress indicator

  • Loading branch information...
commit 55ecae7a17fa7e78d874fb27d43813c8e4b7d0ae 1 parent c399959
@xhaggi xhaggi authored
View
1  addons/skin.confluence/720p/ViewsPVR.xml
@@ -855,6 +855,7 @@
<scrolltime>350</scrolltime>
<timeblocks>40</timeblocks>
<rulerunit>6</rulerunit>
+ <progresstexture border="5">PVR-EpgProgressIndicator.png</progresstexture>
<onleft>31</onleft>
<onright>31</onright>
<onup>10</onup>
View
BIN  addons/skin.confluence/media/PVR-EpgProgressIndicator.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
8 xbmc/XBDateTime.cpp
@@ -211,6 +211,14 @@ int CDateTimeSpan::GetSeconds() const
return (int)(((time.QuadPart/SECONDS_TO_FILETIME%SECONDS_PER_DAY)%SECONDS_PER_HOUR)%SECONDS_PER_MINUTE)%SECONDS_PER_MINUTE;
}
+int CDateTimeSpan::GetSecondsTotal() const
+{
+ ULARGE_INTEGER time;
+ ToULargeInt(time);
+
+ return (int)(time.QuadPart/SECONDS_TO_FILETIME);
+}
+
void CDateTimeSpan::SetFromPeriod(const CStdString &period)
{
long days = atoi(period.c_str());
View
1  xbmc/XBDateTime.h
@@ -72,6 +72,7 @@ class CDateTimeSpan
int GetHours() const;
int GetMinutes() const;
int GetSeconds() const;
+ int GetSecondsTotal() const;
private:
void ToULargeInt(ULARGE_INTEGER& time) const;
View
40 xbmc/epg/GUIEPGGridContainer.cpp
@@ -46,8 +46,9 @@ using namespace std;
CGUIEPGGridContainer::CGUIEPGGridContainer(int parentID, int controlID, float posX, float posY, float width,
float height, ORIENTATION orientation, int scrollTime,
- int preloadItems, int timeBlocks, int rulerUnit)
+ int preloadItems, int timeBlocks, int rulerUnit, const CTextureInfo& progressIndicatorTexture)
: IGUIContainer(parentID, controlID, posX, posY, width, height)
+ , m_guiProgressIndicatorTexture(posX, posY, width, height, progressIndicatorTexture)
{
ControlType = GUICONTAINER_EPGGRID;
m_blocksPerPage = timeBlocks;
@@ -108,6 +109,7 @@ void CGUIEPGGridContainer::Process(unsigned int currentTime, CDirtyRegionList &d
ProcessChannels(currentTime, dirtyregions);
ProcessRuler(currentTime, dirtyregions);
ProcessProgrammeGrid(currentTime, dirtyregions);
+ ProcessProgressIndicator(currentTime, dirtyregions);
CGUIControl::Process(currentTime, dirtyregions);
}
@@ -117,6 +119,7 @@ void CGUIEPGGridContainer::Render()
RenderChannels();
RenderRuler();
RenderProgrammeGrid();
+ RenderProgressIndicator();
CGUIControl::Render();
}
@@ -540,6 +543,41 @@ void CGUIEPGGridContainer::RenderProgrammeGrid()
g_graphicsContext.RestoreClipRegion();
}
+void CGUIEPGGridContainer::ProcessProgressIndicator(unsigned int currentTime, CDirtyRegionList &dirtyregions)
+{
+ CPoint originRuler = CPoint(m_rulerPosX, m_rulerPosY) + m_renderOffset;
+ float width = ((CDateTime::GetUTCDateTime() - m_gridStart).GetSecondsTotal() * m_blockSize) / (MINSPERBLOCK * 60) - m_programmeScrollOffset;
+
+ if (m_orientation == VERTICAL)
+ {
+ m_guiProgressIndicatorTexture.SetWidth(width);
+ m_guiProgressIndicatorTexture.SetPosition(originRuler.x, originRuler.y);
+ }
+ else
+ {
+ m_guiProgressIndicatorTexture.SetHeight(width);
+ m_guiProgressIndicatorTexture.SetPosition(originRuler.x, originRuler.y);
+ }
+
+ m_guiProgressIndicatorTexture.Process(currentTime);
+}
+
+void CGUIEPGGridContainer::RenderProgressIndicator()
+{
+ bool render = false;
+
+ if (m_orientation == VERTICAL)
+ render = g_graphicsContext.SetClipRegion(m_rulerPosX, m_rulerPosY, m_gridWidth, m_height);
+ else
+ render = g_graphicsContext.SetClipRegion(m_rulerPosX, m_rulerPosY, m_width, m_gridHeight);
+
+ if(render)
+ {
+ m_guiProgressIndicatorTexture.Render();
+ g_graphicsContext.RestoreClipRegion();
+ }
+}
+
void CGUIEPGGridContainer::ProcessItem(float posX, float posY, CGUIListItem* item, CGUIListItem *&lastitem,
bool focused, CGUIListItemLayout* normallayout, CGUIListItemLayout* focusedlayout,
unsigned int currentTime, CDirtyRegionList &dirtyregions, float resize /* = -1.0f */)
View
6 xbmc/epg/GUIEPGGridContainer.h
@@ -50,7 +50,7 @@ namespace EPG
public:
CGUIEPGGridContainer(int parentID, int controlID, float posX, float posY, float width, float height,
ORIENTATION orientation, int scrollTime, int preloadItems, int minutesPerPage,
- int rulerUnit);
+ int rulerUnit, const CTextureInfo& progressIndicatorTexture);
virtual ~CGUIEPGGridContainer(void);
virtual CGUIEPGGridContainer *Clone() const { return new CGUIEPGGridContainer(*this); };
@@ -136,9 +136,11 @@ namespace EPG
void ProcessChannels(unsigned int currentTime, CDirtyRegionList &dirtyregions);
void ProcessRuler(unsigned int currentTime, CDirtyRegionList &dirtyregions);
void ProcessProgrammeGrid(unsigned int currentTime, CDirtyRegionList &dirtyregions);
+ void ProcessProgressIndicator(unsigned int currentTime, CDirtyRegionList &dirtyregions);
void RenderChannels();
void RenderRuler();
void RenderProgrammeGrid();
+ void RenderProgressIndicator();
CPoint m_renderOffset; ///< \brief render offset of the first item in the list \sa SetRenderOffset
@@ -212,6 +214,8 @@ namespace EPG
CDateTime m_gridStart;
CDateTime m_gridEnd;
+ CGUITexture m_guiProgressIndicatorTexture;
+
struct GridItemsPtr **m_gridIndex;
GridItemsPtr *m_item;
CGUIListItem *m_lastItem;
View
4 xbmc/guilib/GUIControlFactory.cpp
@@ -620,6 +620,7 @@ CGUIControl* CGUIControlFactory::Create(int parentID, const CRect &rect, TiXmlEl
CTextureInfo textureRadioOnFocus, textureRadioOnNoFocus;
CTextureInfo textureRadioOffFocus, textureRadioOffNoFocus;
CTextureInfo imageNoFocus, imageFocus;
+ CTextureInfo textureProgressIndicator;
CGUIInfoLabel texturePath;
CRect borderSize;
@@ -907,6 +908,7 @@ CGUIControl* CGUIControlFactory::Create(int parentID, const CRect &rect, TiXmlEl
XMLUtils::GetBoolean(pControlNode,"pulseonselect", bPulse);
XMLUtils::GetInt(pControlNode, "timeblocks", timeBlocks);
XMLUtils::GetInt(pControlNode, "rulerunit", rulerUnit);
+ GetTexture(pControlNode, "progresstexture", textureProgressIndicator);
GetInfoTexture(pControlNode, "imagepath", texture, texturePath, parentID);
@@ -1251,7 +1253,7 @@ CGUIControl* CGUIControlFactory::Create(int parentID, const CRect &rect, TiXmlEl
}
else if (type == CGUIControl::GUICONTAINER_EPGGRID)
{
- control = new CGUIEPGGridContainer(parentID, id, posX, posY, width, height, orientation, scrollTime, preloadItems, timeBlocks, rulerUnit);
+ control = new CGUIEPGGridContainer(parentID, id, posX, posY, width, height, orientation, scrollTime, preloadItems, timeBlocks, rulerUnit, textureProgressIndicator);
((CGUIEPGGridContainer *)control)->LoadLayout(pControlNode);
((CGUIEPGGridContainer *)control)->SetRenderOffset(offset);
((CGUIEPGGridContainer *)control)->SetType(viewType, viewLabel);
Please sign in to comment.
Something went wrong with that request. Please try again.