本文整理汇总了C++中CEpgInfoTag类的典型用法代码示例。如果您正苦于以下问题:C++ CEpgInfoTag类的具体用法?C++ CEpgInfoTag怎么用?C++ CEpgInfoTag使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CEpgInfoTag类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lock
bool CEpg::InfoTagNow(CEpgInfoTag &tag) const
{
CSingleLock lock(m_critSection);
if (!m_nowActive || !m_nowActive->IsActive())
{
CDateTime now = CDateTime::GetCurrentDateTime().GetAsUTCDateTime();
/* one of the first items will always match if the list is sorted */
for (unsigned int iTagPtr = 0; iTagPtr < size(); iTagPtr++)
{
CEpgInfoTag *tag = at(iTagPtr);
if (tag->StartAsUTC() <= now && tag->EndAsUTC() > now)
{
m_nowActive = tag;
break;
}
}
}
if (m_nowActive)
tag = *m_nowActive;
return m_nowActive != NULL;
}
示例2: lock
CEpgInfoTagPtr CEpg::GetPreviousEvent(const CEpgInfoTag& tag) const
{
CSingleLock lock(m_critSection);
std::map<CDateTime, CEpgInfoTagPtr>::const_iterator it = m_tags.find(tag.StartAsUTC());
if (it != m_tags.end() && it != m_tags.begin())
{
--it;
return it->second;
}
CEpgInfoTagPtr retVal;
return retVal;
}
示例3: ActionPlayEpg
bool CGUIWindowPVRCommon::ActionPlayEpg(CFileItem *item)
{
bool bReturn = false;
CEpgInfoTag *epgTag = item->GetEPGInfoTag();
if (!epgTag)
return bReturn;
const CPVRChannel *channel = epgTag->ChannelTag();
if (!channel || channel->ChannelNumber() > 0)
return bReturn;
bReturn = g_application.PlayFile(CFileItem(*channel));
if (!bReturn)
{
/* cannot play file */
CGUIDialogOK::ShowAndGetInput(19033,0,19035,0);
}
return bReturn;
}
示例4: ActionPlayEpg
bool CGUIWindowPVRCommon::ActionPlayEpg(CFileItem *item)
{
CEpgInfoTag *epgTag = item->GetEPGInfoTag();
if (!epgTag)
return false;
CPVRChannelPtr channel = epgTag->ChannelTag();
if (!channel || channel->ChannelNumber() > 0 ||
!g_PVRManager.CheckParentalLock(*channel))
return false;
PlayBackRet ret = g_application.PlayFile(CFileItem(*channel));
if (ret == PLAYBACK_FAIL)
{
CStdString msg;
msg.Format(g_localizeStrings.Get(19035).c_str(), channel->ChannelName().c_str()); // CHANNELNAME could not be played. Check the log for details.
CGUIDialogOK::ShowAndGetInput(19033, 0, msg, 0);
}
return ret == PLAYBACK_OK;
}
示例5: MatchChannelNumber
bool EpgSearchFilter::MatchChannelNumber(const CEpgInfoTag &tag) const
{
bool bReturn(true);
if (m_iChannelNumber != EPG_SEARCH_UNSET && g_PVRManager.IsStarted())
{
const CPVRChannelGroup *group = (m_iChannelGroup != EPG_SEARCH_UNSET) ? g_PVRChannelGroups->GetByIdFromAll(m_iChannelGroup) : g_PVRChannelGroups->GetGroupAllTV();
if (!group)
group = CPVRManager::Get().ChannelGroups()->GetGroupAllTV();
bReturn = (m_iChannelNumber == (int) group->GetChannelNumber(*tag.ChannelTag()));
}
return bReturn;
}
示例6: IsRemovableTag
bool CEpg::IsRemovableTag(const CEpgInfoTag &tag) const
{
return !tag.HasTimer();
}
示例7: GetEpgInfoTag
CPVRTimerInfoTag::~CPVRTimerInfoTag(void)
{
CEpgInfoTag *tag = GetEpgInfoTag();
if (tag)
tag->OnTimerDeleted();
}
示例8: Persist
int CEpgDatabase::Persist(const CEpgInfoTag &tag, bool bSingleUpdate /* = true */, bool bLastUpdate /* = false */)
{
int iReturn = -1;
const CEpg *epg = tag.GetTable();
if (!epg || epg->EpgID() <= 0)
{
CLog::Log(LOGERROR, "%s - tag '%s' does not have a valid table", __FUNCTION__, tag.Title().c_str());
return iReturn;
}
time_t iStartTime, iEndTime, iFirstAired;
tag.StartAsUTC().GetAsTime(iStartTime);
tag.EndAsUTC().GetAsTime(iEndTime);
tag.FirstAiredAsUTC().GetAsTime(iFirstAired);
int iEpgId = epg->EpgID();
int iBroadcastId = tag.BroadcastId();
if (iBroadcastId <= 0)
{
CStdString strWhereClause;
if (tag.UniqueBroadcastID() > 0)
{
strWhereClause = FormatSQL("(iBroadcastUid = '%u' OR iStartTime = %u) AND idEpg = %u",
tag.UniqueBroadcastID(), iStartTime, iEpgId);
}
else
{
strWhereClause = FormatSQL("iStartTime = %u AND idEpg = '%u'",
iStartTime, iEpgId);
}
CStdString strValue = GetSingleValue("epgtags", "idBroadcast", strWhereClause);
if (!strValue.IsEmpty())
iBroadcastId = atoi(strValue);
}
CStdString strQuery;
if (iBroadcastId < 0)
{
strQuery = FormatSQL("INSERT INTO epgtags (idEpg, iStartTime, "
"iEndTime, sTitle, sPlotOutline, sPlot, iGenreType, iGenreSubType, "
"iFirstAired, iParentalRating, iStarRating, bNotify, iSeriesId, "
"iEpisodeId, iEpisodePart, sEpisodeName, iBroadcastUid) "
"VALUES (%u, %u, %u, '%s', '%s', '%s', %i, %i, %u, %i, %i, %i, %i, %i, %i, '%s', %i);",
iEpgId, iStartTime, iEndTime,
tag.Title().c_str(), tag.PlotOutline().c_str(), tag.Plot().c_str(), tag.GenreType(), tag.GenreSubType(),
iFirstAired, tag.ParentalRating(), tag.StarRating(), tag.Notify(),
tag.SeriesNum(), tag.EpisodeNum(), tag.EpisodePart(), tag.EpisodeName().c_str(),
tag.UniqueBroadcastID());
}
else
{
strQuery = FormatSQL("REPLACE INTO epgtags (idEpg, iStartTime, "
"iEndTime, sTitle, sPlotOutline, sPlot, iGenreType, iGenreSubType, "
"iFirstAired, iParentalRating, iStarRating, bNotify, iSeriesId, "
"iEpisodeId, iEpisodePart, sEpisodeName, iBroadcastUid, idBroadcast) "
"VALUES (%u, %u, %u, '%s', '%s', '%s', %i, %i, %u, %i, %i, %i, %i, %i, %i, '%s', %i, %i);",
iEpgId, iStartTime, iEndTime,
tag.Title().c_str(), tag.PlotOutline().c_str(), tag.Plot().c_str(), tag.GenreType(), tag.GenreSubType(),
tag.FirstAiredAsUTC().GetAsDBDateTime().c_str(), tag.ParentalRating(), tag.StarRating(), tag.Notify(),
tag.SeriesNum(), tag.EpisodeNum(), tag.EpisodePart(), tag.EpisodeName().c_str(),
tag.UniqueBroadcastID(), iBroadcastId);
}
if (bSingleUpdate)
{
if (ExecuteQuery(strQuery))
iReturn = (int) m_pDS->lastinsertid();
}
else
{
QueueInsertQuery(strQuery);
if (bLastUpdate)
CommitInsertQueries();
iReturn = 0;
}
return iReturn;
}
示例9: 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;
}
示例10: Persist
int CEpgDatabase::Persist(const CEpgInfoTag &tag, bool bSingleUpdate /* = true */)
{
int iReturn(-1);
if (tag.EpgID() <= 0)
{
CLog::Log(LOGERROR, "%s - tag '%s' does not have a valid table", __FUNCTION__, tag.Title(true).c_str());
return iReturn;
}
time_t iStartTime, iEndTime, iFirstAired;
tag.StartAsUTC().GetAsTime(iStartTime);
tag.EndAsUTC().GetAsTime(iEndTime);
tag.FirstAiredAsUTC().GetAsTime(iFirstAired);
int iBroadcastId = tag.BroadcastId();
std::string strQuery;
/* Only store the genre string when needed */
std::string strGenre = (tag.GenreType() == EPG_GENRE_USE_STRING) ? StringUtils::Join(tag.Genre(), g_advancedSettings.m_videoItemSeparator) : "";
if (iBroadcastId < 0)
{
strQuery = PrepareSQL("REPLACE INTO epgtags (idEpg, iStartTime, "
"iEndTime, sTitle, sPlotOutline, sPlot, sIconPath, iGenreType, iGenreSubType, sGenre, "
"iFirstAired, iParentalRating, iStarRating, bNotify, iSeriesId, "
"iEpisodeId, iEpisodePart, sEpisodeName, iBroadcastUid, sRecordingId) "
"VALUES (%u, %u, %u, '%s', '%s', '%s', '%s', %i, %i, '%s', %u, %i, %i, %i, %i, %i, %i, '%s', %i, '%s');",
tag.EpgID(), iStartTime, iEndTime,
tag.Title(true).c_str(), tag.PlotOutline(true).c_str(), tag.Plot(true).c_str(), tag.Icon().c_str(), tag.GenreType(), tag.GenreSubType(), strGenre.c_str(),
iFirstAired, tag.ParentalRating(), tag.StarRating(), tag.Notify(),
tag.SeriesNum(), tag.EpisodeNum(), tag.EpisodePart(), tag.EpisodeName().c_str(),
tag.UniqueBroadcastID(), tag.RecordingId().c_str());
}
else
{
strQuery = PrepareSQL("REPLACE INTO epgtags (idEpg, iStartTime, "
"iEndTime, sTitle, sPlotOutline, sPlot, sIconPath, iGenreType, iGenreSubType, sGenre, "
"iFirstAired, iParentalRating, iStarRating, bNotify, iSeriesId, "
"iEpisodeId, iEpisodePart, sEpisodeName, iBroadcastUid, idBroadcast, sRecordingId) "
"VALUES (%u, %u, %u, '%s', '%s', '%s', '%s', %i, %i, '%s', %u, %i, %i, %i, %i, %i, %i, '%s', %i, %i, '%s');",
tag.EpgID(), iStartTime, iEndTime,
tag.Title(true).c_str(), tag.PlotOutline(true).c_str(), tag.Plot(true).c_str(), tag.Icon().c_str(), tag.GenreType(), tag.GenreSubType(), strGenre.c_str(),
iFirstAired, tag.ParentalRating(), tag.StarRating(), tag.Notify(),
tag.SeriesNum(), tag.EpisodeNum(), tag.EpisodePart(), tag.EpisodeName().c_str(),
tag.UniqueBroadcastID(), iBroadcastId, tag.RecordingId().c_str());
}
if (bSingleUpdate)
{
if (ExecuteQuery(strQuery))
iReturn = (int) m_pDS->lastinsertid();
}
else
{
QueueInsertQuery(strQuery);
iReturn = 0;
}
return iReturn;
}
示例11: MatchStartAndEndTimes
bool EpgSearchFilter::MatchStartAndEndTimes(const CEpgInfoTag &tag) const
{
return (tag.StartAsLocalTime() >= m_startDateTime && tag.EndAsLocalTime() <= m_endDateTime);
}
示例12: MatchChannelType
bool EpgSearchFilter::MatchChannelType(const CEpgInfoTag &tag) const
{
return (g_PVRManager.IsStarted() && tag.ChannelTag()->IsRadio() == m_bIsRadio);
}
示例13: Persist
int CEpgDatabase::Persist(const CEpgInfoTag &tag, bool bSingleUpdate /* = true */)
{
int iReturn(-1);
const CEpg *epg = tag.GetTable();
if (!epg || epg->EpgID() <= 0)
{
CLog::Log(LOGERROR, "%s - tag '%s' does not have a valid table", __FUNCTION__, tag.Title().c_str());
return iReturn;
}
time_t iStartTime, iEndTime, iFirstAired;
tag.StartAsUTC().GetAsTime(iStartTime);
tag.EndAsUTC().GetAsTime(iEndTime);
tag.FirstAiredAsUTC().GetAsTime(iFirstAired);
int iEpgId = epg->EpgID();
if (bSingleUpdate)
{
Delete(*tag.GetTable(), iStartTime, iEndTime);
}
int iBroadcastId = tag.BroadcastId();
CSingleLock lock(m_critSection);
CStdString strQuery;
/* Only store the genre string when needed */
CStdString strGenre = (tag.GenreType() == EPG_GENRE_USE_STRING) ? tag.Genre() : "";
if (iBroadcastId < 0)
{
strQuery = FormatSQL("INSERT INTO epgtags (idEpg, iStartTime, "
"iEndTime, sTitle, sPlotOutline, sPlot, iGenreType, iGenreSubType, sGenre, "
"iFirstAired, iParentalRating, iStarRating, bNotify, iSeriesId, "
"iEpisodeId, iEpisodePart, sEpisodeName, iBroadcastUid) "
"VALUES (%u, %u, %u, '%s', '%s', '%s', %i, %i, '%s', %u, %i, %i, %i, %i, %i, %i, '%s', %i);",
iEpgId, iStartTime, iEndTime,
tag.Title().c_str(), tag.PlotOutline().c_str(), tag.Plot().c_str(), tag.GenreType(), tag.GenreSubType(), strGenre.c_str(),
iFirstAired, tag.ParentalRating(), tag.StarRating(), tag.Notify(),
tag.SeriesNum(), tag.EpisodeNum(), tag.EpisodePart(), tag.EpisodeName().c_str(),
tag.UniqueBroadcastID());
}
else
{
strQuery = FormatSQL("REPLACE INTO epgtags (idEpg, iStartTime, "
"iEndTime, sTitle, sPlotOutline, sPlot, iGenreType, iGenreSubType, sGenre, "
"iFirstAired, iParentalRating, iStarRating, bNotify, iSeriesId, "
"iEpisodeId, iEpisodePart, sEpisodeName, iBroadcastUid, idBroadcast) "
"VALUES (%u, %u, %u, '%s', '%s', '%s', %i, %i, '%s', %u, %i, %i, %i, %i, %i, %i, '%s', %i, %i);",
iEpgId, iStartTime, iEndTime,
tag.Title().c_str(), tag.PlotOutline().c_str(), tag.Plot().c_str(), tag.GenreType(), tag.GenreSubType(), strGenre.c_str(),
iFirstAired, tag.ParentalRating(), tag.StarRating(), tag.Notify(),
tag.SeriesNum(), tag.EpisodeNum(), tag.EpisodePart(), tag.EpisodeName().c_str(),
tag.UniqueBroadcastID(), iBroadcastId);
}
if (bSingleUpdate)
{
if (ExecuteQuery(strQuery))
iReturn = (int) m_pDS->lastinsertid();
}
else
{
QueueInsertQuery(strQuery);
iReturn = 0;
}
return iReturn;
}
示例14: lock
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;
}
示例15: Update
bool CEpgInfoTag::Update(const CEpgInfoTag &tag, bool bUpdateBroadcastId /* = true */)
{
bool bChanged(false);
{
CSingleLock lock(m_critSection);
bChanged = (m_pvrChannel != tag.m_pvrChannel);
}
{
bChanged |= (
m_strTitle != tag.m_strTitle ||
m_strPlotOutline != tag.m_strPlotOutline ||
m_strPlot != tag.m_strPlot ||
m_strOriginalTitle != tag.m_strOriginalTitle ||
m_strCast != tag.m_strCast ||
m_strDirector != tag.m_strDirector ||
m_strWriter != tag.m_strWriter ||
m_iYear != tag.m_iYear ||
m_strIMDBNumber != tag.m_strIMDBNumber ||
m_startTime != tag.m_startTime ||
m_endTime != tag.m_endTime ||
m_iGenreType != tag.m_iGenreType ||
m_iGenreSubType != tag.m_iGenreSubType ||
m_firstAired != tag.m_firstAired ||
m_iParentalRating != tag.m_iParentalRating ||
m_iStarRating != tag.m_iStarRating ||
m_bNotify != tag.m_bNotify ||
m_iEpisodeNumber != tag.m_iEpisodeNumber ||
m_iEpisodePart != tag.m_iEpisodePart ||
m_iSeriesNumber != tag.m_iSeriesNumber ||
m_strEpisodeName != tag.m_strEpisodeName ||
m_iUniqueBroadcastID != tag.m_iUniqueBroadcastID ||
EpgID() != tag.EpgID() ||
m_genre != tag.m_genre ||
m_strIconPath != tag.m_strIconPath
);
if (bUpdateBroadcastId)
bChanged |= (m_iBroadcastId != tag.m_iBroadcastId);
if (bChanged)
{
if (bUpdateBroadcastId)
m_iBroadcastId = tag.m_iBroadcastId;
m_strTitle = tag.m_strTitle;
m_strPlotOutline = tag.m_strPlotOutline;
m_strPlot = tag.m_strPlot;
m_strOriginalTitle = tag.m_strOriginalTitle;
m_strCast = tag.m_strCast;
m_strDirector = tag.m_strDirector;
m_strWriter = tag.m_strWriter;
m_iYear = tag.m_iYear;
m_strIMDBNumber = tag.m_strIMDBNumber;
m_startTime = tag.m_startTime;
m_endTime = tag.m_endTime;
m_iGenreType = tag.m_iGenreType;
m_iGenreSubType = tag.m_iGenreSubType;
m_epg = tag.m_epg;
{
CSingleLock lock(m_critSection);
m_pvrChannel = tag.m_pvrChannel;
}
if (m_iGenreType == EPG_GENRE_USE_STRING)
{
/* No type/subtype. Use the provided description */
m_genre = tag.m_genre;
}
else
{
/* Determine genre description by type/subtype */
m_genre = StringUtils::Split(CEpg::ConvertGenreIdToString(tag.m_iGenreType, tag.m_iGenreSubType), g_advancedSettings.m_videoItemSeparator);
}
m_firstAired = tag.m_firstAired;
m_iParentalRating = tag.m_iParentalRating;
m_iStarRating = tag.m_iStarRating;
m_bNotify = tag.m_bNotify;
m_iEpisodeNumber = tag.m_iEpisodeNumber;
m_iEpisodePart = tag.m_iEpisodePart;
m_iSeriesNumber = tag.m_iSeriesNumber;
m_strEpisodeName = tag.m_strEpisodeName;
m_iUniqueBroadcastID = tag.m_iUniqueBroadcastID;
m_strIconPath = tag.m_strIconPath;
}
}
if (bChanged)
UpdatePath();
return bChanged;
}