本文整理汇总了C++中CEpgInfoTagPtr::HasTimer方法的典型用法代码示例。如果您正苦于以下问题:C++ CEpgInfoTagPtr::HasTimer方法的具体用法?C++ CEpgInfoTagPtr::HasTimer怎么用?C++ CEpgInfoTagPtr::HasTimer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEpgInfoTagPtr
的用法示例。
在下文中一共展示了CEpgInfoTagPtr::HasTimer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddTimer
JSONRPC_STATUS CPVROperations::AddTimer(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if (!g_PVRManager.IsStarted())
return FailedToExecute;
CFileItemPtr broadcast = CPVROperations::GetBroadcastFromBroadcastid(parameterObject["broadcastid"].asUnsignedInteger());
if (!broadcast)
return InvalidParams;
if (!broadcast->HasEPGInfoTag())
return InvalidParams;
CEpgInfoTagPtr epgTag = broadcast->GetEPGInfoTag();
if (!epgTag)
return InvalidParams;
if (epgTag->HasTimer())
return InvalidParams;
CPVRTimerInfoTagPtr newTimer = CPVRTimerInfoTag::CreateFromEpg(epgTag, parameterObject["timerrule"].asBoolean(false));
if (newTimer)
{
if (g_PVRTimers->AddTimer(newTimer))
return ACK;
}
return FailedToExecute;
}
示例2: AddTimer
JSONRPC_STATUS CPVROperations::AddTimer(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;
if (epgTag->HasTimer())
return InvalidParams;
CPVRTimerInfoTagPtr newTimer = CPVRTimerInfoTag::CreateFromEpg(epgTag, parameterObject["timerrule"].asBoolean(false));
if (newTimer)
{
if (g_PVRTimers->AddTimer(newTimer))
return ACK;
}
return FailedToExecute;
}
示例3: 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);
}
示例4: OnMessage
bool CGUIWindowPVRGuide::OnMessage(CGUIMessage& message)
{
bool bReturn = false;
switch (message.GetMessage())
{
case GUI_MSG_CLICKED:
{
if (message.GetSenderId() == m_viewControl.GetCurrentControl())
{
int iItem = m_viewControl.GetSelectedItem();
if (iItem >= 0 && iItem < m_vecItems->Size())
{
CFileItemPtr pItem = m_vecItems->Get(iItem);
/* process actions */
switch (message.GetParam1())
{
case ACTION_SELECT_ITEM:
case ACTION_MOUSE_LEFT_CLICK:
switch(CServiceBroker::GetSettings().GetInt(CSettings::SETTING_EPG_SELECTACTION))
{
case EPG_SELECT_ACTION_CONTEXT_MENU:
OnPopupMenu(iItem);
bReturn = true;
break;
case EPG_SELECT_ACTION_SWITCH:
CPVRGUIActions::GetInstance().SwitchToChannel(pItem, true);
bReturn = true;
break;
case EPG_SELECT_ACTION_PLAY_RECORDING:
CPVRGUIActions::GetInstance().PlayRecording(pItem, true);
bReturn = true;
break;
case EPG_SELECT_ACTION_INFO:
CPVRGUIActions::GetInstance().ShowEPGInfo(pItem);
bReturn = true;
break;
case EPG_SELECT_ACTION_RECORD:
CPVRGUIActions::GetInstance().ToggleTimer(pItem);
bReturn = true;
break;
case EPG_SELECT_ACTION_SMART_SELECT:
{
const CEpgInfoTagPtr tag(pItem->GetEPGInfoTag());
if (tag)
{
const CDateTime start(tag->StartAsUTC());
const CDateTime end(tag->EndAsUTC());
const CDateTime now(CDateTime::GetUTCDateTime());
if (start <= now && now <= end)
{
// current event
CPVRGUIActions::GetInstance().SwitchToChannel(pItem, true);
}
else if (now < start)
{
// future event
if (tag->HasTimer())
CPVRGUIActions::GetInstance().EditTimer(pItem);
else
CPVRGUIActions::GetInstance().AddTimer(pItem, false);
}
else
{
// past event
if (tag->HasRecording())
CPVRGUIActions::GetInstance().PlayRecording(pItem, true);
else
CPVRGUIActions::GetInstance().ShowEPGInfo(pItem);
}
bReturn = true;
}
break;
}
}
break;
case ACTION_SHOW_INFO:
CPVRGUIActions::GetInstance().ShowEPGInfo(pItem);
bReturn = true;
break;
case ACTION_PLAY:
CPVRGUIActions::GetInstance().PlayRecording(pItem, true);
bReturn = true;
break;
case ACTION_RECORD:
CPVRGUIActions::GetInstance().ToggleTimer(pItem);
bReturn = true;
break;
case ACTION_PVR_SHOW_TIMER_RULE:
CPVRGUIActions::GetInstance().AddTimerRule(pItem, true);
bReturn = true;
break;
case ACTION_CONTEXT_MENU:
case ACTION_MOUSE_RIGHT_CLICK:
OnPopupMenu(iItem);
bReturn = true;
break;
}
}
else if (iItem == -1)
//.........这里部分代码省略.........