本文整理汇总了C++中CPVREpgInfoTagPtr类的典型用法代码示例。如果您正苦于以下问题:C++ CPVREpgInfoTagPtr类的具体用法?C++ CPVREpgInfoTagPtr怎么用?C++ CPVREpgInfoTagPtr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CPVREpgInfoTagPtr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lock
CPVREpgInfoTagPtr CPVREpg::GetTagNow(bool bUpdateIfNeeded /* = true */) const
{
CSingleLock lock(m_critSection);
if (m_nowActiveStart.IsValid())
{
std::map<CDateTime, CPVREpgInfoTagPtr>::const_iterator it = m_tags.find(m_nowActiveStart);
if (it != m_tags.end() && it->second->IsActive())
return it->second;
}
if (bUpdateIfNeeded)
{
CPVREpgInfoTagPtr lastActiveTag;
/* one of the first items will always match if the list is sorted */
for (std::map<CDateTime, CPVREpgInfoTagPtr>::const_iterator it = m_tags.begin(); it != m_tags.end(); ++it)
{
if (it->second->IsActive())
{
m_nowActiveStart = it->first;
return it->second;
}
else if (it->second->WasActive())
lastActiveTag = it->second;
}
/* there might be a gap between the last and next event. return the last if found and it ended not more than 5 minutes ago */
if (lastActiveTag &&
lastActiveTag->EndAsUTC() + CDateTimeSpan(0, 0, 5, 0) >= CDateTime::GetUTCDateTime())
return lastActiveTag;
}
return CPVREpgInfoTagPtr();
}
示例2: lastPlayed
void CPVRChannel::Serialize(CVariant& value) const
{
value["channelid"] = m_iChannelId;
value["channeltype"] = m_bIsRadio ? "radio" : "tv";
value["hidden"] = m_bIsHidden;
value["locked"] = m_bIsLocked;
value["icon"] = m_strIconPath;
value["channel"] = m_strChannelName;
value["uniqueid"] = m_iUniqueId;
CDateTime lastPlayed(m_iLastWatched);
value["lastplayed"] = lastPlayed.IsValid() ? lastPlayed.GetAsDBDate() : "";
value["channelnumber"] = m_channelNumber.GetChannelNumber();
value["subchannelnumber"] = m_channelNumber.GetSubChannelNumber();
CPVREpgInfoTagPtr epg = GetEPGNow();
if (epg)
{
// add the properties of the current EPG item to the main object
epg->Serialize(value);
// and add an extra sub-object with only the current EPG details
epg->Serialize(value["broadcastnow"]);
}
epg = GetEPGNext();
if (epg)
epg->Serialize(value["broadcastnext"]);
value["isrecording"] = false; // compat
}
示例3: GetRecordingForEpgTag
CPVRRecordingPtr CPVRRecordings::GetRecordingForEpgTag(const CPVREpgInfoTagPtr &epgTag) const
{
if (!epgTag)
return {};
CSingleLock lock(m_critSection);
for (const auto recording : m_recordings)
{
if (recording.second->IsDeleted())
continue;
if (recording.second->ClientID() != epgTag->ClientID())
continue;
if (recording.second->ChannelUid() != epgTag->UniqueChannelID())
continue;
unsigned int iEpgEvent = recording.second->BroadcastUid();
if (iEpgEvent != EPG_TAG_INVALID_UID)
{
if (iEpgEvent == epgTag->UniqueBroadcastID())
return recording.second;
}
else
{
if (recording.second->RecordingTimeAsUTC() <= epgTag->StartAsUTC() &&
recording.second->EndTimeAsUTC() >= epgTag->EndAsUTC())
return recording.second;
}
}
return CPVRRecordingPtr();
}
示例4: GetTimerForEpgTag
CPVRTimerInfoTagPtr CPVRTimers::GetTimerForEpgTag(const CPVREpgInfoTagPtr &epgTag) const
{
if (epgTag)
{
CSingleLock lock(m_critSection);
for (const auto &tagsEntry : m_tags)
{
for (const auto &timersEntry : tagsEntry.second)
{
if (timersEntry->IsTimerRule())
continue;
if (timersEntry->GetEpgInfoTag(false) == epgTag)
return timersEntry;
if (timersEntry->m_iClientChannelUid != PVR_CHANNEL_INVALID_UID &&
timersEntry->m_iClientChannelUid == epgTag->UniqueChannelID())
{
if (timersEntry->UniqueBroadcastID() != EPG_TAG_INVALID_UID &&
timersEntry->UniqueBroadcastID() == epgTag->UniqueBroadcastID())
return timersEntry;
if (timersEntry->m_bIsRadio == epgTag->IsRadio() &&
timersEntry->StartAsUTC() <= epgTag->StartAsUTC() &&
timersEntry->EndAsUTC() >= epgTag->EndAsUTC())
return timersEntry;
}
}
}
}
return CPVRTimerInfoTagPtr();
}
示例5: GetEPGNowOrNext
int CPVRChannelGroup::GetEPGNowOrNext(CFileItemList &results, bool bGetNext) const
{
int iInitialSize = results.Size();
CPVREpgInfoTagPtr epgNext;
CPVRChannelPtr channel;
CSingleLock lock(m_critSection);
for (PVR_CHANNEL_GROUP_SORTED_MEMBERS::const_iterator it = m_sortedMembers.begin(); it != m_sortedMembers.end(); ++it)
{
channel = (*it).channel;
CPVREpgPtr epg = channel->GetEPG();
if (epg && !channel->IsHidden())
{
epgNext = bGetNext ? epg->GetTagNext() : epg->GetTagNow();
if (epgNext)
{
CFileItemPtr entry(new CFileItem(epgNext));
entry->SetLabel2(epgNext->StartAsLocalTime().GetAsLocalizedTime("", false));
entry->SetPath(channel->Path());
entry->SetArt("thumb", channel->IconPath());
results.Add(entry);
}
}
}
return results.Size() - iInitialSize;
}
示例6: GetEPGAll
int CPVRChannelGroup::GetEPGAll(CFileItemList &results, bool bIncludeChannelsWithoutEPG /* = false */) const
{
int iInitialSize = results.Size();
CPVREpgInfoTagPtr epgTag;
CPVRChannelPtr channel;
CSingleLock lock(m_critSection);
for (PVR_CHANNEL_GROUP_SORTED_MEMBERS::const_iterator it = m_sortedMembers.begin(); it != m_sortedMembers.end(); ++it)
{
channel = (*it).channel;
if (!channel->IsHidden())
{
int iAdded = 0;
CPVREpgPtr epg = channel->GetEPG();
if (epg)
{
// XXX channel pointers aren't set in some occasions. this works around the issue, but is not very nice
epg->SetChannel(channel);
iAdded = epg->Get(results);
}
if (bIncludeChannelsWithoutEPG && iAdded == 0)
{
// Add dummy EPG tag associated with this channel
epgTag = CPVREpgInfoTag::CreateDefaultTag();
epgTag->SetChannel(channel);
results.Add(CFileItemPtr(new CFileItem(epgTag)));
}
}
}
return results.Size() - iInitialSize;
}
示例7: bFoundThisType
void CGUIDialogPVRTimerSettings::InitializeTypesList()
{
m_typeEntries.clear();
// If timer is read-only or was created by a timer rule, only add current type, for information. Type can't be changed.
if (m_timerType->IsReadOnly() || m_timerInfoTag->GetTimerRuleId() != PVR_TIMER_NO_PARENT)
{
m_typeEntries.insert(std::make_pair(0, m_timerType));
return;
}
bool bFoundThisType(false);
int idx(0);
const std::vector<CPVRTimerTypePtr> types(CPVRTimerType::GetAllTypes());
for (const auto &type : types)
{
// Type definition prohibits created of new instances.
// But the dialog can act as a viewer for these types.
if (type->ForbidsNewInstances())
continue;
// Read-only timers cannot be created using this dialog.
// But the dialog can act as a viewer for read-only types.
if (type->IsReadOnly())
continue;
// Drop TimerTypes that require EPGInfo, if none is populated
if (type->RequiresEpgTagOnCreate() && !m_timerInfoTag->GetEpgInfoTag())
continue;
// Drop TimerTypes without 'Series' EPG attributes if none are set
if (type->RequiresEpgSeriesOnCreate())
{
const CPVREpgInfoTagPtr epgTag(m_timerInfoTag->GetEpgInfoTag());
if (epgTag && !epgTag->IsSeries())
continue;
}
// Drop TimerTypes that forbid EPGInfo, if it is populated
if (type->ForbidsEpgTagOnCreate() && m_timerInfoTag->GetEpgInfoTag())
continue;
// Drop TimerTypes that aren't rules if end time is in the past
if (!type->IsTimerRule() && m_timerInfoTag->EndAsLocalTime() < CDateTime::GetCurrentDateTime())
continue;
if (!bFoundThisType && *type == *m_timerType)
bFoundThisType = true;
m_typeEntries.insert(std::make_pair(idx++, type));
}
if (!bFoundThisType)
m_typeEntries.insert(std::make_pair(idx++, m_timerType));
}
示例8: MatchDuration
bool CPVREpgSearchFilter::MatchDuration(const CPVREpgInfoTagPtr &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;
}
示例9: channel
void CPVRRecording::OnDelete(void)
{
if (m_iEpgEventId != EPG_TAG_INVALID_UID)
{
const CPVRChannelPtr channel(Channel());
if (channel)
{
const CPVREpgInfoTagPtr epgTag(CServiceBroker::GetPVRManager().EpgContainer().GetTagById(channel, m_iEpgEventId));
if (epgTag)
epgTag->ClearRecording();
}
}
}
示例10: MatchGenre
bool CPVREpgSearchFilter::MatchGenre(const CPVREpgInfoTagPtr &tag) const
{
bool bReturn(true);
if (m_iGenreType != EPG_SEARCH_UNSET)
{
bool bIsUnknownGenre(tag->GenreType() > EPG_EVENT_CONTENTMASK_USERDEFINED ||
tag->GenreType() < EPG_EVENT_CONTENTMASK_MOVIEDRAMA);
bReturn = ((m_bIncludeUnknownGenres && bIsUnknownGenre) || tag->GenreType() == m_iGenreType);
}
return bReturn;
}
示例11: MatchSearchTerm
bool CPVREpgSearchFilter::MatchSearchTerm(const CPVREpgInfoTagPtr &tag) const
{
bool bReturn(true);
if (!m_strSearchTerm.empty())
{
CTextSearch search(m_strSearchTerm, m_bIsCaseSensitive, SEARCH_DEFAULT_OR);
bReturn = search.Search(tag->Title()) ||
search.Search(tag->PlotOutline()) ||
(m_bSearchInDescription && search.Search(tag->Plot()));
}
return bReturn;
}
示例12: epgentry_1
int CPVREpgSearchFilter::RemoveDuplicates(CFileItemList &results)
{
unsigned int iSize = results.Size();
for (unsigned int iResultPtr = 0; iResultPtr < iSize; iResultPtr++)
{
const CPVREpgInfoTagPtr epgentry_1(results.Get(iResultPtr)->GetEPGInfoTag());
if (!epgentry_1)
continue;
for (unsigned int iTagPtr = 0; iTagPtr < iSize; iTagPtr++)
{
if (iResultPtr == iTagPtr)
continue;
const CPVREpgInfoTagPtr epgentry_2(results.Get(iTagPtr)->GetEPGInfoTag());
if (!epgentry_2)
continue;
if (epgentry_1->Title() != epgentry_2->Title() ||
epgentry_1->Plot() != epgentry_2->Plot() ||
epgentry_1->PlotOutline() != epgentry_2->PlotOutline())
continue;
results.Remove(iTagPtr);
iResultPtr--;
iTagPtr--;
iSize--;
}
}
return iSize;
}
示例13: switch
bool CPVRGUIInfo::GetListItemAndPlayerInt(const CFileItem *item, const CGUIInfo &info, int &iValue) const
{
switch (info.m_info)
{
case LISTITEM_PROGRESS:
if (item->IsPVRChannel() || item->IsEPG())
{
const CPVREpgInfoTagPtr epgTag = CPVRItem(item).GetEpgInfoTag();
if (epgTag)
iValue = static_cast<int>(epgTag->ProgressPercentage());
}
return true;
}
return false;
}
示例14: MatchBroadcastId
bool CPVREpgSearchFilter::MatchBroadcastId(const CPVREpgInfoTagPtr &tag) const
{
if (m_iUniqueBroadcastId != EPG_TAG_INVALID_UID)
return (tag->UniqueBroadcastID() == m_iUniqueBroadcastId);
return true;
}
示例15: UpdateEntry
bool CPVREpg::UpdateEntry(const CPVREpgInfoTagPtr &tag, EPG_EVENT_STATE newState, bool bUpdateDatabase)
{
bool bRet(true);
bool bNotify(true);
if (newState == EPG_EVENT_CREATED || newState == EPG_EVENT_UPDATED)
{
bRet = UpdateEntry(tag, bUpdateDatabase);
}
else if (newState == EPG_EVENT_DELETED)
{
CSingleLock lock(m_critSection);
auto it = m_tags.begin();
for (; it != m_tags.end(); ++it)
{
if (it->second->UniqueBroadcastID() == tag->UniqueBroadcastID())
break;
}
if (it == m_tags.end())
{
bRet = false;
}
else
{
// Respect epg linger time.
int iPastDays = CServiceBroker::GetPVRManager().EpgContainer().GetPastDaysToDisplay();
const CDateTime cleanupTime(CDateTime::GetUTCDateTime() - CDateTimeSpan(iPastDays, 0, 0, 0));
if (it->second->EndAsUTC() < cleanupTime)
{
if (bUpdateDatabase)
m_deletedTags.insert(std::make_pair(it->second->UniqueBroadcastID(), it->second));
it->second->ClearTimer();
it->second->ClearRecording();
m_tags.erase(it);
}
else
{
bNotify = false;
}
}
}
else
{
CLog::Log(LOGERROR, "EPG - %s - unknown epg event state value: %d", __FUNCTION__, newState);
bRet = false;
}
if (bRet && bNotify)
{
SetChanged();
NotifyObservers(ObservableMessageEpgItemUpdate);
}
return bRet;
}