Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
epg: add CEpgContainer::IsInitialising()
Browse files Browse the repository at this point in the history
  • Loading branch information
opdenkamp committed Aug 10, 2011
1 parent 1277a8c commit b5efeb7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
13 changes: 10 additions & 3 deletions xbmc/epg/EpgContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ CEpgContainer::CEpgContainer(void) :
m_progressDialog = NULL;
m_bStop = true;
m_bIsUpdating = false;
m_bIsInitialising = true;
m_iNextEpgId = 0;
m_bPreventUpdates = false;
m_updateEvent.Reset();
Expand Down Expand Up @@ -114,6 +115,7 @@ void CEpgContainer::Clear(bool bClearDb /* = false */)
}

m_iNextEpgUpdate = 0;
m_bIsInitialising = true;

lock.Leave();

Expand Down Expand Up @@ -168,7 +170,6 @@ void CEpgContainer::Process(void)
lock.Leave();

bool bUpdateEpg(true);
bool bShowProgress(true);
while (!m_bStop && !g_application.m_bStop)
{
CDateTime::GetCurrentDateTime().GetAsTime(iNow);
Expand All @@ -177,8 +178,8 @@ void CEpgContainer::Process(void)
lock.Leave();

/* load or update the EPG */
if (!InterruptUpdate() && bUpdateEpg)
bShowProgress = !UpdateEPG(bShowProgress);
if (!InterruptUpdate() && bUpdateEpg && UpdateEPG(m_bIsInitialising))
m_bIsInitialising = false;

/* clean up old entries */
if (!m_bStop && iNow >= m_iLastEpgCleanup)
Expand Down Expand Up @@ -584,3 +585,9 @@ bool CEpgContainer::CheckPlayingEvents(void)

return bReturn;
}

bool CEpgContainer::IsInitialising(void) const
{
CSingleLock lock(m_critSection);
return m_bIsInitialising;
}
6 changes: 6 additions & 0 deletions xbmc/epg/EpgContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ namespace EPG
*/
void PreventUpdates(bool bSetTo = true) { m_bPreventUpdates = bSetTo; }

/*!
* @return True while being initialised.
*/
bool IsInitialising(void) const;

protected:
/*!
* @brief Insert an epg into the table. If the table already contains an entry with the same id, then that entry will be replaced.
Expand Down Expand Up @@ -262,6 +267,7 @@ namespace EPG
/** @name Class state properties */
//@{
bool m_bIsUpdating; /*!< true while an update is running */
bool m_bIsInitialising; /*!< true while the epg manager hasn't loaded all tables */
bool m_bPreventUpdates; /*!< true to prevent EPG updates */
time_t m_iLastEpgCleanup; /*!< the time the EPG was cleaned up */
time_t m_iNextEpgUpdate; /*!< the time the EPG will be updated */
Expand Down

0 comments on commit b5efeb7

Please sign in to comment.