本文整理汇总了C++中CEpgInfoTag::EpgID方法的典型用法代码示例。如果您正苦于以下问题:C++ CEpgInfoTag::EpgID方法的具体用法?C++ CEpgInfoTag::EpgID怎么用?C++ CEpgInfoTag::EpgID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEpgInfoTag
的用法示例。
在下文中一共展示了CEpgInfoTag::EpgID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateEpgEvent
void CPVRTimerInfoTag::UpdateEpgEvent(bool bClear /* = false */)
{
CSingleLock lock(m_critSection);
if (bClear)
{
CEpgInfoTag *epgTag = GetEpgInfoTag();
if (epgTag)
epgTag->OnTimerDeleted();
}
else
{
/* already got an epg event set */
if (m_iEpgId != -1)
return;
/* try to get the channel */
CPVRChannel *channel = (CPVRChannel *) g_PVRChannelGroups->GetByUniqueID(m_iClientChannelUid, m_iClientId);
if (!channel)
return;
/* try to get the EPG table */
CEpg *epg = channel->GetEPG();
if (!epg)
return;
/* try to set the timer on the epg tag that matches with a 2 minute margin */
CEpgInfoTag *epgTag = (CEpgInfoTag *) epg->GetTagBetween(StartAsUTC() - CDateTimeSpan(0, 0, 2, 0), EndAsUTC() + CDateTimeSpan(0, 0, 2, 0));
if (!epgTag)
epgTag = (CEpgInfoTag *) epg->GetTagAround(StartAsUTC());
if (epgTag)
{
m_iEpgId = epgTag->EpgID();
m_epgStart = epgTag->StartAsUTC();
m_genre = epgTag->Genre();
m_iGenreType = epgTag->GenreType();
m_iGenreSubType = epgTag->GenreSubType();
epgTag->SetTimer(this);
}
}
}
示例2: 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;
}
示例3: 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;
}