Skip to content

Commit

Permalink
CEpgInfoTag: add Progress() method to return the progress in seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
Montellese committed Oct 16, 2012
1 parent 21f7d94 commit dff18a0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
15 changes: 15 additions & 0 deletions xbmc/epg/EpgInfoTag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,21 @@ float CEpgInfoTag::ProgressPercentage(void) const
return fReturn;
}

int CEpgInfoTag::Progress(void) const
{
int iDuration;
time_t currentTime, startTime;
CDateTime::GetCurrentDateTime().GetAsUTCDateTime().GetAsTime(currentTime);

CSingleLock lock(m_critSection);
m_startTime.GetAsTime(startTime);
iDuration = currentTime - startTime;
if (iDuration <= 0)
return 0;

return iDuration;
}

CEpgInfoTagPtr CEpgInfoTag::GetNextEvent(void) const
{
return GetTable()->GetNextEvent(*this);
Expand Down
5 changes: 5 additions & 0 deletions xbmc/epg/EpgInfoTag.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ namespace EPG
*/
float ProgressPercentage(void) const;

/*!
* @return The current progress of this tag in seconds.
*/
int Progress(void) const;

/*!
* @brief Get a pointer to the next event. Set by CEpg in a call to Sort()
* @return A pointer to the next event or NULL if it's not set.
Expand Down

0 comments on commit dff18a0

Please sign in to comment.