本文整理汇总了C++中CEpgInfoTagPtr::SetPVRChannel方法的典型用法代码示例。如果您正苦于以下问题:C++ CEpgInfoTagPtr::SetPVRChannel方法的具体用法?C++ CEpgInfoTagPtr::SetPVRChannel怎么用?C++ CEpgInfoTagPtr::SetPVRChannel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEpgInfoTagPtr
的用法示例。
在下文中一共展示了CEpgInfoTagPtr::SetPVRChannel方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetEPGAll
int CPVRChannelGroup::GetEPGAll(CFileItemList &results, bool bIncludeChannelsWithoutEPG /* = false */) const
{
int iInitialSize = results.Size();
CEpgInfoTagPtr 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;
CEpgPtr 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 = CEpgInfoTag::CreateDefaultTag();
epgTag->SetPVRChannel(channel);
results.Add(CFileItemPtr(new CFileItem(epgTag)));
}
}
}
return results.Size() - iInitialSize;
}
示例2: UpdateEntry
bool CEpg::UpdateEntry(const CEpgInfoTag &tag, bool bUpdateDatabase /* = false */, bool bSort /* = true */)
{
CEpgInfoTagPtr infoTag;
CSingleLock lock(m_critSection);
map<CDateTime, CEpgInfoTagPtr>::iterator it = m_tags.find(tag.StartAsUTC());
bool bNewTag(false);
if (it != m_tags.end())
{
infoTag = it->second;
}
else
{
/* create a new tag if no tag with this ID exists */
infoTag.reset(new CEpgInfoTag(this, m_pvrChannel, m_strName, m_pvrChannel ? m_pvrChannel->IconPath() : ""));
infoTag->SetUniqueBroadcastID(tag.UniqueBroadcastID());
m_tags.insert(make_pair(tag.StartAsUTC(), infoTag));
bNewTag = true;
}
infoTag->Update(tag, bNewTag);
infoTag->SetEpg(this);
infoTag->SetPVRChannel(m_pvrChannel);
if (bUpdateDatabase)
m_changedTags.insert(make_pair(infoTag->UniqueBroadcastID(), infoTag));
return true;
}
示例3: UpdateEntry
bool CEpg::UpdateEntry(const CEpgInfoTagPtr &tag, bool bUpdateDatabase /* = false */)
{
CEpgInfoTagPtr infoTag;
{
CSingleLock lock(m_critSection);
std::map<CDateTime, CEpgInfoTagPtr>::iterator it = m_tags.find(tag->StartAsUTC());
bool bNewTag(false);
if (it != m_tags.end())
{
infoTag = it->second;
}
else
{
infoTag.reset(new CEpgInfoTag(this, m_pvrChannel, m_strName, m_pvrChannel ? m_pvrChannel->IconPath() : ""));
infoTag->SetUniqueBroadcastID(tag->UniqueBroadcastID());
m_tags.insert(std::make_pair(tag->StartAsUTC(), infoTag));
bNewTag = true;
}
infoTag->Update(*tag, bNewTag);
infoTag->SetEpg(this);
infoTag->SetPVRChannel(m_pvrChannel);
if (bUpdateDatabase)
m_changedTags.insert(std::make_pair(infoTag->UniqueBroadcastID(), infoTag));
}
infoTag->SetTimer(g_PVRTimers->GetTimerForEpgTag(infoTag));
infoTag->SetRecording(g_PVRRecordings->GetRecordingForEpgTag(infoTag));
return true;
}
示例4: AddEntry
void CEpg::AddEntry(const CEpgInfoTag &tag)
{
CEpgInfoTagPtr newTag;
CPVRChannelPtr channel;
{
CSingleLock lock(m_critSection);
std::map<CDateTime, CEpgInfoTagPtr>::iterator itr = m_tags.find(tag.StartAsUTC());
if (itr != m_tags.end())
newTag = itr->second;
else
{
newTag.reset(new CEpgInfoTag(this, m_pvrChannel, m_strName, m_pvrChannel ? m_pvrChannel->IconPath() : ""));
m_tags.insert(make_pair(tag.StartAsUTC(), newTag));
}
channel = m_pvrChannel;
}
if (newTag)
{
newTag->Update(tag);
newTag->SetPVRChannel(channel);
newTag->SetEpg(this);
newTag->SetTimer(g_PVRTimers->GetTimerForEpgTag(newTag));
newTag->SetRecording(g_PVRRecordings->GetRecordingForEpgTag(newTag));
}
}
示例5: AddEntry
void CEpg::AddEntry(const CEpgInfoTag &tag)
{
CEpgInfoTagPtr newTag;
CSingleLock lock(m_critSection);
map<CDateTime, CEpgInfoTagPtr>::iterator itr = m_tags.find(tag.StartAsUTC());
if (itr != m_tags.end())
newTag = itr->second;
else
{
newTag = CEpgInfoTagPtr(new CEpgInfoTag(this, m_pvrChannel, m_strName, m_pvrChannel ? m_pvrChannel->IconPath() : StringUtils::EmptyString));
m_tags.insert(make_pair(tag.StartAsUTC(), newTag));
}
if (newTag)
{
newTag->Update(tag);
newTag->SetPVRChannel(m_pvrChannel);
newTag->m_epg = this;
newTag->m_bChanged = false;
}
}
示例6: UpdateEntry
bool CEpg::UpdateEntry(const CEpgInfoTagPtr &tag, EPG_EVENT_STATE newState, std::map<CDateTime, CEpgInfoTagPtr>::iterator &eit, bool bUpdateDatabase /* = false */)
{
CEpgInfoTagPtr infoTag;
bool bNewTag(false);
CSingleLock lock(m_critSection);
if (newState == EPG_EVENT_CREATED || newState == EPG_EVENT_UPDATED)
{
// Reuse passed iterator in favor of doing expensive find self
auto it = (eit == m_tags.end()) ? m_tags.find(tag->StartAsUTC()) : eit;
if (it != m_tags.end())
{
if (newState == EPG_EVENT_CREATED)
CLog::Log(LOGERROR, "EPG - %s - Error: EPG_EVENT_CREATED: uid %d found! Updating existing event.", __FUNCTION__, tag->UniqueBroadcastID());
infoTag = it->second;
}
else
{
if (newState == EPG_EVENT_UPDATED)
CLog::Log(LOGERROR, "EPG - %s - Error: EPG_EVENT_UPDATED: uid %d not found. Inserting new event.", __FUNCTION__, tag->UniqueBroadcastID());
infoTag.reset(new CEpgInfoTag(this, m_pvrChannel, m_strName, m_pvrChannel ? m_pvrChannel->IconPath() : ""));
infoTag->SetUniqueBroadcastID(tag->UniqueBroadcastID());
m_tags.insert(std::make_pair(tag->StartAsUTC(), infoTag));
bNewTag = true;
}
}
else if (newState == EPG_EVENT_DELETED)
{
// Reuse passed iterator in favor of doing expensive find self
auto it = (eit == m_tags.end()) ? m_tags.find(tag->StartAsUTC()) : eit;
if (it == m_tags.end())
{
// not guranteed that deleted tag contains valid start time. search sequential.
for (it = m_tags.begin(); it != m_tags.end(); ++it)
{
if (it->second->UniqueBroadcastID() == tag->UniqueBroadcastID())
break;
}
}
if (it != m_tags.end())
{
it->second->ClearTimer();
m_tags.erase(it);
if (bUpdateDatabase)
m_deletedTags.insert(std::make_pair(infoTag->UniqueBroadcastID(), infoTag));
}
else
{
CLog::Log(LOGERROR, "EPG - %s - Error: EPG_EVENT_DELETED: uid %d not found.", __FUNCTION__, tag->UniqueBroadcastID());
return false;
}
return true;
}
else
{
CLog::Log(LOGERROR, "EPG - %s - unknownn epg event state '%d'.", __FUNCTION__, newState);
return false;
}
infoTag->Update(*tag, bNewTag);
infoTag->SetEpg(this);
infoTag->SetPVRChannel(m_pvrChannel);
if (bUpdateDatabase)
m_changedTags.insert(std::make_pair(infoTag->UniqueBroadcastID(), infoTag));
return true;
}