本文整理汇总了C++中CPVRChannel::GetEPGNow方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRChannel::GetEPGNow方法的具体用法?C++ CPVRChannel::GetEPGNow怎么用?C++ CPVRChannel::GetEPGNow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRChannel
的用法示例。
在下文中一共展示了CPVRChannel::GetEPGNow方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowInfo
void CGUIDialogPVRChannelsOSD::ShowInfo(int item)
{
/* Check file item is in list range and get his pointer */
if (item < 0 || item >= (int)m_vecItems->Size()) return;
CFileItemPtr pItem = m_vecItems->Get(item);
if (pItem && pItem->IsPVRChannel())
{
CPVRChannel *channel = pItem->GetPVRChannelInfoTag();
if (!g_PVRManager.CheckParentalLock(*channel))
return;
/* Get the current running show on this channel from the EPG storage */
CEpgInfoTag epgnow;
if (!channel->GetEPGNow(epgnow))
return;
CFileItem *itemNow = new CFileItem(epgnow);
/* Load programme info dialog */
CGUIDialogPVRGuideInfo* pDlgInfo = (CGUIDialogPVRGuideInfo*)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_GUIDE_INFO);
if (!pDlgInfo)
return;
/* inform dialog about the file item and open dialog window */
pDlgInfo->SetProgInfo(itemNow);
pDlgInfo->DoModal();
delete itemNow; /* delete previuosly created FileItem */
}
return;
}
示例2: UpdatePlayingTag
void CPVRGUIInfo::UpdatePlayingTag(void)
{
CPVRChannel currentChannel;
CPVRRecording recording;
if (g_PVRManager.GetCurrentChannel(currentChannel))
{
CEpgInfoTag epgTag;
bool bHasEpgTag = GetPlayingTag(epgTag);
const CPVRChannel *channel = bHasEpgTag ? epgTag.ChannelTag() : NULL;
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;
}
}
示例3: UpdatePlayingTag
void CPVRGUIInfo::UpdatePlayingTag(void)
{
CSingleLock lock(m_critSection);
CPVRChannel currentChannel;
if (g_PVRManager.GetCurrentChannel(¤tChannel))
{
if (!m_playingEpgTag || !m_playingEpgTag->IsActive() ||
(*m_playingEpgTag->ChannelTag() != currentChannel))
{
m_playingEpgTag = currentChannel.GetEPGNow();
g_PVRManager.UpdateCurrentFile();
}
}
}
示例4: InstantTimer
bool CPVRTimers::InstantTimer(const CPVRChannel &channel)
{
if (!g_PVRManager.CheckParentalLock(channel))
return false;
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";
bool bReturn = newTimer->AddToClient();
if (!bReturn)
CLog::Log(LOGERROR, "PVRTimers - %s - unable to add an instant timer on the client", __FUNCTION__);
delete newTimer;
return bReturn;
}
示例5: GetChannels
int CPVRChannels::GetChannels(CFileItemList* results, int iGroupID /* = -1 */, bool bHidden /* = false */)
{
int iAmount = 0;
SortByChannelNumber();
for (unsigned int ptr = 0; ptr < size(); ptr++)
{
CPVRChannel *channel = at(ptr);
if (channel->IsHidden() != bHidden)
continue;
if (iGroupID != -1 && channel->GroupID() != iGroupID)
continue;
CFileItemPtr channelFile(new CFileItem(*channel));
if (channel->IsRadio())
{
CMusicInfoTag* musictag = channelFile->GetMusicInfoTag();
if (musictag)
{
const CPVREpgInfoTag *epgNow = channel->GetEPGNow();
musictag->SetURL(channel->Path());
musictag->SetTitle(epgNow->Title());
musictag->SetArtist(channel->ChannelName());
musictag->SetAlbumArtist(channel->ChannelName());
musictag->SetGenre(epgNow->Genre());
musictag->SetDuration(epgNow->GetDuration());
musictag->SetLoaded(true);
musictag->SetComment("");
musictag->SetLyrics("");
}
}
results->Add(channelFile);
iAmount++;
}
return iAmount;
}
示例6: UpdateItem
bool CPVRManager::UpdateItem(CFileItem& item)
{
/* Don't update if a recording is played */
if (item.IsPVRRecording())
return false;
if (!item.IsPVRChannel())
{
CLog::Log(LOGERROR, "CPVRManager - %s - no channel tag provided", __FUNCTION__);
return false;
}
CSingleLock lock(m_critSection);
if (!m_currentFile || *m_currentFile->GetPVRChannelInfoTag() == *item.GetPVRChannelInfoTag())
return false;
g_application.CurrentFileItem() = *m_currentFile;
g_infoManager.SetCurrentItem(*m_currentFile);
CPVRChannel* channelTag = item.GetPVRChannelInfoTag();
CEpgInfoTag epgTagNow;
bool bHasTagNow = channelTag->GetEPGNow(epgTagNow);
if (channelTag->IsRadio())
{
CMusicInfoTag* musictag = item.GetMusicInfoTag();
if (musictag)
{
musictag->SetTitle(bHasTagNow ? epgTagNow.Title() : g_localizeStrings.Get(19055));
if (bHasTagNow)
musictag->SetGenre(epgTagNow.Genre());
musictag->SetDuration(bHasTagNow ? epgTagNow.GetDuration() : 3600);
musictag->SetURL(channelTag->Path());
musictag->SetArtist(channelTag->ChannelName());
musictag->SetAlbumArtist(channelTag->ChannelName());
musictag->SetLoaded(true);
musictag->SetComment(StringUtils::EmptyString);
musictag->SetLyrics(StringUtils::EmptyString);
}
}
else
{
CVideoInfoTag *videotag = item.GetVideoInfoTag();
if (videotag)
{
videotag->m_strTitle = bHasTagNow ? epgTagNow.Title() : g_localizeStrings.Get(19055);
if (bHasTagNow)
videotag->m_genre = epgTagNow.Genre();
videotag->m_strPath = channelTag->Path();
videotag->m_strFileNameAndPath = channelTag->Path();
videotag->m_strPlot = bHasTagNow ? epgTagNow.Plot() : StringUtils::EmptyString;
videotag->m_strPlotOutline = bHasTagNow ? epgTagNow.PlotOutline() : StringUtils::EmptyString;
videotag->m_iEpisode = bHasTagNow ? epgTagNow.EpisodeNum() : 0;
}
}
CPVRChannel* tagPrev = item.GetPVRChannelInfoTag();
if (tagPrev && tagPrev->ChannelNumber() != m_LastChannel)
{
m_LastChannel = tagPrev->ChannelNumber();
m_LastChannelChanged = XbmcThreads::SystemClockMillis();
}
if (XbmcThreads::SystemClockMillis() - m_LastChannelChanged >= (unsigned int) g_guiSettings.GetInt("pvrplayback.channelentrytimeout") && m_LastChannel != m_PreviousChannel[m_PreviousChannelIndex])
m_PreviousChannel[m_PreviousChannelIndex ^= 1] = m_LastChannel;
else
m_LastChannelChanged = XbmcThreads::SystemClockMillis();
return false;
}
示例7: UpdateItem
bool CPVRManager::UpdateItem(CFileItem& item)
{
/* Don't update if a recording is played */
if (item.IsPVRRecording())
return false;
if (!item.IsPVRChannel())
{
CLog::Log(LOGERROR, "CPVRManager - %s - no channel tag provided", __FUNCTION__);
return false;
}
CSingleLock lock(m_critSection);
if (!m_currentFile || *m_currentFile->GetPVRChannelInfoTag() == *item.GetPVRChannelInfoTag())
return false;
g_application.CurrentFileItem() = *m_currentFile;
g_infoManager.SetCurrentItem(*m_currentFile);
CPVRChannel* channelTag = item.GetPVRChannelInfoTag();
CEpgInfoTag epgTagNow;
bool bHasTagNow = channelTag->GetEPGNow(epgTagNow);
if (channelTag->IsRadio())
{
CMusicInfoTag* musictag = item.GetMusicInfoTag();
if (musictag)
{
musictag->SetTitle(bHasTagNow ?
epgTagNow.Title() :
g_guiSettings.GetBool("epg.hidenoinfoavailable") ?
StringUtils::EmptyString :
g_localizeStrings.Get(19055)); // no information available
if (bHasTagNow)
musictag->SetGenre(epgTagNow.Genre());
musictag->SetDuration(bHasTagNow ? epgTagNow.GetDuration() : 3600);
musictag->SetURL(channelTag->Path());
musictag->SetArtist(channelTag->ChannelName());
musictag->SetAlbumArtist(channelTag->ChannelName());
musictag->SetLoaded(true);
musictag->SetComment(StringUtils::EmptyString);
musictag->SetLyrics(StringUtils::EmptyString);
}
}
else
{
CVideoInfoTag *videotag = item.GetVideoInfoTag();
if (videotag)
{
videotag->m_strTitle = bHasTagNow ?
epgTagNow.Title() :
g_guiSettings.GetBool("epg.hidenoinfoavailable") ?
StringUtils::EmptyString :
g_localizeStrings.Get(19055); // no information available
if (bHasTagNow)
videotag->m_genre = epgTagNow.Genre();
videotag->m_strPath = channelTag->Path();
videotag->m_strFileNameAndPath = channelTag->Path();
videotag->m_strPlot = bHasTagNow ? epgTagNow.Plot() : StringUtils::EmptyString;
videotag->m_strPlotOutline = bHasTagNow ? epgTagNow.PlotOutline() : StringUtils::EmptyString;
videotag->m_iEpisode = bHasTagNow ? epgTagNow.EpisodeNum() : 0;
}
}
return false;
}