Exemple #1
0
bool CPVRChannel::ClearEPG() const
{
    CEpg *epg = GetEPG();
    if (epg)
        epg->Clear();

    return true;
}
Exemple #2
0
void CEpgContainer::Clear(bool bClearDb /* = false */)
{
  CSingleLock lock(m_critSection);

  /* make sure the update thread is stopped */
  bool bThreadRunning = !m_bStop;
  if (bThreadRunning && !Stop())
  {
    CLog::Log(LOGERROR, "%s - cannot stop the update thread", __FUNCTION__);
    return;
  }

  /* clear all epg tables and remove pointers to epg tables on channels */
  for (unsigned int iEpgPtr = 0; iEpgPtr < size(); iEpgPtr++)
  {
    CEpg *epg = at(iEpgPtr);
    epg->Clear();
  }

  /* remove all EPG tables */
  for (unsigned int iEpgPtr = 0; iEpgPtr < size(); iEpgPtr++)
  {
    delete at(iEpgPtr);
  }
  clear();

  /* clear the database entries */
  if (bClearDb)
  {
    if (m_database.Open())
    {
      m_database.DeleteEpg();
      m_database.Close();
    }
  }

  m_iLastEpgUpdate  = 0;
  m_bDatabaseLoaded = false;

  lock.Leave();

  if (bThreadRunning)
    Start();
}