本文整理汇总了C++中CFileItemPtr::HasPVRTimerInfoTag方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItemPtr::HasPVRTimerInfoTag方法的具体用法?C++ CFileItemPtr::HasPVRTimerInfoTag怎么用?C++ CFileItemPtr::HasPVRTimerInfoTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItemPtr
的用法示例。
在下文中一共展示了CFileItemPtr::HasPVRTimerInfoTag方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnClickButtonRecord
bool CGUIDialogPVRGuideInfo::OnClickButtonRecord(CGUIMessage &message)
{
bool bReturn = false;
if (message.GetSenderId() == CONTROL_BTN_RECORD)
{
bReturn = true;
const CEpgInfoTag *tag = m_progItem->GetEPGInfoTag();
if (!tag || !tag->HasPVRChannel())
{
/* invalid channel */
CGUIDialogOK::ShowAndGetInput(19033,19067,0,0);
Close();
return bReturn;
}
CFileItemPtr timerTag = g_PVRTimers->GetTimerForEpgTag(m_progItem.get());
bool bHasTimer = timerTag != NULL && timerTag->HasPVRTimerInfoTag();
if (!bHasTimer)
ActionStartTimer(tag);
else
ActionCancelTimer(timerTag);
}
return bReturn;
}
示例2: Update
void CGUIDialogPVRGuideInfo::Update()
{
const CEpgInfoTag *tag = m_progItem->GetEPGInfoTag();
if (!tag)
{
/* no epg event selected */
return;
}
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);
else
SET_CONTROL_LABEL(CONTROL_BTN_RECORD, 19061);
}
else
{
/* timer present on this tag */
if (tag->StartAsLocalTime() < CDateTime::GetCurrentDateTime())
SET_CONTROL_LABEL(CONTROL_BTN_RECORD, 19059);
else
SET_CONTROL_LABEL(CONTROL_BTN_RECORD, 19060);
}
}
示例3: 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;
}
示例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;
}
示例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 */
}
示例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;
}
示例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;
}
示例8: AddTimer
bool CGUIWindowPVRBase::AddTimer(CFileItem *item, bool bAdvanced)
{
CFileItemPtr epgTag;
if (item->IsEPG())
{
epgTag.reset(new CFileItem(*item));
if (!epgTag->GetEPGInfoTag()->HasPVRChannel())
return false;
}
else if (item->IsPVRChannel())
{
CPVRChannelPtr channel(item->GetPVRChannelInfoTag());
if (!channel)
return false;
CEpgInfoTagPtr epgNow(channel->GetEPGNow());
if (!epgNow)
return false;
epgTag.reset(new CFileItem(epgNow));
}
const CEpgInfoTagPtr tag = epgTag->GetEPGInfoTag();
CPVRChannelPtr channel = tag->ChannelTag();
if (!channel || !g_PVRManager.CheckParentalLock(channel))
return false;
CFileItemPtr timer = g_PVRTimers->GetTimerForEpgTag(item);
if (timer && timer->HasPVRTimerInfoTag())
{
CGUIDialogOK::ShowAndGetInput(CVariant{19033}, CVariant{19034});
return false;
}
bool bReturn(false);
if (bAdvanced)
{
CPVRTimerInfoTagPtr newTimer = CPVRTimerInfoTag::CreateFromEpg(tag, true);
if (newTimer)
{
CFileItem *newItem = new CFileItem(newTimer);
if (ShowTimerSettings(newItem))
bReturn = g_PVRTimers->AddTimer(newItem->GetPVRTimerInfoTag());
delete newItem;
}
}
else
{
CPVRTimerInfoTagPtr newTimer = CPVRTimerInfoTag::CreateFromEpg(tag);
if (newTimer)
bReturn = g_PVRTimers->AddTimer(newTimer);
}
return bReturn;
}
示例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);
}
}
示例10: 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;
}
示例11: ToggleTimerState
bool CPVRGUIActions::ToggleTimerState(const CFileItemPtr &item) const
{
if (!item->HasPVRTimerInfoTag())
return false;
const CPVRTimerInfoTagPtr timer(item->GetPVRTimerInfoTag());
if (timer->m_state == PVR_TIMER_STATE_DISABLED)
timer->m_state = PVR_TIMER_STATE_SCHEDULED;
else
timer->m_state = PVR_TIMER_STATE_DISABLED;
return g_PVRTimers->UpdateTimer(timer);
}
示例12: StopRecordFile
bool CGUIWindowPVRCommon::StopRecordFile(CFileItem *item)
{
if (!item->HasEPGInfoTag())
return false;
CEpgInfoTag *tag = item->GetEPGInfoTag();
if (!tag || !tag->HasPVRChannel())
return false;
CFileItemPtr timer = g_PVRTimers->GetTimerForEpgTag(item);
if (!timer || !timer->HasPVRTimerInfoTag() || timer->GetPVRTimerInfoTag()->m_bIsRepeating)
return false;
return g_PVRTimers->DeleteTimer(*timer);
}
示例13: StopRecordFile
bool CGUIWindowPVRBase::StopRecordFile(const CFileItem &item)
{
if (!item.HasEPGInfoTag())
return false;
const CEpgInfoTagPtr tag(item.GetEPGInfoTag());
if (!tag || !tag->HasPVRChannel())
return false;
CFileItemPtr timer = g_PVRTimers->GetTimerForEpgTag(&item);
if (!timer || !timer->HasPVRTimerInfoTag() || timer->GetPVRTimerInfoTag()->m_bIsRepeating)
return false;
return g_PVRTimers->DeleteTimer(*timer);
}
示例14: GetTimerRule
CFileItemPtr CPVRTimers::GetTimerRule(const CFileItemPtr &item) const
{
CPVRTimerInfoTagPtr timer;
if (item && item->HasEPGInfoTag())
timer = GetTimerForEpgTag(item->GetEPGInfoTag());
else if (item && item->HasPVRTimerInfoTag())
timer = item->GetPVRTimerInfoTag();
if (timer)
{
timer = GetTimerRule(timer);
if (timer)
return CFileItemPtr(new CFileItem(timer));
}
return CFileItemPtr();
}
示例15: 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);
}