本文整理汇总了C++中CEpgInfoTagPtr::Timer方法的典型用法代码示例。如果您正苦于以下问题:C++ CEpgInfoTagPtr::Timer方法的具体用法?C++ CEpgInfoTagPtr::Timer怎么用?C++ CEpgInfoTagPtr::Timer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEpgInfoTagPtr
的用法示例。
在下文中一共展示了CEpgInfoTagPtr::Timer方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTimerInfoTag
CPVRTimerInfoTagPtr CPVRItem::GetTimerInfoTag() const
{
if (m_item->IsPVRTimer())
{
return m_item->GetPVRTimerInfoTag();
}
else if (m_item->IsEPG())
{
return m_item->GetEPGInfoTag()->Timer();
}
else if (m_item->IsPVRChannel())
{
CPVRTimerInfoTagPtr timer;
const CEpgInfoTagPtr epgTag(m_item->GetPVRChannelInfoTag()->GetEPGNow());
if (epgTag)
timer = epgTag->Timer(); // cheap method, but not reliable as timers get set at epg tags asynchronously
if (timer)
return timer;
return g_PVRTimers->GetActiveTimerForChannel(m_item->GetPVRChannelInfoTag()); // more expensive, but reliable and works even for channels with no epg data
}
else
{
CLog::Log(LOGERROR, "CPVRItem - %s - unsupported item type!", __FUNCTION__);
}
return CPVRTimerInfoTagPtr();
}
示例2: ToggleTimer
JSONRPC_STATUS CPVROperations::ToggleTimer(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if (!g_PVRManager.IsStarted())
return FailedToExecute;
const CEpgInfoTagPtr epgTag = g_EpgContainer.GetTagById(CPVRChannelPtr(), parameterObject["broadcastid"].asUnsignedInteger());
if (!epgTag)
return InvalidParams;
bool timerrule = parameterObject["timerrule"].asBoolean(false);
bool sentOkay = false;
CPVRTimerInfoTagPtr timer(epgTag->Timer());
if (timer)
{
if (timerrule)
timer = g_PVRTimers->GetTimerRule(timer);
if (timer)
sentOkay = g_PVRTimers->DeleteTimer(timer, timer->IsRecording(), false);
}
else
{
timer = CPVRTimerInfoTag::CreateFromEpg(epgTag, timerrule);
if (!timer)
return InvalidParams;
sentOkay = g_PVRTimers->AddTimer(timer);
}
if (sentOkay)
return ACK;
return FailedToExecute;
}
示例3: AddTimer
bool CGUIWindowPVRBase::AddTimer(CFileItem *item, bool bCreateRule, bool bShowTimerSettings)
{
CEpgInfoTagPtr epgTag;
CPVRChannelPtr channel;
if (item->IsEPG())
{
epgTag = item->GetEPGInfoTag();
channel = epgTag->ChannelTag();
}
else if (item->IsPVRChannel())
{
channel = item->GetPVRChannelInfoTag();
epgTag = channel->GetEPGNow();
}
if (!channel)
{
CLog::Log(LOGERROR, "CGUIWindowPVRBase - %s - no channel!", __FUNCTION__);
return false;
}
if (!g_PVRManager.CheckParentalLock(channel))
return false;
if (!epgTag && bCreateRule)
{
CLog::Log(LOGERROR, "CGUIWindowPVRBase - %s - no epg tag!", __FUNCTION__);
return false;
}
CPVRTimerInfoTagPtr timer(bCreateRule || !epgTag ? nullptr : epgTag->Timer());
CPVRTimerInfoTagPtr rule (bCreateRule ? g_PVRTimers->GetTimerRule(timer) : nullptr);
if (timer || rule)
{
CGUIDialogOK::ShowAndGetInput(CVariant{19033}, CVariant{19034}); // "Information", "There is already a timer set for this event"
return false;
}
CPVRTimerInfoTagPtr newTimer(epgTag ? CPVRTimerInfoTag::CreateFromEpg(epgTag, bCreateRule) : CPVRTimerInfoTag::CreateInstantTimerTag(channel));
if (!newTimer)
{
CGUIDialogOK::ShowAndGetInput(CVariant{19033},
bCreateRule
? CVariant{19095} // "Information", "Timer rule creation failed. The PVR add-on does not support a suitable timer rule type."
: CVariant{19094}); // "Information", "Timer creation failed. The PVR add-on does not support a suitable timer type."
return false;
}
if (bShowTimerSettings)
{
if (!ShowTimerSettings(newTimer))
return false;
}
return g_PVRTimers->AddTimer(newTimer);
}
示例4: DeleteTimer
bool CGUIWindowPVRBase::DeleteTimer(CFileItem *item, bool bIsRecording, bool bDeleteRule)
{
CPVRTimerInfoTagPtr timer;
if (item->IsPVRTimer())
{
timer = item->GetPVRTimerInfoTag();
}
else if (item->IsEPG())
{
timer = item->GetEPGInfoTag()->Timer();
}
else if (item->IsPVRChannel())
{
const CEpgInfoTagPtr epgTag(item->GetPVRChannelInfoTag()->GetEPGNow());
if (epgTag)
timer = epgTag->Timer(); // cheap method, but not reliable as timers get set at epg tags asychrounously
if (!timer)
timer = g_PVRTimers->GetActiveTimerForChannel(item->GetPVRChannelInfoTag()); // more expensive, but reliable and works even for channels with no epg data
}
if (!timer)
{
CLog::Log(LOGERROR, "CGUIWindowPVRBase - %s - no timer!", __FUNCTION__);
return false;
}
if (bDeleteRule && !timer->IsRepeating())
timer = g_PVRTimers->GetTimerRule(timer);
if (!timer)
{
CLog::Log(LOGERROR, "CGUIWindowPVRBase - %s - no timer rule!", __FUNCTION__);
return false;
}
if (bIsRecording)
{
if (ConfirmStopRecording(timer))
return g_PVRTimers->DeleteTimer(timer, true, false);
}
else if (timer->HasTimerType() && timer->GetTimerType()->IsReadOnly())
{
return false;
}
else
{
bool bAlsoDeleteRule(false);
if (ConfirmDeleteTimer(timer, bAlsoDeleteRule))
return g_PVRTimers->DeleteTimer(timer, false, bAlsoDeleteRule);
}
return false;
}
示例5: 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);
}
bool bHideRecord(true);
if (tag->HasTimer())
{
if (tag->Timer()->IsRecording())
{
SET_CONTROL_LABEL(CONTROL_BTN_RECORD, 19059); /* Stop recording */
bHideRecord = false;
}
else if (tag->Timer()->HasTimerType() && !tag->Timer()->GetTimerType()->IsReadOnly())
{
SET_CONTROL_LABEL(CONTROL_BTN_RECORD, 19060); /* Delete timer */
bHideRecord = false;
}
}
else if (tag->EndAsLocalTime() > CDateTime::GetCurrentDateTime())
{
SET_CONTROL_LABEL(CONTROL_BTN_RECORD, 264); /* Record */
bHideRecord = false;
}
if (bHideRecord)
SET_CONTROL_HIDDEN(CONTROL_BTN_RECORD);
}
示例6: AddTimer
bool CPVRGUIActions::AddTimer(const CFileItemPtr &item, bool bCreateRule, bool bShowTimerSettings) const
{
const CPVRChannelPtr channel(CPVRItem(item).GetChannel());
if (!channel)
{
CLog::Log(LOGERROR, "CPVRGUIActions - %s - no channel!", __FUNCTION__);
return false;
}
if (!g_PVRManager.CheckParentalLock(channel))
return false;
const CEpgInfoTagPtr epgTag(CPVRItem(item).GetEpgInfoTag());
if (!epgTag && bCreateRule)
{
CLog::Log(LOGERROR, "CPVRGUIActions - %s - no epg tag!", __FUNCTION__);
return false;
}
CPVRTimerInfoTagPtr timer(bCreateRule || !epgTag ? nullptr : epgTag->Timer());
CPVRTimerInfoTagPtr rule (bCreateRule ? g_PVRTimers->GetTimerRule(timer) : nullptr);
if (timer || rule)
{
CGUIDialogOK::ShowAndGetInput(CVariant{19033}, CVariant{19034}); // "Information", "There is already a timer set for this event"
return false;
}
CPVRTimerInfoTagPtr newTimer(epgTag ? CPVRTimerInfoTag::CreateFromEpg(epgTag, bCreateRule) : CPVRTimerInfoTag::CreateInstantTimerTag(channel));
if (!newTimer)
{
CGUIDialogOK::ShowAndGetInput(CVariant{19033},
bCreateRule
? CVariant{19095} // "Information", "Timer rule creation failed. The PVR add-on does not support a suitable timer rule type."
: CVariant{19094}); // "Information", "Timer creation failed. The PVR add-on does not support a suitable timer type."
return false;
}
if (bShowTimerSettings)
{
if (!ShowTimerSettings(newTimer))
return false;
}
return g_PVRTimers->AddTimer(newTimer);
}
示例7: GetTimerForEpgTag
CPVRTimerInfoTagPtr CPVRTimers::GetTimerForEpgTag(const CEpgInfoTagPtr &epgTag) const
{
if (epgTag)
{
// already a timer assigned to tag?
CPVRTimerInfoTagPtr timer(epgTag->Timer());
if (timer)
return timer;
// try to find a matching timer for the tag.
if (epgTag->ChannelTag())
{
const CPVRChannelPtr channel(epgTag->ChannelTag());
CSingleLock lock(m_critSection);
for (MapTags::const_iterator it = m_tags.begin(); it != m_tags.end(); ++it)
{
for (VecTimerInfoTag::const_iterator timerIt = it->second->begin(); timerIt != it->second->end(); ++timerIt)
{
timer = *timerIt;
if (!timer->IsRepeating() &&
(timer->GetEpgInfoTag(false) == epgTag ||
(timer->m_iEpgUid != EPG_TAG_INVALID_UID && timer->m_iEpgUid == epgTag->UniqueBroadcastID()) ||
(timer->m_iClientChannelUid == channel->UniqueID() &&
timer->m_bIsRadio == channel->IsRadio() &&
timer->StartAsUTC() <= epgTag->StartAsUTC() &&
timer->EndAsUTC() >= epgTag->EndAsUTC())))
{
return timer;
}
}
}
}
}
return CPVRTimerInfoTagPtr();
}