本文整理汇总了C++中CPVRTimerInfoTag::AddToClient方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRTimerInfoTag::AddToClient方法的具体用法?C++ CPVRTimerInfoTag::AddToClient怎么用?C++ CPVRTimerInfoTag::AddToClient使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRTimerInfoTag
的用法示例。
在下文中一共展示了CPVRTimerInfoTag::AddToClient方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
CPVRTimerInfoTag *CPVRTimers::InstantTimer(CPVRChannel *channel, bool bStartTimer /* = true */)
{
if (!channel)
{
if (!g_PVRManager.GetCurrentChannel(channel))
channel = (CPVRChannel *) g_PVRChannelGroups->GetGroupAllTV()->GetFirstChannel();
/* no channels present */
if (!channel)
return NULL;
}
const CPVREpgInfoTag *epgTag = channel->GetEPGNow();
int iMarginEnd = g_guiSettings.GetInt("pvrrecord.marginend");
int iPriority = g_guiSettings.GetInt("pvrrecord.defaultpriority");
int iLifetime = g_guiSettings.GetInt("pvrrecord.defaultlifetime");
int iDuration = g_guiSettings.GetInt("pvrrecord.instantrecordtime");
CPVRTimerInfoTag *newTimer = epgTag ? CPVRTimerInfoTag::CreateFromEpg(*epgTag) : NULL;
if (!newTimer)
{
newTimer = new CPVRTimerInfoTag;
/* set the timer data */
newTimer->m_iClientIndex = -1;
newTimer->m_bIsActive = true;
newTimer->m_strTitle = channel->ChannelName();
newTimer->m_strSummary = g_localizeStrings.Get(19056);
newTimer->m_iMarginEnd = iMarginEnd ? iMarginEnd : 5; /* use 5 minutes as default */
newTimer->m_iChannelNumber = channel->ChannelNumber();
newTimer->m_iClientChannelUid = channel->UniqueID();
newTimer->m_iClientId = channel->ClientID();
newTimer->m_bIsRadio = channel->IsRadio();
newTimer->m_iPriority = iPriority ? iPriority : 50; /* default to 50 */
newTimer->m_iLifetime = iLifetime ? iLifetime : 30; /* default to 30 days */
/* generate summary string */
newTimer->m_strSummary.Format("%s %s %s %s %s",
newTimer->StartAsLocalTime().GetAsLocalizedDate(),
g_localizeStrings.Get(19159),
newTimer->StartAsLocalTime().GetAsLocalizedTime("", false),
g_localizeStrings.Get(19160),
newTimer->EndAsLocalTime().GetAsLocalizedTime("", false));
}
newTimer->m_iMarginStart = 0;
newTimer->SetDuration(iDuration ? iDuration : 120); /* use 120 minutes as default */
/* unused only for reference */
newTimer->m_strFileNameAndPath = "pvr://timers/new";
if (bStartTimer && !newTimer->AddToClient())
{
CLog::Log(LOGERROR, "PVRTimers - %s - unable to add an instant timer on the client", __FUNCTION__);
delete newTimer;
newTimer = NULL;
}
return newTimer;
}
示例2: AddTimer
bool CPVRTimers::AddTimer(CPVRTimerInfoTag &item)
{
if (!g_PVRClients->GetClientProperties(item.m_iClientId)->bSupportsTimers)
{
CGUIDialogOK::ShowAndGetInput(19033,0,19215,0);
return false;
}
return item.AddToClient();
}
示例3: AddTimer
bool CPVRTimers::AddTimer(const CPVRTimerInfoTag &item)
{
if (!g_PVRManager.GetClientProps(item.ClientID())->SupportTimers)
{
CGUIDialogOK::ShowAndGetInput(19033,0,19215,0);
return false;
}
return item.AddToClient();
}
示例4: startTime
CPVRTimerInfoTag *CPVRTimers::InstantTimer(const CPVRChannel &channel, bool bStartTimer /* = true */)
{
if (!g_PVRManager.CheckParentalLock(channel))
return NULL;
CEpgInfoTag epgTag;
bool bHasEpgNow = channel.GetEPGNow(epgTag);
CPVRTimerInfoTag *newTimer = bHasEpgNow ? CPVRTimerInfoTag::CreateFromEpg(epgTag) : NULL;
if (!newTimer)
{
newTimer = new CPVRTimerInfoTag;
/* set the timer data */
newTimer->m_iClientIndex = -1;
newTimer->m_strTitle = channel.ChannelName();
newTimer->m_strSummary = g_localizeStrings.Get(19056);
newTimer->m_iChannelNumber = channel.ChannelNumber();
newTimer->m_iClientChannelUid = channel.UniqueID();
newTimer->m_iClientId = channel.ClientID();
newTimer->m_bIsRadio = channel.IsRadio();
/* generate summary string */
newTimer->m_strSummary.Format("%s %s %s %s %s",
newTimer->StartAsLocalTime().GetAsLocalizedDate(),
g_localizeStrings.Get(19159),
newTimer->StartAsLocalTime().GetAsLocalizedTime(StringUtils::EmptyString, false),
g_localizeStrings.Get(19160),
newTimer->EndAsLocalTime().GetAsLocalizedTime(StringUtils::EmptyString, false));
}
CDateTime startTime(0);
newTimer->SetStartFromUTC(startTime);
newTimer->m_iMarginStart = 0; /* set the start margin to 0 for instant timers */
int iDuration = g_guiSettings.GetInt("pvrrecord.instantrecordtime");
CDateTime endTime = CDateTime::GetUTCDateTime() + CDateTimeSpan(0, 0, iDuration ? iDuration : 120, 0);
newTimer->SetEndFromUTC(endTime);
/* unused only for reference */
newTimer->m_strFileNameAndPath = "pvr://timers/new";
if (bStartTimer && !newTimer->AddToClient())
{
CLog::Log(LOGERROR, "PVRTimers - %s - unable to add an instant timer on the client", __FUNCTION__);
delete newTimer;
newTimer = NULL;
}
return newTimer;
}
示例5: AddTimer
bool CPVRTimers::AddTimer(const CPVRTimerInfoTag &item)
{
if (!item.m_channel)
{
CLog::Log(LOGERROR, "PVRTimers - %s - no channel given", __FUNCTION__);
CGUIDialogOK::ShowAndGetInput(19033,0,19109,0); // Couldn't save timer
return false;
}
if (!g_PVRClients->SupportsTimers(item.m_iClientId))
{
CGUIDialogOK::ShowAndGetInput(19033,0,19215,0);
return false;
}
if (!g_PVRManager.CheckParentalLock(*item.m_channel))
return false;
return item.AddToClient();
}