Skip to content

Commit

Permalink
[epg] cosmetics: code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
xhaggi committed Apr 15, 2014
1 parent 551ba44 commit 40d52c7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
17 changes: 11 additions & 6 deletions xbmc/epg/GUIEPGGridContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ CGUIEPGGridContainer::CGUIEPGGridContainer(int parentID, int controlID, float po
m_programmeScrollOffset = 0;
m_programmeScrollSpeed = 0;
m_programmeScrollLastTime = 0;
m_programmesPerPage = 0;
m_channelsPerPage = 0;
m_channels = 0;
m_blocks = 0;
m_scrollTime = scrollTime ? scrollTime : 1;
m_item = NULL;
m_lastItem = NULL;
Expand All @@ -90,6 +94,7 @@ CGUIEPGGridContainer::CGUIEPGGridContainer(int parentID, int controlID, float po
m_cacheChannelItems = preloadItems;
m_cacheRulerItems = preloadItems;
m_cacheProgrammeItems = preloadItems;
m_wasReset = false;
}

CGUIEPGGridContainer::~CGUIEPGGridContainer(void)
Expand Down Expand Up @@ -354,7 +359,7 @@ void CGUIEPGGridContainer::ProcessProgrammeGrid(unsigned int currentTime, CDirty
break;

// Free memory not used on screen
FreeProgrammeMemory(channel, blockOffset - cacheBeforeProgramme, blockOffset + m_ProgrammesPerPage + 1 + cacheAfterProgramme);
FreeProgrammeMemory(channel, blockOffset - cacheBeforeProgramme, blockOffset + m_programmesPerPage + 1 + cacheAfterProgramme);

int block = blockOffset;
float posA2 = posA;
Expand Down Expand Up @@ -1086,7 +1091,7 @@ void CGUIEPGGridContainer::SetChannel(int channel)
{
if (m_blockCursor + m_blockOffset == 0 || m_blockOffset + m_blockCursor + GetItemSize(m_item) == m_blocks)
{
m_item = GetItem(channel);
m_item = GetItem(channel);
if (m_item)
{
SetBlock(GetBlock(m_item->item, channel));
Expand All @@ -1096,7 +1101,7 @@ void CGUIEPGGridContainer::SetChannel(int channel)
}

/* basic checks failed, need to correctly identify nearest item */
m_item = GetClosestItem(channel);
m_item = GetClosestItem(channel);
if (m_item)
{
m_channelCursor = channel;
Expand All @@ -1112,7 +1117,7 @@ void CGUIEPGGridContainer::SetBlock(int block)
m_blockCursor = m_blocksPerPage - 1;
else
m_blockCursor = block;
m_item = GetItem(m_channelCursor);
m_item = GetItem(m_channelCursor);
}

CGUIListItemLayout *CGUIEPGGridContainer::GetFocusedLayout() const
Expand Down Expand Up @@ -1328,7 +1333,7 @@ GridItemsPtr *CGUIEPGGridContainer::GetClosestItem(const int &channel)
{
GridItemsPtr *closest = GetItem(channel);

if(!closest)
if (!closest)
return NULL;

int block = GetBlock(closest->item, channel);
Expand Down Expand Up @@ -1697,7 +1702,7 @@ void CGUIEPGGridContainer::CalculateLayout()
m_rulerPosX = m_posX + m_channelWidth;
m_rulerPosY = m_posY;
m_channelsPerPage = (int)(m_gridHeight / m_channelHeight);
m_ProgrammesPerPage = (int)(m_gridWidth / m_blockSize) + 1;
m_programmesPerPage = (int)(m_gridWidth / m_blockSize) + 1;

// ensure that the scroll offsets are a multiple of our sizes
m_channelScrollOffset = m_channelOffset * m_programmeLayout->Size(VERTICAL);
Expand Down
18 changes: 8 additions & 10 deletions xbmc/epg/GUIEPGGridContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ namespace EPG
GridItemsPtr *GetPrevItem(const int &channel);
GridItemsPtr *GetClosestItem(const int &channel);

int GetItemSize(GridItemsPtr *item);
int GetBlock(const CGUIListItemPtr &item, const int &channel);
int GetRealBlock(const CGUIListItemPtr &item, const int &channel);
int GetItemSize(GridItemsPtr *item);
int GetBlock(const CGUIListItemPtr &item, const int &channel);
int GetRealBlock(const CGUIListItemPtr &item, const int &channel);
void MoveToRow(int row);

CGUIListItemLayout *GetFocusedLayout() const;
Expand Down Expand Up @@ -180,7 +180,7 @@ namespace EPG
int m_rulerUnit; //! number of blocks that makes up one element of the ruler
int m_channels;
int m_channelsPerPage;
int m_ProgrammesPerPage;
int m_programmesPerPage;
int m_channelCursor;
int m_channelOffset;
int m_blocks;
Expand All @@ -195,14 +195,14 @@ namespace EPG
float m_rulerPosY; //! Y position of first ruler item
float m_rulerHeight; //! height of the scrolling timeline above the ruler items
float m_rulerWidth; //! width of each element of the ruler
float m_channelPosX; //! Y position of first channel row
float m_channelPosX; //! X position of first channel row
float m_channelPosY; //! Y position of first channel row
float m_channelHeight; //! height of each channel row (& every grid item)
float m_channelHeight; //! height of the channel item
float m_channelWidth; //! width of the channel item
float m_gridPosX; //! X position of first grid item
float m_gridPosY; //! Y position of first grid item
float m_gridWidth;
float m_gridHeight;
float m_gridWidth; //! width of the epg grid control
float m_gridHeight; //! height of the epg grid control
float m_blockSize; //! a block's width in pixels
float m_analogScrollCount;

Expand All @@ -225,7 +225,5 @@ namespace EPG
int m_channelScrollLastTime;
float m_channelScrollSpeed;
float m_channelScrollOffset;

CStdString m_label;
};
}

0 comments on commit 40d52c7

Please sign in to comment.