当前位置: 首页>>代码示例>>C++>>正文


C++ CFileItemPtr::GetPVRTimerInfoTag方法代码示例

本文整理汇总了C++中CFileItemPtr::GetPVRTimerInfoTag方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItemPtr::GetPVRTimerInfoTag方法的具体用法?C++ CFileItemPtr::GetPVRTimerInfoTag怎么用?C++ CFileItemPtr::GetPVRTimerInfoTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CFileItemPtr的用法示例。


在下文中一共展示了CFileItemPtr::GetPVRTimerInfoTag方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetContextButtons

void CGUIWindowPVRTimers::GetContextButtons(int itemNumber, CContextButtons &buttons)
{
  if (itemNumber < 0 || itemNumber >= m_vecItems->Size())
    return;
  CFileItemPtr pItem = m_vecItems->Get(itemNumber);

  /* Check for a empty file item list, means only a
     file item with the name "Add timer..." is present */
  if (URIUtils::PathEquals(pItem->GetPath(), "pvr://timers/addtimer/"))
  {
    buttons.Add(CONTEXT_BUTTON_ADD, 19056);             /* new timer */
  }
  else
  {
    buttons.Add(CONTEXT_BUTTON_FIND, 19003);            /* Find similar program */
    buttons.Add(CONTEXT_BUTTON_ACTIVATE, 19058);        /* activate/deactivate */
    buttons.Add(CONTEXT_BUTTON_DELETE, 117);            /* delete timer */
    buttons.Add(CONTEXT_BUTTON_EDIT, 19057);            /* edit timer */
    buttons.Add(CONTEXT_BUTTON_RENAME, 118);            /* rename timer */
    buttons.Add(CONTEXT_BUTTON_ADD, 19056);             /* new timer */
    if (g_PVRClients->HasMenuHooks(pItem->GetPVRTimerInfoTag()->m_iClientId, PVR_MENUHOOK_TIMER))
      buttons.Add(CONTEXT_BUTTON_MENU_HOOKS, 19195);    /* PVR client specific action */
  }

  CGUIWindowPVRBase::GetContextButtons(itemNumber, buttons);
  CContextMenuManager::Get().AddVisibleItems(pItem, buttons);
}
开发者ID:halotestin,项目名称:xbmc,代码行数:27,代码来源:GUIWindowPVRTimers.cpp

示例2: FilterTimers

int EpgSearchFilter::FilterTimers(CFileItemList &results)
{
  int iRemoved(0);
  if (!g_PVRManager.IsStarted())
    return iRemoved;

  vector<CFileItemPtr> timers = g_PVRTimers->GetActiveTimers();
  // TODO inefficient!
  for (unsigned int iTimerPtr = 0; iTimerPtr < timers.size(); iTimerPtr++)
  {
    CFileItemPtr fileItem = timers.at(iTimerPtr);
    if (!fileItem || !fileItem->HasPVRTimerInfoTag())
      continue;

    CPVRTimerInfoTag *timer = fileItem->GetPVRTimerInfoTag();
    if (!timer)
      continue;

    for (int iResultPtr = 0; iResultPtr < results.Size(); iResultPtr++)
    {
      const CEpgInfoTagPtr epgentry(results.Get(iResultPtr)->GetEPGInfoTag());
      if (!epgentry ||
          *epgentry->ChannelTag() != *timer->ChannelTag() ||
          epgentry->StartAsUTC()   <  timer->StartAsUTC() ||
          epgentry->EndAsUTC()     >  timer->EndAsUTC())
        continue;

      results.Remove(iResultPtr);
      iResultPtr--;
      ++iRemoved;
    }
  }

  return iRemoved;
}
开发者ID:Jmend25,项目名称:boxeebox-xbmc,代码行数:35,代码来源:EpgSearchFilter.cpp

示例3: AllLocalBackendsIdle

bool CPVRManager::AllLocalBackendsIdle(CPVRTimerInfoTagPtr& causingEvent) const
{
  if (m_timers)
  {
    // active recording on local backend?
    std::vector<CFileItemPtr> recordings = m_timers->GetActiveRecordings();
    for (std::vector<CFileItemPtr>::const_iterator timerIt = recordings.begin(); timerIt != recordings.end(); ++timerIt)
    {
      if (EventOccursOnLocalBackend(*timerIt))
      {
        causingEvent = (*timerIt)->GetPVRTimerInfoTag();
        return false;
      }
    }

    // soon recording on local backend?
    if (IsNextEventWithinBackendIdleTime())
    {
      CFileItemPtr item = m_timers->GetNextActiveTimer();
      if (item.get() == NULL)
      {
        // Next event is due to automatic daily wakeup of PVR!
        causingEvent.reset();
        return false;
      }

      if (EventOccursOnLocalBackend(item))
      {
        causingEvent = item->GetPVRTimerInfoTag();
        return false;
      }
    }
  }
  return true;
}
开发者ID:dpvip,项目名称:xbmc,代码行数:35,代码来源:PVRManager.cpp

示例4: lock

void CPVRGUIInfo::TimerInfo::UpdateNextTimer()
{
  std::string strNextRecordingTitle;
  std::string strNextRecordingChannelName;
  std::string strNextRecordingChannelIcon;
  std::string strNextRecordingTime;
  std::string strNextTimerInfo;

  CFileItemPtr tag = GetNextActiveTimer();
  if (tag && tag->HasPVRTimerInfoTag())
  {
    CPVRTimerInfoTagPtr timer = tag->GetPVRTimerInfoTag();
    strNextRecordingTitle = StringUtils::Format("%s",       timer->Title().c_str());
    strNextRecordingChannelName = StringUtils::Format("%s", timer->ChannelName().c_str());
    strNextRecordingChannelIcon = StringUtils::Format("%s", timer->ChannelIcon().c_str());
    strNextRecordingTime = StringUtils::Format("%s",        timer->StartAsLocalTime().GetAsLocalizedDateTime(false, false).c_str());

    strNextTimerInfo = StringUtils::Format("%s %s %s %s",
        g_localizeStrings.Get(19106).c_str(),
        timer->StartAsLocalTime().GetAsLocalizedDate(true).c_str(),
        g_localizeStrings.Get(19107).c_str(),
        timer->StartAsLocalTime().GetAsLocalizedTime("HH:mm", false).c_str());
  }

  CSingleLock lock(m_critSection);
  m_strNextRecordingTitle       = strNextRecordingTitle;
  m_strNextRecordingChannelName = strNextRecordingChannelName;
  m_strNextRecordingChannelIcon = strNextRecordingChannelIcon;
  m_strNextRecordingTime        = strNextRecordingTime;
  m_strNextTimerInfo            = strNextTimerInfo;
}
开发者ID:AchimTuran,项目名称:xbmc,代码行数:31,代码来源:PVRGUIInfo.cpp

示例5: GetContextButtons

void CGUIWindowPVRGuide::GetContextButtons(int itemNumber, CContextButtons &buttons) const
{
  if (itemNumber < 0 || itemNumber >= m_parent->m_vecItems->Size())
    return;
  CFileItemPtr pItem = m_parent->m_vecItems->Get(itemNumber);

  CFileItemPtr timer = g_PVRTimers->GetTimerForEpgTag(pItem.get());
  if (timer && timer->HasPVRTimerInfoTag())
  {
    if (timer->GetPVRTimerInfoTag()->IsRecording())
      buttons.Add(CONTEXT_BUTTON_STOP_RECORD, 19059);  /* stop recording */
    else
      buttons.Add(CONTEXT_BUTTON_STOP_RECORD, 19060);  /* delete timer */
  }
  else if (pItem->GetEPGInfoTag()->EndAsLocalTime() > CDateTime::GetCurrentDateTime())
  {
    if (pItem->GetEPGInfoTag()->StartAsLocalTime() < CDateTime::GetCurrentDateTime())
      buttons.Add(CONTEXT_BUTTON_START_RECORD, 264);   /* record */
    else
      buttons.Add(CONTEXT_BUTTON_START_RECORD, 19061); /* add timer */
  }

  buttons.Add(CONTEXT_BUTTON_INFO, 19047);              /* epg info */
  buttons.Add(CONTEXT_BUTTON_PLAY_ITEM, 19000);         /* switch channel */
  buttons.Add(CONTEXT_BUTTON_FIND, 19003);              /* find similar program */
  if (m_iGuideView == GUIDE_VIEW_TIMELINE)
  {
    buttons.Add(CONTEXT_BUTTON_BEGIN, 19063);           /* go to begin */
    buttons.Add(CONTEXT_BUTTON_END, 19064);             /* go to end */
  }
  if (pItem->GetEPGInfoTag()->HasPVRChannel() &&
      g_PVRClients->HasMenuHooks(pItem->GetEPGInfoTag()->ChannelTag()->ClientID(), PVR_MENUHOOK_EPG))
    buttons.Add(CONTEXT_BUTTON_MENU_HOOKS, 19195);      /* PVR client specific action */
}
开发者ID:madhatterpa,项目名称:xbmc,代码行数:34,代码来源:GUIWindowPVRGuide.cpp

示例6: UpdateNextTimer

void CPVRGUIInfo::UpdateNextTimer(void)
{
  CStdString strNextRecordingTitle;
  CStdString strNextRecordingChannelName;
  CStdString strNextRecordingChannelIcon;
  CStdString strNextRecordingTime;
  CStdString strNextTimerInfo;

  CFileItemPtr tag = g_PVRTimers->GetNextActiveTimer();
  if (tag && tag->HasPVRTimerInfoTag())
  {
    CPVRTimerInfoTag *timer = tag->GetPVRTimerInfoTag();
    strNextRecordingTitle.Format("%s",       timer->Title());
    strNextRecordingChannelName.Format("%s", timer->ChannelName());
    strNextRecordingChannelIcon.Format("%s", timer->ChannelIcon());
    strNextRecordingTime.Format("%s",        timer->StartAsLocalTime().GetAsLocalizedDateTime(false, false));

    strNextTimerInfo.Format("%s %s %s %s",
        g_localizeStrings.Get(19106),
        timer->StartAsLocalTime().GetAsLocalizedDate(true),
        g_localizeStrings.Get(19107),
        timer->StartAsLocalTime().GetAsLocalizedTime("HH:mm", false));
  }

  CSingleLock lock(m_critSection);
  m_strNextRecordingTitle       = strNextRecordingTitle;
  m_strNextRecordingChannelName = strNextRecordingChannelName;
  m_strNextRecordingChannelIcon = strNextRecordingChannelIcon;
  m_strNextRecordingTime        = strNextRecordingTime;
  m_strNextTimerInfo            = strNextTimerInfo;
}
开发者ID:A600,项目名称:xbmc,代码行数:31,代码来源:PVRGUIInfo.cpp

示例7: ActionCancelTimer

bool CGUIDialogPVRGuideInfo::ActionCancelTimer(CFileItemPtr timer)
{
  bool bReturn = false;
  if (!timer || !timer->HasPVRTimerInfoTag())
  {
    return bReturn;
  }

  // prompt user for confirmation of timer deletion
  CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);

  if (pDialog)
  {
    pDialog->SetHeading(265);
    pDialog->SetLine(0, "");
    pDialog->SetLine(1, timer->GetPVRTimerInfoTag()->m_strTitle);
    pDialog->SetLine(2, "");
    pDialog->DoModal();

    if (pDialog->IsConfirmed())
    {
      Close();
      bReturn = CPVRTimers::DeleteTimer(*timer);
    }
  }

  return bReturn;
}
开发者ID:2BReality,项目名称:xbmc,代码行数:28,代码来源:GUIDialogPVRGuideInfo.cpp

示例8: GetContextButtons

void CGUIWindowPVRGuide::GetContextButtons(int itemNumber, CContextButtons &buttons)
{
  if (itemNumber < 0 || itemNumber >= m_vecItems->Size())
    return;
  CFileItemPtr pItem = m_vecItems->Get(itemNumber);

  buttons.Add(CONTEXT_BUTTON_PLAY_ITEM, 19000);         /* switch channel */

  if (pItem->HasEPGInfoTag() && pItem->GetEPGInfoTag()->HasRecording())
    buttons.Add(CONTEXT_BUTTON_PLAY_OTHER, 19687);      /* play recording */

  CFileItemPtr timer = g_PVRTimers->GetTimerForEpgTag(pItem.get());
  if (timer && timer->HasPVRTimerInfoTag())
  {
    if (timer->GetPVRTimerInfoTag()->IsRecording())
      buttons.Add(CONTEXT_BUTTON_STOP_RECORD, 19059);  /* stop recording */
    else if (timer->GetPVRTimerInfoTag()->HasTimerType() &&
             !timer->GetPVRTimerInfoTag()->GetTimerType()->IsReadOnly())
      buttons.Add(CONTEXT_BUTTON_STOP_RECORD, 19060);  /* delete timer */
  }
  else if (pItem->HasEPGInfoTag() && pItem->GetEPGInfoTag()->EndAsLocalTime() > CDateTime::GetCurrentDateTime())
  {
    if (pItem->GetEPGInfoTag()->StartAsLocalTime() < CDateTime::GetCurrentDateTime())
      buttons.Add(CONTEXT_BUTTON_START_RECORD, 264);   /* record */

    buttons.Add(CONTEXT_BUTTON_START_RECORD, 19061);   /* add timer */
    buttons.Add(CONTEXT_BUTTON_ADVANCED_RECORD, 841);  /* add custom timer */
  }

  buttons.Add(CONTEXT_BUTTON_INFO, 19047);              /* epg info */
  buttons.Add(CONTEXT_BUTTON_FIND, 19003);              /* find similar program */

  if (m_viewControl.GetCurrentControl() == GUIDE_VIEW_TIMELINE)
  {
    buttons.Add(CONTEXT_BUTTON_BEGIN, 19063);           /* go to begin */
    buttons.Add(CONTEXT_BUTTON_NOW, 19070);             /* go to now */
    buttons.Add(CONTEXT_BUTTON_END, 19064);             /* go to end */
  }

  if (pItem->HasEPGInfoTag() &&
      pItem->GetEPGInfoTag()->HasPVRChannel() &&
      g_PVRClients->HasMenuHooks(pItem->GetEPGInfoTag()->ChannelTag()->ClientID(), PVR_MENUHOOK_EPG))
    buttons.Add(CONTEXT_BUTTON_MENU_HOOKS, 19195);      /* PVR client specific action */

  CGUIWindowPVRBase::GetContextButtons(itemNumber, buttons);
  CContextMenuManager::Get().AddVisibleItems(pItem, buttons);
}
开发者ID:kisshine,项目名称:xbmc,代码行数:47,代码来源:GUIWindowPVRGuide.cpp

示例9: OnInitWindow

void CGUIDialogPVRGuideInfo::OnInitWindow()
{
  CGUIDialog::OnInitWindow();

  const CEpgInfoTagPtr tag(m_progItem->GetEPGInfoTag());
  if (!tag)
  {
    /* no epg event selected */
    return;
  }

  if (!tag->HasRecording())
  {
    /* not recording. hide the play recording button */
    SET_CONTROL_HIDDEN(CONTROL_BTN_PLAY_RECORDING);
  }

  if (tag->EndAsLocalTime() <= CDateTime::GetCurrentDateTime())
  {
    /* event has passed. hide the record button */
    SET_CONTROL_HIDDEN(CONTROL_BTN_RECORD);
    return;
  }

  CFileItemPtr match = g_PVRTimers->GetTimerForEpgTag(m_progItem.get());
  if (!match || !match->HasPVRTimerInfoTag())
  {
    /* no timer present on this tag */
    if (tag->StartAsLocalTime() < CDateTime::GetCurrentDateTime())
      SET_CONTROL_LABEL(CONTROL_BTN_RECORD, 264);    // Record
    else
      SET_CONTROL_LABEL(CONTROL_BTN_RECORD, 19061);  // Add timer
  }
  else
  {
    /* timer present on this tag */
    if (tag->StartAsLocalTime() < CDateTime::GetCurrentDateTime())
      SET_CONTROL_LABEL(CONTROL_BTN_RECORD, 19059);  // Stop recording
    else if (match->HasPVRTimerInfoTag() &&
             match->GetPVRTimerInfoTag()->HasTimerType() &&
             !match->GetPVRTimerInfoTag()->GetTimerType()->IsReadOnly())
      SET_CONTROL_LABEL(CONTROL_BTN_RECORD, 19060);  // Delete timer
    else
      SET_CONTROL_HIDDEN(CONTROL_BTN_RECORD);
  }
}
开发者ID:evilhamster,项目名称:xbmc,代码行数:46,代码来源:GUIDialogPVRGuideInfo.cpp

示例10: GetNextEventTime

CDateTime CPVRTimers::GetNextEventTime(void) const
{
  const bool dailywakup = CSettings::Get().GetBool("pvrpowermanagement.dailywakeup");
  const CDateTime now = CDateTime::GetUTCDateTime();
  const CDateTimeSpan prewakeup(0, 0, CSettings::Get().GetInt("pvrpowermanagement.prewakeup"), 0);
  const CDateTimeSpan idle(0, 0, CSettings::Get().GetInt("pvrpowermanagement.backendidletime"), 0);

  CDateTime wakeuptime;

  /* Check next active time */
  CFileItemPtr item = GetNextActiveTimer();
  if (item && item->HasPVRTimerInfoTag())
  {
    const CDateTimeSpan prestart(0, 0, item->GetPVRTimerInfoTag()->MarginStart(), 0);
    const CDateTime start = item->GetPVRTimerInfoTag()->StartAsUTC();
    wakeuptime = ((start - prestart - prewakeup - idle) > now) ?
        start - prestart - prewakeup :
        now + idle;
  }

  /* check daily wake up */
  if (dailywakup)
  {
    CDateTime dailywakeuptime;
    dailywakeuptime.SetFromDBTime(CSettings::Get().GetString("pvrpowermanagement.dailywakeuptime"));
    dailywakeuptime = dailywakeuptime.GetAsUTCDateTime();

    dailywakeuptime.SetDateTime(
      now.GetYear(), now.GetMonth(), now.GetDay(),
      dailywakeuptime.GetHour(), dailywakeuptime.GetMinute(), dailywakeuptime.GetSecond()
    );

    if ((dailywakeuptime - idle) < now)
    {
      const CDateTimeSpan oneDay(1,0,0,0);
      dailywakeuptime += oneDay;
    }
    if (!wakeuptime.IsValid() || dailywakeuptime < wakeuptime)
      wakeuptime = dailywakeuptime;
  }

  const CDateTime retVal(wakeuptime);
  return retVal;
}
开发者ID:FoodDelivery,项目名称:xbmc,代码行数:44,代码来源:PVRTimers.cpp

示例11: GetNextEventTime

CDateTime CPVRTimers::GetNextEventTime(void) const
{
  const bool dailywakup = CSettings::GetInstance().GetBool(CSettings::SETTING_PVRPOWERMANAGEMENT_DAILYWAKEUP);
  const CDateTime now = CDateTime::GetUTCDateTime();
  const CDateTimeSpan prewakeup(0, 0, CSettings::GetInstance().GetInt(CSettings::SETTING_PVRPOWERMANAGEMENT_PREWAKEUP), 0);
  const CDateTimeSpan idle(0, 0, CSettings::GetInstance().GetInt(CSettings::SETTING_PVRPOWERMANAGEMENT_BACKENDIDLETIME), 0);

  CDateTime wakeuptime;

  /* Check next active time */
  CFileItemPtr item = GetNextActiveTimer();
  if (item && item->HasPVRTimerInfoTag())
  {
    const CDateTimeSpan prestart(0, 0, item->GetPVRTimerInfoTag()->MarginStart(), 0);
    const CDateTime start = item->GetPVRTimerInfoTag()->StartAsUTC();
    wakeuptime = ((start - prestart - prewakeup - idle) > now) ?
        start - prestart - prewakeup :
        now + idle;
  }

  /* check daily wake up */
  if (dailywakup)
  {
    CDateTime dailywakeuptime;
    dailywakeuptime.SetFromDBTime(CSettings::GetInstance().GetString(CSettings::SETTING_PVRPOWERMANAGEMENT_DAILYWAKEUPTIME));
    dailywakeuptime = dailywakeuptime.GetAsUTCDateTime();

    dailywakeuptime.SetDateTime(
      now.GetYear(), now.GetMonth(), now.GetDay(),
      dailywakeuptime.GetHour(), dailywakeuptime.GetMinute(), dailywakeuptime.GetSecond()
    );

    if ((dailywakeuptime - idle) < now)
    {
      const CDateTimeSpan oneDay(1,0,0,0);
      dailywakeuptime += oneDay;
    }
    if (!wakeuptime.IsValid() || dailywakeuptime < wakeuptime)
      wakeuptime = dailywakeuptime;
  }

  const CDateTime retVal(wakeuptime);
  return retVal;
}
开发者ID:sandalsoft,项目名称:mrmc,代码行数:44,代码来源:PVRTimers.cpp

示例12: DeleteTimer

bool CGUIWindowPVRBase::DeleteTimer(CFileItem *item, bool bIsRecording)
{
  CFileItemPtr timer;

  if (item->IsPVRTimer())
  {
    timer.reset(new CFileItem(*item));
  }
  else if (item->IsEPG())
  {
    timer = g_PVRTimers->GetTimerForEpgTag(item);
  }
  else if (item->IsPVRChannel())
  {
    CPVRChannelPtr channel(item->GetPVRChannelInfoTag());
    if (!channel)
      return false;

    CFileItemPtr epgNow(new CFileItem(channel->GetEPGNow()));
    timer = g_PVRTimers->GetTimerForEpgTag(epgNow.get());
  }

  if (!timer || !timer->HasPVRTimerInfoTag())
    return false;

  if (bIsRecording)
  {
    if (ConfirmStopRecording(timer.get()))
      return CPVRTimers::DeleteTimer(*timer, true, false);
  }
  else if (timer->GetPVRTimerInfoTag()->HasTimerType() &&
           timer->GetPVRTimerInfoTag()->GetTimerType()->IsReadOnly())
  {
    return false;
  }
  else
  {
    bool bDeleteSchedule(false);
    if (ConfirmDeleteTimer(timer.get(), bDeleteSchedule))
      return CPVRTimers::DeleteTimer(*timer, false, bDeleteSchedule);
  }
  return false;
}
开发者ID:MrMC,项目名称:mrmc,代码行数:43,代码来源:GUIWindowPVRBase.cpp

示例13: EventOccursOnLocalBackend

bool CPVRManager::EventOccursOnLocalBackend(const CFileItemPtr& item) const
{
  if (item && item->HasPVRTimerInfoTag())
  {
    CPVRTimerInfoTagPtr tag(item->GetPVRTimerInfoTag());
    std::string hostname(m_addons->GetBackendHostnameByClientId(tag->m_iClientId));
    if (!hostname.empty() && g_application.getNetwork().IsLocalHost(hostname))
      return true;
  }
  return false;
}
开发者ID:dpvip,项目名称:xbmc,代码行数:11,代码来源:PVRManager.cpp

示例14: GetContextButtons

void CGUIWindowPVRTimersBase::GetContextButtons(int itemNumber, CContextButtons &buttons)
{
  if (itemNumber < 0 || itemNumber >= m_vecItems->Size())
    return;
  CFileItemPtr pItem = m_vecItems->Get(itemNumber);

  if (!URIUtils::PathEquals(pItem->GetPath(), CPVRTimersPath::PATH_ADDTIMER))
  {
    CPVRTimerInfoTagPtr timer(pItem->GetPVRTimerInfoTag());
    if (timer)
    {
      if (timer->GetEpgInfoTag())
        buttons.Add(CONTEXT_BUTTON_INFO, 19047);          /* Programme information */

      CPVRTimerTypePtr timerType(timer->GetTimerType());
      if (timerType)
      {
        if (timerType->SupportsEnableDisable())
        {
          if (timer->m_state == PVR_TIMER_STATE_DISABLED)
            buttons.Add(CONTEXT_BUTTON_ACTIVATE, 843);    /* Activate */
          else
            buttons.Add(CONTEXT_BUTTON_ACTIVATE, 844);    /* Deactivate */
        }

        if (timer->GetTimerRuleId() != PVR_TIMER_NO_PARENT)
        {
          buttons.Add(CONTEXT_BUTTON_EDIT_TIMER_RULE, 19243); /* Edit timer rule */
          buttons.Add(CONTEXT_BUTTON_DELETE_TIMER_RULE, 19295); /* Delete timer rule */
        }

        if (timerType && !timerType->IsReadOnly() && timer->GetTimerRuleId() == PVR_TIMER_NO_PARENT)
          buttons.Add(CONTEXT_BUTTON_EDIT_TIMER, 21450);  /* Edit */
        else
          buttons.Add(CONTEXT_BUTTON_EDIT_TIMER, 19241);  /* View timer information */

        // As epg-based timers will get it's title from the epg tag, they should not be renamable.
        if (timer->IsManual() && !timerType->IsReadOnly())
          buttons.Add(CONTEXT_BUTTON_RENAME, 118);        /* Rename */

        if (timer->IsRecording())
          buttons.Add(CONTEXT_BUTTON_STOP_RECORD, 19059); /* Stop recording */
        else if (timerType && !timerType->IsReadOnly())
            buttons.Add(CONTEXT_BUTTON_DELETE, 117);      /* Delete */
      }

      if (g_PVRClients->HasMenuHooks(timer->m_iClientId, PVR_MENUHOOK_TIMER))
        buttons.Add(CONTEXT_BUTTON_MENU_HOOKS, 19195);    /* PVR client specific action */
    }
  }

  CGUIWindowPVRBase::GetContextButtons(itemNumber, buttons);
}
开发者ID:Jalle19,项目名称:xbmc,代码行数:53,代码来源:GUIWindowPVRTimersBase.cpp

示例15: ActionCancelTimer

bool CGUIDialogPVRGuideInfo::ActionCancelTimer(CFileItemPtr timer)
{
  bool bReturn(false);
  if (!timer || !timer->HasPVRTimerInfoTag())
    return bReturn;

  bool bDelete(false);
  bool bDeleteScheduled(false);

  if (timer->GetPVRTimerInfoTag()->IsRepeating())
  {
    // prompt user for confirmation for deleting the complete repeating timer, including scheduled timers.
    bool bCancel(false);
    bDeleteScheduled = CGUIDialogYesNo::ShowAndGetInput(
                                                        CVariant{122}, // "Confirm delete"
                                                        CVariant{840}, // "You are about to delete a repeating timer. Do you also want to delete all timers currently scheduled by this timer?"
                                                        CVariant{""},
                                                        CVariant{timer->GetPVRTimerInfoTag()->Title()},
                                                        bCancel);
    bDelete = !bCancel;
  }
  else
  {
    // prompt user for confirmation for deleting the timer
    bDelete = CGUIDialogYesNo::ShowAndGetInput(
                                               CVariant{122}, // "Confirm delete"
                                               CVariant{19040}, // Timer
                                               CVariant{""},
                                               CVariant{timer->GetPVRTimerInfoTag()->Title()});
    bDeleteScheduled = false;
  }

  if (bDelete)
  {
    Close();
    bReturn = CPVRTimers::DeleteTimer(*timer, false, bDeleteScheduled);
  }

  return bReturn;
}
开发者ID:evilhamster,项目名称:xbmc,代码行数:40,代码来源:GUIDialogPVRGuideInfo.cpp


注:本文中的CFileItemPtr::GetPVRTimerInfoTag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。