本文整理汇总了C++中CPVRChannelPtr::GetEPGNow方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRChannelPtr::GetEPGNow方法的具体用法?C++ CPVRChannelPtr::GetEPGNow怎么用?C++ CPVRChannelPtr::GetEPGNow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRChannelPtr
的用法示例。
在下文中一共展示了CPVRChannelPtr::GetEPGNow方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdatePlayingTag
void CPVRGUIInfo::UpdatePlayingTag(void)
{
CPVRChannelPtr currentChannel;
CPVRRecording recording;
if (g_PVRManager.GetCurrentChannel(currentChannel))
{
CEpgInfoTag epgTag;
bool bHasEpgTag = GetPlayingTag(epgTag);
CPVRChannelPtr channel;
if (bHasEpgTag)
channel = epgTag.ChannelTag();
if (!bHasEpgTag || !epgTag.IsActive() ||
!channel || *channel != *currentChannel)
{
CEpgInfoTag newTag;
{
CSingleLock lock(m_critSection);
ResetPlayingTag();
if (currentChannel->GetEPGNow(newTag))
{
m_playingEpgTag = new CEpgInfoTag(newTag);
m_iDuration = m_playingEpgTag->GetDuration() * 1000;
}
}
g_PVRManager.UpdateCurrentFile();
}
}
else if (g_PVRClients->GetPlayingRecording(recording))
{
ResetPlayingTag();
m_iDuration = recording.GetDuration() * 1000;
}
}
示例2: CreateInstantTimerTag
CPVRTimerInfoTagPtr CPVRTimerInfoTag::CreateInstantTimerTag(const CPVRChannelPtr &channel)
{
if (!channel)
{
CLog::Log(LOGERROR, "%s - no channel set", __FUNCTION__);
return CPVRTimerInfoTagPtr();
}
CEpgInfoTagPtr epgTag(channel->GetEPGNow());
CPVRTimerInfoTagPtr newTimer;
if (epgTag)
newTimer = CreateFromEpg(epgTag);
if (!newTimer)
{
newTimer.reset(new CPVRTimerInfoTag);
newTimer->m_iClientIndex = PVR_TIMER_NO_CLIENT_INDEX;
newTimer->m_iParentClientIndex = PVR_TIMER_NO_PARENT;
newTimer->m_channel = channel;
newTimer->m_strTitle = channel->ChannelName();
newTimer->m_iChannelNumber = channel->ChannelNumber();
newTimer->m_iClientChannelUid = channel->UniqueID();
newTimer->m_iClientId = channel->ClientID();
newTimer->m_bIsRadio = channel->IsRadio();
// timertype: manual one-shot timer for given client
CPVRTimerTypePtr timerType(CPVRTimerType::CreateFromAttributes(
PVR_TIMER_TYPE_IS_MANUAL, PVR_TIMER_TYPE_IS_REPEATING | PVR_TIMER_TYPE_FORBIDS_NEW_INSTANCES, channel->ClientID()));
if (!timerType)
{
CLog::Log(LOGERROR, "%s - unable to create one shot manual timer type", __FUNCTION__);
return CPVRTimerInfoTagPtr();
}
newTimer->SetTimerType(timerType);
}
// no matter the timer was created from an epg tag, set special instant timer start and end times.
CDateTime startTime(0);
newTimer->SetStartFromUTC(startTime);
newTimer->m_iMarginStart = 0; /* set the start margin to 0 for instant timers */
int iDuration = CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_INSTANTRECORDTIME);
CDateTime endTime = CDateTime::GetUTCDateTime() + CDateTimeSpan(0, 0, iDuration ? iDuration : 120, 0);
newTimer->SetEndFromUTC(endTime);
/* update summary string according to changed start/end time */
newTimer->UpdateSummary();
/* set epg tag at timer & timer at epg tag */
newTimer->UpdateEpgInfoTag();
/* unused only for reference */
newTimer->m_strFileNameAndPath = CPVRTimersPath::PATH_NEW;
return newTimer;
}
示例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: GetCurrentEpg
EPG::CEpgInfoTagPtr CPlayerOperations::GetCurrentEpg()
{
if (!g_PVRManager.IsPlayingTV() && !g_PVRManager.IsPlayingRadio())
return EPG::CEpgInfoTagPtr();
CPVRChannelPtr currentChannel;
if (!g_PVRManager.GetCurrentChannel(currentChannel))
return EPG::CEpgInfoTagPtr();
return currentChannel->GetEPGNow();
}
示例5: InstantTimer
bool CPVRTimers::InstantTimer(const CPVRChannelPtr &channel)
{
assert(channel.get());
if (!g_PVRManager.CheckParentalLock(channel))
return false;
CEpgInfoTagPtr epgTag(channel->GetEPGNow());
CPVRTimerInfoTagPtr newTimer;
if (epgTag)
newTimer = CPVRTimerInfoTag::CreateFromEpg(epgTag);
if (!newTimer)
{
newTimer.reset(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 = StringUtils::Format("%s %s %s %s %s",
newTimer->StartAsLocalTime().GetAsLocalizedDate().c_str(),
g_localizeStrings.Get(19159).c_str(),
newTimer->StartAsLocalTime().GetAsLocalizedTime("", false).c_str(),
g_localizeStrings.Get(19160).c_str(),
newTimer->EndAsLocalTime().GetAsLocalizedTime("", false).c_str());
}
CDateTime startTime(0);
newTimer->SetStartFromUTC(startTime);
newTimer->m_iMarginStart = 0; /* set the start margin to 0 for instant timers */
int iDuration = CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_INSTANTRECORDTIME);
CDateTime endTime = CDateTime::GetUTCDateTime() + CDateTimeSpan(0, 0, iDuration ? iDuration : 120, 0);
newTimer->SetEndFromUTC(endTime);
/* unused only for reference */
newTimer->m_strFileNameAndPath = CPVRTimersPath::PATH_NEW;
bool bReturn = newTimer->AddToClient();
if (!bReturn)
CLog::Log(LOGERROR, "PVRTimers - %s - unable to add an instant timer on the client", __FUNCTION__);
return bReturn;
}
示例6: GetCurrentEpg
bool CPlayerOperations::GetCurrentEpg(EPG::CEpgInfoTag &epg)
{
if (!g_PVRManager.IsPlayingTV() && !g_PVRManager.IsPlayingRadio())
return false;
CPVRChannelPtr currentChannel;
if (!g_PVRManager.GetCurrentChannel(currentChannel))
return false;
if (!currentChannel->GetEPGNow(epg))
return false;
return true;
}
示例7: ShowEPGInfo
void CGUIWindowPVRBase::ShowEPGInfo(CFileItem *item)
{
CEpgInfoTagPtr epgTag;
CPVRChannelPtr channel;
if (item->IsEPG())
{
epgTag = item->GetEPGInfoTag();
channel = epgTag->ChannelTag();
}
else if (item->IsPVRChannel())
{
channel = item->GetPVRChannelInfoTag();
epgTag = channel->GetEPGNow();
}
else if (item->IsPVRTimer())
{
epgTag = item->GetPVRTimerInfoTag()->GetEpgInfoTag();
if (epgTag && epgTag->HasPVRChannel())
channel = epgTag->ChannelTag();
}
if (channel && !g_PVRManager.CheckParentalLock(channel))
return;
if (!epgTag)
{
CLog::Log(LOGERROR, "CGUIWindowPVRBase - %s - no epg tag!", __FUNCTION__);
return;
}
CGUIDialogPVRGuideInfo* pDlgInfo = (CGUIDialogPVRGuideInfo*)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_GUIDE_INFO);
if (!pDlgInfo)
{
CLog::Log(LOGERROR, "CGUIWindowPVRBase - %s - unable to get WINDOW_DIALOG_PVR_GUIDE_INFO!", __FUNCTION__);
return;
}
pDlgInfo->SetProgInfo(epgTag);
pDlgInfo->Open();
}