Пример #1
0
bool CPVRTimers::GetRootDirectory(const CPVRTimersPath &path, CFileItemList &items) const
{
  CFileItemPtr item(new CFileItem(CPVRTimersPath::PATH_ADDTIMER, false));
  item->SetLabel(g_localizeStrings.Get(19026)); // "Add timer..."
  item->SetLabelPreformated(true);
  item->SetSpecialSort(SortSpecialOnTop);
  items.Add(item);

  bool bRadio   = path.IsRadio();
  bool bGrouped = path.IsGrouped();

  CSingleLock lock(m_critSection);
  for (const auto &tagsEntry : m_tags)
  {
    for (const auto &timer : *tagsEntry.second)
    {
      if ((bRadio == timer->m_bIsRadio) &&
          (!bGrouped || (timer->m_iParentClientIndex == PVR_TIMER_NO_PARENT)))
      {
        item.reset(new CFileItem(timer));
        std::string strItemPath(
          CPVRTimersPath(path.GetPath(), timer->m_iClientId, timer->m_iClientIndex).GetPath());
        item->SetPath(strItemPath);
        items.Add(item);
      }
    }
  }
  return true;
}
Пример #2
0
bool CPVRTimers::GetRootDirectory(const CPVRTimersPath &path, CFileItemList &items) const
{
    CFileItemPtr item(new CFileItem(CPVRTimersPath::PATH_ADDTIMER, false));
    item->SetLabel(g_localizeStrings.Get(19026)); // "Add timer..."
    item->SetLabelPreformated(true);
    item->SetSpecialSort(SortSpecialOnTop);
    items.Add(item);

    bool bRadio = path.IsRadio();
    bool bRules = path.IsRules();

    bool bHideDisabled = CSettings::GetInstance().GetBool(CSettings::SETTING_PVRTIMERS_HIDEDISABLEDTIMERS);

    CSingleLock lock(m_critSection);
    for (const auto &tagsEntry : m_tags)
    {
        for (const auto &timer : *tagsEntry.second)
        {
            if ((bRadio == timer->m_bIsRadio) &&
                    (bRules == timer->IsRepeating()) &&
                    (!bHideDisabled || (timer->m_state != PVR_TIMER_STATE_DISABLED)))
            {
                item.reset(new CFileItem(timer));
                std::string strItemPath(
                    CPVRTimersPath(path.GetPath(), timer->m_iClientId, timer->m_iClientIndex).GetPath());
                item->SetPath(strItemPath);
                items.Add(item);
            }
        }
    }
    return true;
}
Пример #3
0
bool CPVRTimers::GetSubDirectory(const CPVRTimersPath &path, CFileItemList &items) const
{
    bool         bRadio    = path.IsRadio();
    unsigned int iParentId = path.GetParentId();
    int          iClientId = path.GetClientId();

    bool bHideDisabled = CSettings::GetInstance().GetBool(CSettings::SETTING_PVRTIMERS_HIDEDISABLEDTIMERS);

    CFileItemPtr item;

    CSingleLock lock(m_critSection);
    for (const auto &tagsEntry : m_tags)
    {
        for (const auto &timer : *tagsEntry.second)
        {
            if ((timer->m_bIsRadio == bRadio) &&
                    (timer->m_iParentClientIndex != PVR_TIMER_NO_PARENT) &&
                    (timer->m_iClientId == iClientId) &&
                    (timer->m_iParentClientIndex == iParentId) &&
                    (!bHideDisabled || (timer->m_state != PVR_TIMER_STATE_DISABLED)))
            {
                item.reset(new CFileItem(timer));
                std::string strItemPath(
                    CPVRTimersPath(path.GetPath(), timer->m_iClientId, timer->m_iClientIndex).GetPath());
                item->SetPath(strItemPath);
                items.Add(item);
            }
        }
    }
    return true;
}
Пример #4
0
bool CPVRTimers::GetSubDirectory(const CPVRTimersPath &path, CFileItemList &items) const
{
  bool         bRadio    = path.IsRadio();
  unsigned int iParentId = path.GetParentId();
  int          iClientId = path.GetClientId();

  CFileItemPtr item;

  CSingleLock lock(m_critSection);
  for (const auto &tagsEntry : m_tags)
  {
    for (const auto &timer : *tagsEntry.second)
    {
      if ((timer->m_bIsRadio == bRadio) &&
          (timer->m_iParentClientIndex != PVR_TIMER_NO_PARENT) &&
          (timer->m_iClientId == iClientId) &&
          (timer->m_iParentClientIndex == iParentId))
      {
        item.reset(new CFileItem(timer));
        std::string strItemPath(
          CPVRTimersPath(path.GetPath(), timer->m_iClientId, timer->m_iClientIndex).GetPath());
        item->SetPath(strItemPath);
        items.Add(item);
      }
    }
  }
  return true;
}