本文整理汇总了C++中CEpgInfoTag::GetDuration方法的典型用法代码示例。如果您正苦于以下问题:C++ CEpgInfoTag::GetDuration方法的具体用法?C++ CEpgInfoTag::GetDuration怎么用?C++ CEpgInfoTag::GetDuration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEpgInfoTag
的用法示例。
在下文中一共展示了CEpgInfoTag::GetDuration方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FilterEntry
bool EpgSearchFilter::FilterEntry(const CEpgInfoTag &tag) const
{
if (m_iGenreType != -1)
{
if (tag.GenreType() != m_iGenreType &&
(!m_bIncludeUnknownGenres &&
((tag.GenreType() < EVCONTENTMASK_USERDEFINED || tag.GenreType() >= EVCONTENTMASK_MOVIEDRAMA))))
{
return false;
}
}
if (m_iMinimumDuration != -1)
{
if (tag.GetDuration() < (m_iMinimumDuration*60))
return false;
}
if (m_iMaximumDuration != -1)
{
if (tag.GetDuration() > (m_iMaximumDuration*60))
return false;
}
int timeTag = (tag.Start().GetHour()*60 + tag.Start().GetMinute());
if (timeTag < (m_startTime.wHour*60 + m_startTime.wMinute))
return false;
if (timeTag > (m_endTime.wHour*60 + m_endTime.wMinute))
return false;
if (tag.Start() < m_startDate)
return false;
if (tag.Start() > m_endDate)
return false;
if (m_strSearchTerm != "")
{
cTextSearch search(tag.Title(), m_strSearchTerm, m_bIsCaseSensitive);
if (!search.DoSearch())
{
if (m_bSearchInDescription)
{
search.SetText(tag.PlotOutline(), m_strSearchTerm, m_bIsCaseSensitive);
if (!search.DoSearch())
{
search.SetText(tag.Plot(), m_strSearchTerm, m_bIsCaseSensitive);
if (!search.DoSearch())
return false;
}
}
else
return false;
}
}
return true;
}
示例2: MatchDuration
bool EpgSearchFilter::MatchDuration(const CEpgInfoTag &tag) const
{
bool bReturn(true);
if (m_iMinimumDuration != EPG_SEARCH_UNSET)
bReturn = (tag.GetDuration() > m_iMinimumDuration * 60);
if (bReturn && m_iMaximumDuration != EPG_SEARCH_UNSET)
bReturn = (tag.GetDuration() < m_iMaximumDuration * 60);
return bReturn;
}
示例3: 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;
}
示例4: 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;
}