本文整理汇总了C++中CEpgInfoTagPtr类的典型用法代码示例。如果您正苦于以下问题:C++ CEpgInfoTagPtr类的具体用法?C++ CEpgInfoTagPtr怎么用?C++ CEpgInfoTagPtr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CEpgInfoTagPtr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ClearEpgTag
void CPVRTimerInfoTag::ClearEpgTag(void)
{
CEpgInfoTagPtr deletedTag;
{
CSingleLock lock(m_critSection);
deletedTag = m_epgTag;
m_epgTag.reset();
}
if (deletedTag)
deletedTag->ClearTimer();
}
示例2: epgentry_1
int EpgSearchFilter::RemoveDuplicates(CFileItemList &results)
{
unsigned int iSize = results.Size();
for (unsigned int iResultPtr = 0; iResultPtr < iSize; iResultPtr++)
{
const CEpgInfoTagPtr epgentry_1(results.Get(iResultPtr)->GetEPGInfoTag());
if (!epgentry_1)
continue;
for (unsigned int iTagPtr = 0; iTagPtr < iSize; iTagPtr++)
{
if (iResultPtr == iTagPtr)
continue;
const CEpgInfoTagPtr 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;
}
示例3: tag
bool CGUIWindowPVRBase::StopRecordFile(const CFileItem &item)
{
if (!item.HasEPGInfoTag())
return false;
const CEpgInfoTagPtr tag(item.GetEPGInfoTag());
if (!tag || !tag->HasPVRChannel())
return false;
CFileItemPtr timer = g_PVRTimers->GetTimerForEpgTag(&item);
if (!timer || !timer->HasPVRTimerInfoTag() || timer->GetPVRTimerInfoTag()->m_bIsRepeating)
return false;
return g_PVRTimers->DeleteTimer(*timer);
}
示例4: StartRecordFile
bool CGUIWindowPVRBase::StartRecordFile(CFileItem *item, bool bAdvanced)
{
if (!item->HasEPGInfoTag())
return false;
const CEpgInfoTagPtr tag = item->GetEPGInfoTag();
CPVRChannelPtr channel = tag->ChannelTag();
if (!channel || !g_PVRManager.CheckParentalLock(channel))
return false;
CFileItemPtr timer = g_PVRTimers->GetTimerForEpgTag(item);
if (timer && timer->HasPVRTimerInfoTag())
{
CGUIDialogOK::ShowAndGetInput(CVariant{19033}, CVariant{19034});
return false;
}
bool bReturn(false);
if (bAdvanced)
{
CPVRTimerInfoTagPtr newTimer = CPVRTimerInfoTag::CreateFromEpg(tag, true);
if (newTimer)
{
CFileItem *newItem = new CFileItem(newTimer);
if (ShowTimerSettings(newItem))
bReturn = g_PVRTimers->AddTimer(newItem->GetPVRTimerInfoTag());
delete newItem;
}
}
else
{
// ask for confirmation before starting a timer
if (!CGUIDialogYesNo::ShowAndGetInput(
CVariant{264} /* "Record" */, CVariant{tag->PVRChannelName()}, CVariant{""}, CVariant{tag->Title()}))
return false;
CPVRTimerInfoTagPtr newTimer = CPVRTimerInfoTag::CreateFromEpg(tag);
if (newTimer)
bReturn = g_PVRTimers->AddTimer(newTimer);
}
return bReturn;
}
示例5: tag
void CGUIDialogPVRGuideInfo::OnInitWindow()
{
CGUIDialog::OnInitWindow();
const CEpgInfoTagPtr tag(m_progItem->GetEPGInfoTag());
if (!tag)
{
/* no epg event selected */
return;
}
if (!tag->HasRecording())
{
/* not recording. hide the play recording button */
SET_CONTROL_HIDDEN(CONTROL_BTN_PLAY_RECORDING);
}
if (tag->EndAsLocalTime() <= CDateTime::GetCurrentDateTime())
{
/* event has passed. hide the record button */
SET_CONTROL_HIDDEN(CONTROL_BTN_RECORD);
return;
}
CFileItemPtr match = g_PVRTimers->GetTimerForEpgTag(m_progItem.get());
if (!match || !match->HasPVRTimerInfoTag())
{
/* no timer present on this tag */
if (tag->StartAsLocalTime() < CDateTime::GetCurrentDateTime())
SET_CONTROL_LABEL(CONTROL_BTN_RECORD, 264); // Record
else
SET_CONTROL_LABEL(CONTROL_BTN_RECORD, 19061); // Add timer
}
else
{
/* timer present on this tag */
if (tag->StartAsLocalTime() < CDateTime::GetCurrentDateTime())
SET_CONTROL_LABEL(CONTROL_BTN_RECORD, 19059); // Stop recording
else if (match->HasPVRTimerInfoTag() &&
match->GetPVRTimerInfoTag()->HasTimerType() &&
!match->GetPVRTimerInfoTag()->GetTimerType()->IsReadOnly())
SET_CONTROL_LABEL(CONTROL_BTN_RECORD, 19060); // Delete timer
else
SET_CONTROL_HIDDEN(CONTROL_BTN_RECORD);
}
}
示例6: channel
bool CPVRGUIActions::AddTimer(const CFileItemPtr &item, bool bCreateRule, bool bShowTimerSettings) const
{
const CPVRChannelPtr channel(CPVRItem(item).GetChannel());
if (!channel)
{
CLog::Log(LOGERROR, "CPVRGUIActions - %s - no channel!", __FUNCTION__);
return false;
}
if (!g_PVRManager.CheckParentalLock(channel))
return false;
const CEpgInfoTagPtr epgTag(CPVRItem(item).GetEpgInfoTag());
if (!epgTag && bCreateRule)
{
CLog::Log(LOGERROR, "CPVRGUIActions - %s - no epg tag!", __FUNCTION__);
return false;
}
CPVRTimerInfoTagPtr timer(bCreateRule || !epgTag ? nullptr : epgTag->Timer());
CPVRTimerInfoTagPtr rule (bCreateRule ? g_PVRTimers->GetTimerRule(timer) : nullptr);
if (timer || rule)
{
CGUIDialogOK::ShowAndGetInput(CVariant{19033}, CVariant{19034}); // "Information", "There is already a timer set for this event"
return false;
}
CPVRTimerInfoTagPtr newTimer(epgTag ? CPVRTimerInfoTag::CreateFromEpg(epgTag, bCreateRule) : CPVRTimerInfoTag::CreateInstantTimerTag(channel));
if (!newTimer)
{
CGUIDialogOK::ShowAndGetInput(CVariant{19033},
bCreateRule
? CVariant{19095} // "Information", "Timer rule creation failed. The PVR add-on does not support a suitable timer rule type."
: CVariant{19094}); // "Information", "Timer creation failed. The PVR add-on does not support a suitable timer type."
return false;
}
if (bShowTimerSettings)
{
if (!ShowTimerSettings(newTimer))
return false;
}
return g_PVRTimers->AddTimer(newTimer);
}
示例7: lock
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;
}
示例8: lock
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));
}
}
示例9: UpdateEntry
bool CEpg::UpdateEntry(const CEpgInfoTagPtr &tag, EPG_EVENT_STATE newState, bool bUpdateDatabase /* = false */)
{
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.
const CDateTime cleanupTime(CDateTime::GetUTCDateTime() - CDateTimeSpan(0, g_advancedSettings.m_iEpgLingerTime / 60, g_advancedSettings.m_iEpgLingerTime % 60, 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;
}
示例10: tag
bool CGUIWindowPVRBase::StopRecordFile(CFileItem *item)
{
if (!item->HasEPGInfoTag())
return false;
const CEpgInfoTagPtr tag(item->GetEPGInfoTag());
if (!tag || !tag->HasPVRChannel())
return false;
CFileItemPtr timer = g_PVRTimers->GetTimerForEpgTag(item);
if (!timer || !timer->HasPVRTimerInfoTag())
return false;
bool bDeleteScheduled(false);
if (ConfirmDeleteTimer(timer.get(), bDeleteScheduled))
return g_PVRTimers->DeleteTimer(*timer, false, bDeleteScheduled);
return false;
}
示例11: GetChannelNumber
void CGUIWindowPVRGuide::OnInputDone()
{
const int iChannelNumber = GetChannelNumber();
if (iChannelNumber >= 0)
{
for (const CFileItemPtr event : m_vecItems->GetList())
{
const CEpgInfoTagPtr tag(event->GetEPGInfoTag());
if (tag->HasPVRChannel() && tag->PVRChannelNumber() == iChannelNumber)
{
CGUIEPGGridContainer* epgGridContainer = dynamic_cast<CGUIEPGGridContainer*>(GetControl(m_viewControl.GetCurrentControl()));
if (epgGridContainer)
{
epgGridContainer->SetChannel(tag->ChannelTag());
return;
}
}
}
}
}
示例12: lock
bool CEpg::InfoTagNow(CEpgInfoTag &tag, bool bUpdateIfNeeded /* = true */)
{
CSingleLock lock(m_critSection);
if (m_nowActiveStart.IsValid())
{
map<CDateTime, CEpgInfoTagPtr>::const_iterator it = m_tags.find(m_nowActiveStart);
if (it != m_tags.end() && it->second->IsActive())
{
tag = *it->second;
return true;
}
}
if (bUpdateIfNeeded)
{
CEpgInfoTagPtr lastActiveTag;
/* one of the first items will always match if the list is sorted */
for (map<CDateTime, CEpgInfoTagPtr>::const_iterator it = m_tags.begin(); it != m_tags.end(); it++)
{
if (it->second->IsActive())
{
m_nowActiveStart = it->first;
tag = *it->second;
return true;
}
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())
{
tag = *lastActiveTag;
return true;
}
}
return false;
}
示例13: switch
bool CGUIWindowPVRSearch::OnContextButton(const CFileItem &item, CONTEXT_BUTTON button)
{
bool bReturn = false;
switch(button)
{
case CONTEXT_BUTTON_FIND:
{
m_searchfilter.Reset();
// construct the search term
if (item.IsEPG())
m_searchfilter.m_strSearchTerm = "\"" + item.GetEPGInfoTag()->Title() + "\"";
else if (item.IsPVRChannel())
{
const CEpgInfoTagPtr tag(item.GetPVRChannelInfoTag()->GetEPGNow());
if (tag)
m_searchfilter.m_strSearchTerm = "\"" + tag->Title() + "\"";
}
else if (item.IsUsablePVRRecording())
m_searchfilter.m_strSearchTerm = "\"" + item.GetPVRRecordingInfoTag()->m_strTitle + "\"";
else if (item.IsPVRTimer())
{
const CPVRTimerInfoTagPtr info(item.GetPVRTimerInfoTag());
const CEpgInfoTagPtr tag(info->GetEpgInfoTag());
if (tag)
m_searchfilter.m_strSearchTerm = "\"" + tag->Title() + "\"";
else
m_searchfilter.m_strSearchTerm = "\"" + info->m_strTitle + "\"";
}
m_bSearchConfirmed = true;
Refresh(true);
bReturn = true;
break;
}
default:
bReturn = false;
}
return bReturn;
}
示例14: ShowEPGInfo
void CGUIWindowPVRBase::ShowEPGInfo(CFileItem *item)
{
CEpgInfoTagPtr epgTag;
CPVRChannelPtr channel;
if (item->IsEPG())
{
epgTag = item->GetEPGInfoTag();
channel = epgTag->ChannelTag();
}
else if (item->IsPVRChannel())
{
channel = item->GetPVRChannelInfoTag();
epgTag = channel->GetEPGNow();
}
else if (item->IsPVRTimer())
{
epgTag = item->GetPVRTimerInfoTag()->GetEpgInfoTag();
if (epgTag && epgTag->HasPVRChannel())
channel = epgTag->ChannelTag();
}
if (channel && !g_PVRManager.CheckParentalLock(channel))
return;
if (!epgTag)
{
CLog::Log(LOGERROR, "CGUIWindowPVRBase - %s - no epg tag!", __FUNCTION__);
return;
}
CGUIDialogPVRGuideInfo* pDlgInfo = (CGUIDialogPVRGuideInfo*)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_GUIDE_INFO);
if (!pDlgInfo)
{
CLog::Log(LOGERROR, "CGUIWindowPVRBase - %s - unable to get WINDOW_DIALOG_PVR_GUIDE_INFO!", __FUNCTION__);
return;
}
pDlgInfo->SetProgInfo(epgTag);
pDlgInfo->Open();
}
示例15: AddTimer
JSONRPC_STATUS CPVROperations::AddTimer(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
if (!g_PVRManager.IsStarted())
return FailedToExecute;
const CEpgInfoTagPtr epgTag = g_EpgContainer.GetTagById(CPVRChannelPtr(), parameterObject["broadcastid"].asUnsignedInteger());
if (!epgTag)
return InvalidParams;
if (epgTag->HasTimer())
return InvalidParams;
CPVRTimerInfoTagPtr newTimer = CPVRTimerInfoTag::CreateFromEpg(epgTag, parameterObject["timerrule"].asBoolean(false));
if (newTimer)
{
if (g_PVRTimers->AddTimer(newTimer))
return ACK;
}
return FailedToExecute;
}