本文整理汇总了C++中CFileItemList::RemoveDiscCache方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItemList::RemoveDiscCache方法的具体用法?C++ CFileItemList::RemoveDiscCache怎么用?C++ CFileItemList::RemoveDiscCache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItemList
的用法示例。
在下文中一共展示了CFileItemList::RemoveDiscCache方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDirectory
bool CGUIWindowPVRGuideBase::GetDirectory(const std::string &strDirectory, CFileItemList &items)
{
bool bRefreshTimelineItems = false;
{
CSingleLock lock(m_critSection);
if (m_cachedChannelGroup && *m_cachedChannelGroup != *GetChannelGroup())
{
// channel group change and not very first open of this window. force immediate update.
m_bRefreshTimelineItems = true;
bRefreshTimelineItems = true;
}
}
// never call DoRefresh with locked mutex!
if (bRefreshTimelineItems)
m_refreshTimelineItemsThread->DoRefresh();
{
CSingleLock lock(m_critSection);
// Note: no need to do anything if no new data available. items always contains previous data.
if (m_newTimeline)
{
items.RemoveDiscCache(GetID());
items.Assign(*m_newTimeline, false);
m_newTimeline.reset();
}
}
return true;
}
示例2: GetViewTimelineItems
void CGUIWindowPVRGuide::GetViewTimelineItems(CFileItemList &items)
{
CGUIEPGGridContainer* epgGridContainer = dynamic_cast<CGUIEPGGridContainer*>(GetControl(m_viewControl.GetCurrentControl()));
if (!epgGridContainer)
return;
CPVRChannelGroupPtr group;
{
CSingleLock lock(m_critSection);
// group change detected reset grid coordinates and refresh grid items
if (!m_bRefreshTimelineItems && *m_cachedChannelGroup != *GetGroup())
{
epgGridContainer->ResetCoordinates();
m_bRefreshTimelineItems = true;
RefreshTimelineItems();
}
if (m_newTimeline != nullptr)
{
m_cachedTimeline = m_newTimeline;
m_newTimeline.reset();
}
items.Clear();
items.RemoveDiscCache(GetID());
items.Assign(*m_cachedTimeline, false);
group = m_cachedChannelGroup;
}
CDateTime startDate(group->GetFirstEPGDate());
CDateTime endDate(group->GetLastEPGDate());
CDateTime currentDate = CDateTime::GetCurrentDateTime().GetAsUTCDateTime();
if (!startDate.IsValid())
startDate = currentDate;
if (!endDate.IsValid() || endDate < startDate)
endDate = startDate;
// limit start to linger time
CDateTime maxPastDate = currentDate - CDateTimeSpan(0, 0, g_advancedSettings.m_iEpgLingerTime, 0);
if (startDate < maxPastDate)
startDate = maxPastDate;
epgGridContainer->SetStartEnd(startDate, endDate);
}
示例3: GetViewTimelineItems
void CGUIWindowPVRGuide::GetViewTimelineItems(CFileItemList &items)
{
CGUIEPGGridContainer* epgGridContainer = (CGUIEPGGridContainer*) GetControl(m_viewControl.GetCurrentControl());
if (!epgGridContainer)
return;
CPVRChannelGroupPtr group = GetGroup();
if (m_bUpdateRequired || m_cachedTimeline->IsEmpty() || *m_cachedChannelGroup != *group)
{
m_bUpdateRequired = false;
m_cachedTimeline->Clear();
m_cachedChannelGroup = group;
m_cachedChannelGroup->GetEPGAll(*m_cachedTimeline);
}
items.Clear();
items.RemoveDiscCache(GetID());
items.Assign(*m_cachedTimeline, false);
CDateTime startDate(m_cachedChannelGroup->GetFirstEPGDate());
CDateTime endDate(m_cachedChannelGroup->GetLastEPGDate());
CDateTime currentDate = CDateTime::GetCurrentDateTime().GetAsUTCDateTime();
if (!startDate.IsValid())
startDate = currentDate;
if (!endDate.IsValid() || endDate < startDate)
endDate = startDate;
// limit start to linger time
CDateTime maxPastDate = currentDate - CDateTimeSpan(0, 0, g_advancedSettings.m_iEpgLingerTime, 0);
if (startDate < maxPastDate)
startDate = maxPastDate;
epgGridContainer->SetStartEnd(startDate, endDate);
SET_CONTROL_LABEL(CONTROL_LABEL_HEADER1, g_localizeStrings.Get(19032));
SET_CONTROL_LABEL(CONTROL_LABEL_HEADER2, GetGroup()->GroupName());
epgGridContainer->SetChannel(GetSelectedItemPath(m_bRadio));
}
示例4: GetViewTimelineItems
void CGUIWindowPVRGuide::GetViewTimelineItems(CFileItemList &items)
{
CGUIEPGGridContainer* epgGridContainer = (CGUIEPGGridContainer*) GetControl(m_viewControl.GetCurrentControl());
if (!epgGridContainer)
return;
CPVRChannelGroupPtr group = GetGroup();
// group change detected reset grid coordinate
if (*m_cachedChannelGroup != *group)
epgGridContainer->ResetCoordinates();
if (m_bUpdateRequired || m_cachedTimeline->IsEmpty() || *m_cachedChannelGroup != *group)
{
m_bUpdateRequired = false;
m_cachedTimeline->Clear();
m_cachedChannelGroup = group;
m_cachedChannelGroup->GetEPGAll(*m_cachedTimeline, true);
}
items.Clear();
items.RemoveDiscCache(GetID());
items.Assign(*m_cachedTimeline, false);
CDateTime startDate(m_cachedChannelGroup->GetFirstEPGDate());
CDateTime endDate(m_cachedChannelGroup->GetLastEPGDate());
CDateTime currentDate = CDateTime::GetCurrentDateTime().GetAsUTCDateTime();
if (!startDate.IsValid())
startDate = currentDate;
if (!endDate.IsValid() || endDate < startDate)
endDate = startDate;
// limit start to linger time
CDateTime maxPastDate = currentDate - CDateTimeSpan(0, 0, g_advancedSettings.m_iEpgLingerTime, 0);
if (startDate < maxPastDate)
startDate = maxPastDate;
epgGridContainer->SetStartEnd(startDate, endDate);
}
示例5: GetDirectory
bool CGUIWindowPVRGuide::GetDirectory(const std::string &strDirectory, CFileItemList &items)
{
bool bRefresh = false;
{
CSingleLock lock(m_critSection);
// group change detected reset grid coordinates and refresh grid items
if (!m_bRefreshTimelineItems && *m_cachedChannelGroup != *GetChannelGroup())
{
CGUIEPGGridContainer* epgGridContainer = GetGridControl();
if (!epgGridContainer)
return true;
epgGridContainer->ResetCoordinates();
m_bRefreshTimelineItems = true;
bRefresh = true;
}
}
// never call RefreshTimelineItems with locked mutex!
if (bRefresh)
RefreshTimelineItems();
{
CSingleLock lock(m_critSection);
// Note: no need to do anything if no new data available. items always contains previous data.
if (m_newTimeline)
{
items.RemoveDiscCache(GetID());
items.Assign(*m_newTimeline, false);
m_newTimeline.reset();
}
}
return true;
}
示例6: GetViewTimelineItems
void CGUIWindowPVRGuide::GetViewTimelineItems(CFileItemList &items)
{
CSingleLock lock(m_critSection);
// group change detected reset grid coordinates and refresh grid items
if (!m_bRefreshTimelineItems && *m_cachedChannelGroup != *GetChannelGroup())
{
CGUIEPGGridContainer* epgGridContainer = GetGridControl();
if (!epgGridContainer)
return;
epgGridContainer->ResetCoordinates();
m_bRefreshTimelineItems = true;
RefreshTimelineItems();
}
// Note: no need to do anything if no new data available. items always contains previous data.
if (m_newTimeline)
{
items.RemoveDiscCache(GetID());
items.Assign(*m_newTimeline, false);
m_newTimeline.reset();
}
}
示例7: OnMessage
//.........这里部分代码省略.........
if (!m_rootDir.IsInSource(m_vecItems->GetPath()))
{ // don't have this share any more
if (IsActive()) Update("");
else
{
m_history.ClearPathHistory();
m_vecItems->SetPath("");
}
}
}
return true;
}
else if (message.GetParam1()==GUI_MSG_UPDATE_SOURCES)
{ // State of the sources changed, so update our view
if ((m_vecItems->IsVirtualDirectoryRoot() ||
m_vecItems->IsSourcesPath()) && IsActive())
{
int iItem = m_viewControl.GetSelectedItem();
Update(m_vecItems->GetPath());
m_viewControl.SetSelectedItem(iItem);
}
return true;
}
else if (message.GetParam1()==GUI_MSG_UPDATE && IsActive())
{
if (message.GetNumStringParams())
{
m_vecItems->SetPath(message.GetStringParam());
if (message.GetParam2()) // param2 is used for resetting the history
SetHistoryForPath(m_vecItems->GetPath());
}
// clear any cached listing
m_vecItems->RemoveDiscCache(GetID());
Update(m_vecItems->GetPath());
}
else if (message.GetParam1()==GUI_MSG_UPDATE_ITEM && message.GetItem())
{
CFileItemPtr newItem = boost::static_pointer_cast<CFileItem>(message.GetItem());
if (IsActive())
{
if (m_vecItems->UpdateItem(newItem.get()) && message.GetParam2() == 1)
{ // need the list updated as well
UpdateFileList();
}
}
else if (newItem)
{ // need to remove the disc cache
CFileItemList items;
CStdString path;
URIUtils::GetDirectory(newItem->GetPath(), path);
items.SetPath(path);
items.RemoveDiscCache(GetID());
}
}
else if (message.GetParam1()==GUI_MSG_UPDATE_PATH)
{
if (IsActive())
{
if((message.GetStringParam() == m_vecItems->GetPath()) ||
(m_vecItems->IsMultiPath() && XFILE::CMultiPathDirectory::HasPath(m_vecItems->GetPath(), message.GetStringParam())))
{
Update(m_vecItems->GetPath());
}
}
}
示例8: OnMessage
//.........这里部分代码省略.........
m_vecItems->m_strPath="";
}
}
}
return true;
}
else if (message.GetParam1()==GUI_MSG_UPDATE_SOURCES)
{ // State of the sources changed, so update our view
if (m_vecItems->IsVirtualDirectoryRoot() && IsActive())
{
int iItem = m_viewControl.GetSelectedItem();
Update(m_vecItems->m_strPath);
m_viewControl.SetSelectedItem(iItem);
}
return true;
}
else if (message.GetParam1()==GUI_MSG_UPDATE && IsActive())
{
if (message.GetStringParam().size())
{
m_vecItems->m_strPath = message.GetStringParam();
SetHistoryForPath(m_vecItems->m_strPath);
}
Update(m_vecItems->m_strPath);
}
else if (message.GetParam1()==GUI_MSG_UPDATE_ITEM && message.GetItem())
{
CFileItemPtr newItem = boost::static_pointer_cast<CFileItem>(message.GetItem());
if (IsActive())
m_vecItems->UpdateItem(newItem.get());
else if (newItem)
{ // need to remove the disc cache
CFileItemList items;
CUtil::GetDirectory(newItem->m_strPath, items.m_strPath);
items.RemoveDiscCache();
}
}
else if (message.GetParam1()==GUI_MSG_UPDATE_PATH)
{
if (message.GetStringParam() == m_vecItems->m_strPath && IsActive())
Update(m_vecItems->m_strPath);
}
else
return CGUIWindow::OnMessage(message);
return true;
}
break;
case GUI_MSG_PLAYBACK_STARTED:
case GUI_MSG_PLAYBACK_ENDED:
case GUI_MSG_PLAYBACK_STOPPED:
case GUI_MSG_PLAYLIST_CHANGED:
case GUI_MSG_PLAYLISTPLAYER_STOPPED:
case GUI_MSG_PLAYLISTPLAYER_STARTED:
case GUI_MSG_PLAYLISTPLAYER_CHANGED:
{ // send a notify all to all controls on this window
CGUIMessage msg(GUI_MSG_NOTIFY_ALL, GetID(), 0, GUI_MSG_REFRESH_LIST);
OnMessage(msg);
break;
}
case GUI_MSG_CHANGE_VIEW_MODE:
{
int viewMode = 0;
if (message.GetParam1()) // we have an id
viewMode = m_viewControl.GetViewModeByID(message.GetParam1());
else if (message.GetParam2())
viewMode = m_viewControl.GetNextViewMode((int)message.GetParam2());
if (m_guiState.get())
m_guiState->SaveViewAsControl(viewMode);
UpdateButtons();
return true;
}
break;
case GUI_MSG_CHANGE_SORT_METHOD:
{
if (m_guiState.get())
{
if (message.GetParam1())
m_guiState->SetCurrentSortMethod((int)message.GetParam1());
else if (message.GetParam2())
m_guiState->SetNextSortMethod((int)message.GetParam2());
}
UpdateFileList();
return true;
}
break;
case GUI_MSG_CHANGE_SORT_DIRECTION:
{
if (m_guiState.get())
m_guiState->SetNextSortOrder();
UpdateFileList();
return true;
}
break;
}
return CGUIWindow::OnMessage(message);
}