本文整理汇总了C++中CFileItemList::GetContent方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItemList::GetContent方法的具体用法?C++ CFileItemList::GetContent怎么用?C++ CFileItemList::GetContent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItemList
的用法示例。
在下文中一共展示了CFileItemList::GetContent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckFilterAdvanced
bool CGUIWindowMusicBase::CheckFilterAdvanced(CFileItemList &items) const
{
CStdString content = items.GetContent();
if ((items.IsMusicDb() || CanContainFilter(m_strFilterPath)) &&
(content.Equals("artists") || content.Equals("albums") || content.Equals("songs")))
return true;
return false;
}
示例2: CGUIViewStateWindowVideo
CGUIViewStateVideoEpisodes::CGUIViewStateVideoEpisodes(const CFileItemList& items) : CGUIViewStateWindowVideo(items)
{
if (0)//params.GetSeason() > -1)
{
AddSortMethod(SortByEpisodeNumber, 20359, LABEL_MASKS("%E. %T","%R")); // Episode. Title, Rating | empty, empty
AddSortMethod(SortByRating, 563, LABEL_MASKS("%E. %T", "%R")); // Episode. Title, Rating | empty, empty
AddSortMethod(SortByUserRating, 38018, LABEL_MASKS("%E. %T", "%r")); // Episode. Title, Userrating | empty, empty
AddSortMethod(SortByMPAA, 20074, LABEL_MASKS("%E. %T", "%O")); // Episode. Title, MPAA | empty, empty
AddSortMethod(SortByProductionCode, 20368, LABEL_MASKS("%E. %T","%P", "%E. %T","%P")); // Episode. Title, Production Code | Episode. Title, Production Code
AddSortMethod(SortByDate, 552, LABEL_MASKS("%E. %T","%J","E. %T","%J")); // Episode. Title, Date | Episode. Title, Date
if (CMediaSettings::GetInstance().GetWatchedMode(items.GetContent()) == WatchedModeAll)
AddSortMethod(SortByPlaycount, 567, LABEL_MASKS("%E. %T", "%V")); // Episode. Title, Playcount | empty, empty
}
else
{ // format here is tvshowtitle - season/episode number. episode title
AddSortMethod(SortByEpisodeNumber, 20359, LABEL_MASKS("%Z - %H. %T","%R")); // TvShow - Order. Title, Rating | empty, empty
AddSortMethod(SortByRating, 563, LABEL_MASKS("%Z - %H. %T", "%R")); // TvShow - Order. Title, Rating | empty, empty
AddSortMethod(SortByUserRating, 38018, LABEL_MASKS("%Z - %H. %T", "%r")); // TvShow - Order. Title, Userrating | empty, empty
AddSortMethod(SortByMPAA, 20074, LABEL_MASKS("%Z - %H. %T", "%O")); // TvShow - Order. Title, MPAA | empty, empty
AddSortMethod(SortByProductionCode, 20368, LABEL_MASKS("%Z - %H. %T","%P")); // TvShow - Order. Title, Production Code | empty, empty
AddSortMethod(SortByDate, 552, LABEL_MASKS("%Z - %H. %T","%J")); // TvShow - Order. Title, Date | empty, empty
if (CMediaSettings::GetInstance().GetWatchedMode(items.GetContent()) == WatchedModeAll)
AddSortMethod(SortByPlaycount, 567, LABEL_MASKS("%H. %T", "%V")); // Order. Title, Playcount | empty, empty
}
AddSortMethod(SortByLabel, 551, LABEL_MASKS("%Z - %H. %T","%R"), // TvShow - Order. Title, Rating | empty, empty
CSettings::GetInstance().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
const CViewState *viewState = CViewStateSettings::GetInstance().Get("videonavepisodes");
if (items.IsSmartPlayList() || items.IsLibraryFolder())
AddPlaylistOrder(items, LABEL_MASKS("%Z - %H. %T", "%R")); // TvShow - Order. Title, Rating | empty, empty
else
{
SetSortMethod(viewState->m_sortDescription);
SetSortOrder(viewState->m_sortDescription.sortOrder);
}
SetViewAsControl(viewState->m_viewMode);
LoadViewState(items.GetPath(), WINDOW_VIDEO_NAV);
}
示例3: CheckFilterAdvanced
bool CGUIWindowMusicBase::CheckFilterAdvanced(CFileItemList &items) const
{
std::string content = items.GetContent();
if ((items.IsMusicDb() || CanContainFilter(m_strFilterPath)) &&
(StringUtils::EqualsNoCase(content, "artists") ||
StringUtils::EqualsNoCase(content, "albums") ||
StringUtils::EqualsNoCase(content, "songs")))
return true;
return false;
}
示例4: OnPrepareFileItems
void CGUIWindowVideoNav::OnPrepareFileItems(CFileItemList &items)
{
CGUIWindowVideoBase::OnPrepareFileItems(items);
// set fanart
CQueryParams params;
CVideoDatabaseDirectory dir;
dir.GetQueryParams(items.m_strPath,params);
if (params.GetContentType() == VIDEODB_CONTENT_MUSICVIDEOS)
CGUIWindowMusicNav::SetupFanart(items);
NODE_TYPE node = dir.GetDirectoryChildType(items.m_strPath);
// now filter as necessary
bool filterWatched=false;
if (node == NODE_TYPE_EPISODES
|| node == NODE_TYPE_SEASONS
|| node == NODE_TYPE_TITLE_MOVIES
|| node == NODE_TYPE_TITLE_TVSHOWS
|| node == NODE_TYPE_TITLE_MUSICVIDEOS
|| node == NODE_TYPE_RECENTLY_ADDED_EPISODES
|| node == NODE_TYPE_RECENTLY_ADDED_MOVIES
|| node == NODE_TYPE_RECENTLY_ADDED_MUSICVIDEOS)
filterWatched = true;
if (!items.IsVideoDb())
filterWatched = true;
if (items.IsSmartPlayList() && items.GetContent() == "tvshows")
node = NODE_TYPE_TITLE_TVSHOWS; // so that the check below works
int watchMode = g_settings.GetWatchMode(m_vecItems->GetContent());
for (int i = 0; i < items.Size(); i++)
{
CFileItemPtr item = items.Get(i);
if(item->HasVideoInfoTag() && (node == NODE_TYPE_TITLE_TVSHOWS || node == NODE_TYPE_SEASONS))
{
if (watchMode == VIDEO_SHOW_UNWATCHED)
item->GetVideoInfoTag()->m_iEpisode = item->GetPropertyInt("unwatchedepisodes");
if (watchMode == VIDEO_SHOW_WATCHED)
item->GetVideoInfoTag()->m_iEpisode = item->GetPropertyInt("watchedepisodes");
item->SetProperty("numepisodes", item->GetVideoInfoTag()->m_iEpisode);
}
if(filterWatched)
{
if((watchMode==VIDEO_SHOW_WATCHED && item->GetVideoInfoTag()->m_playCount== 0)
|| (watchMode==VIDEO_SHOW_UNWATCHED && item->GetVideoInfoTag()->m_playCount > 0))
{
items.Remove(i);
i--;
}
}
}
}
示例5: LoadVideoInfo
void CGUIWindowVideoNav::LoadVideoInfo(CFileItemList &items)
{
// TODO: this could possibly be threaded as per the music info loading,
// we could also cache the info
if (!items.GetContent().IsEmpty())
return; // don't load for listings that have content set
CStdString content = m_database.GetContentForPath(items.m_strPath);
if (content.IsEmpty())
{
items.SetContent("files");
return;
}
items.SetContent(content);
bool clean = (g_guiSettings.GetBool("myvideos.cleanstrings") &&
!items.IsVirtualDirectoryRoot() &&
m_stackingAvailable);
if (!content.IsEmpty())
{
for (int i = 0; i < items.Size(); i++)
{
CFileItemPtr pItem = items[i];
CFileItem item;
if (m_database.GetItemForPath(content, pItem->m_strPath, item))
{ // copy info across
pItem->UpdateInfo(item);
// TODO: we may wish to use a playable_url parameter here rather than
// switching the path of the item (eg movie as a folder)
pItem->m_strPath = item.m_strPath;
pItem->m_bIsFolder = item.m_bIsFolder;
}
else
{
if (clean)
pItem->CleanString();
}
}
}
else
{
for (int i = 0; i < items.Size(); i++)
{
CFileItemPtr pItem = items[i];
int playCount = m_database.GetPlayCount(*pItem);
if (playCount >= 0)
pItem->SetOverlayImage(CGUIListItem::ICON_OVERLAY_UNWATCHED, playCount > 0);
if (clean)
pItem->CleanString();
}
}
}
示例6: GetDirectory
bool CGUIWindowPictures::GetDirectory(const std::string &strDirectory, CFileItemList& items)
{
if (!CGUIMediaWindow::GetDirectory(strDirectory, items))
return false;
std::string label;
if (items.GetLabel().empty() && m_rootDir.IsSource(items.GetPath(), CMediaSourceSettings::GetInstance().GetSources("pictures"), &label))
items.SetLabel(label);
if (items.GetContent().empty() && !items.IsVirtualDirectoryRoot() && !items.IsPlugin())
items.SetContent("images");
return true;
}
示例7: GetDirectory
bool CGUIWindowMusicNav::GetDirectory(const CStdString &strDirectory, CFileItemList &items)
{
if (m_bDisplayEmptyDatabaseMessage)
return true;
if (m_thumbLoader.IsLoading())
m_thumbLoader.StopThread();
bool bResult = CGUIWindowMusicBase::GetDirectory(strDirectory, items);
if (bResult)
{
if (items.IsPlayList())
OnRetrieveMusicInfo(items);
if (!items.IsMusicDb())
{
items.SetCachedMusicThumbs();
m_thumbLoader.Load(*m_vecItems);
}
}
// update our content in the info manager
if (strDirectory.Left(10).Equals("videodb://"))
{
CVideoDatabaseDirectory dir;
VIDEODATABASEDIRECTORY::NODE_TYPE node = dir.GetDirectoryChildType(strDirectory);
if (node == VIDEODATABASEDIRECTORY::NODE_TYPE_TITLE_MUSICVIDEOS)
items.SetContent("musicvideos");
}
else if (items.GetContent().IsEmpty())
{
CMusicDatabaseDirectory dir;
NODE_TYPE node = dir.GetDirectoryChildType(strDirectory);
if (node == NODE_TYPE_ALBUM)
items.SetContent("albums");
else if (node == NODE_TYPE_ARTIST)
items.SetContent("artists");
else if (node == NODE_TYPE_SONG)
items.SetContent("songs");
}
// clear the filter
m_filter.Empty();
return bResult;
}
示例8: LoadVideoInfo
void CGUIWindowVideoNav::LoadVideoInfo(CFileItemList &items, CVideoDatabase &database, bool allowReplaceLabels)
{
//! @todo this could possibly be threaded as per the music info loading,
//! we could also cache the info
if (!items.GetContent().empty() && !items.IsPlugin())
return; // don't load for listings that have content set and weren't created from plugins
std::string content = items.GetContent();
// determine content only if it isn't set
if (content.empty())
{
content = database.GetContentForPath(items.GetPath());
items.SetContent((content.empty() && !items.IsPlugin()) ? "files" : content);
}
/*
If we have a matching item in the library, so we can assign the metadata to it. In addition, we can choose
* whether the item is stacked down (eg in the case of folders representing a single item)
* whether or not we assign the library's labels to the item, or leave the item as is.
As certain users (read: certain developers) don't want either of these to occur, we compromise by stacking
items down only if stacking is available and enabled.
Similarly, we assign the "clean" library labels to the item only if the "Replace filenames with library titles"
setting is enabled.
*/
const bool stackItems = items.GetProperty("isstacked").asBoolean() || (StackingAvailable(items) && CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_STACKVIDEOS));
const bool replaceLabels = allowReplaceLabels && CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_REPLACELABELS);
CFileItemList dbItems;
/* NOTE: In the future when GetItemsForPath returns all items regardless of whether they're "in the library"
we won't need the fetchedPlayCounts code, and can "simply" do this directly on absence of content. */
bool fetchedPlayCounts = false;
if (!content.empty())
{
database.GetItemsForPath(content, items.GetPath(), dbItems);
dbItems.SetFastLookup(true);
}
for (int i = 0; i < items.Size(); i++)
{
CFileItemPtr pItem = items[i];
CFileItemPtr match;
if (!content.empty()) /* optical media will be stacked down, so it's path won't match the base path */
{
std::string pathToMatch = pItem->IsOpticalMediaFile() ? pItem->GetLocalMetadataPath() : pItem->GetPath();
if (URIUtils::IsMultiPath(pathToMatch))
pathToMatch = CMultiPathDirectory::GetFirstPath(pathToMatch);
match = dbItems.Get(pathToMatch);
}
if (match)
{
pItem->UpdateInfo(*match, replaceLabels);
if (stackItems)
{
if (match->m_bIsFolder)
pItem->SetPath(match->GetVideoInfoTag()->m_strPath);
else
pItem->SetPath(match->GetVideoInfoTag()->m_strFileNameAndPath);
// if we switch from a file to a folder item it means we really shouldn't be sorting files and
// folders separately
if (pItem->m_bIsFolder != match->m_bIsFolder)
{
items.SetSortIgnoreFolders(true);
pItem->m_bIsFolder = match->m_bIsFolder;
}
}
}
else
{
/* NOTE: Currently we GetPlayCounts on our items regardless of whether content is set
as if content is set, GetItemsForPaths doesn't return anything not in the content tables.
This code can be removed once the content tables are always filled */
if (!pItem->m_bIsFolder && !fetchedPlayCounts)
{
database.GetPlayCounts(items.GetPath(), items);
fetchedPlayCounts = true;
}
// set the watched overlay
if (pItem->IsVideo())
pItem->SetOverlayImage(CGUIListItem::ICON_OVERLAY_UNWATCHED, pItem->HasVideoInfoTag() && pItem->GetVideoInfoTag()->GetPlayCount() > 0);
}
}
}
示例9: GetDirectory
//.........这里部分代码省略.........
items.SetContent("episodes");
int seasonID = -1;
int seasonParam = params.GetSeason();
// grab all season art when flatten always
if (seasonParam == -2 && iFlatten == 2)
seasonParam = -1;
if (seasonParam >= -1)
seasonID = m_database.GetSeasonId(details.m_iDbId, seasonParam);
else
seasonID = items[firstIndex]->GetVideoInfoTag()->m_iIdSeason;
CGUIListItem::ArtMap seasonArt;
if (seasonID > -1 && m_database.GetArtForItem(seasonID, MediaTypeSeason, seasonArt))
{
items.AppendArt(seasonArt, MediaTypeSeason);
// set an art fallback for "thumb"
if (items.HasArt("season.poster"))
items.SetArtFallback("thumb", "season.poster");
else if (items.HasArt("season.banner"))
items.SetArtFallback("thumb", "season.banner");
}
}
else
items.SetContent("seasons");
}
else if (node == NODE_TYPE_TITLE_MOVIES ||
node == NODE_TYPE_RECENTLY_ADDED_MOVIES)
{
if (params.GetSetId() > 0)
{
CGUIListItem::ArtMap setArt;
if (m_database.GetArtForItem(params.GetSetId(), MediaTypeVideoCollection, setArt))
{
items.AppendArt(setArt, MediaTypeVideoCollection);
items.SetArtFallback("fanart", "set.fanart");
if (items.HasArt("set.poster"))
items.SetArtFallback("thumb", "set.poster");
}
}
items.SetContent("movies");
}
else if (node == NODE_TYPE_TITLE_TVSHOWS ||
node == NODE_TYPE_INPROGRESS_TVSHOWS)
items.SetContent("tvshows");
else if (node == NODE_TYPE_TITLE_MUSICVIDEOS ||
node == NODE_TYPE_RECENTLY_ADDED_MUSICVIDEOS)
items.SetContent("musicvideos");
else if (node == NODE_TYPE_GENRE)
items.SetContent("genres");
else if (node == NODE_TYPE_COUNTRY)
items.SetContent("countries");
else if (node == NODE_TYPE_ACTOR)
{
if (params.GetContentType() == VIDEODB_CONTENT_MUSICVIDEOS)
items.SetContent("artists");
else
items.SetContent("actors");
}
else if (node == NODE_TYPE_DIRECTOR)
items.SetContent("directors");
else if (node == NODE_TYPE_STUDIO)
items.SetContent("studios");
else if (node == NODE_TYPE_YEAR)
items.SetContent("years");
else if (node == NODE_TYPE_MUSICVIDEOS_ALBUM)
items.SetContent("albums");
else if (node == NODE_TYPE_SETS)
items.SetContent("sets");
else if (node == NODE_TYPE_TAGS)
items.SetContent("tags");
else
items.SetContent("");
}
else if (URIUtils::PathEquals(items.GetPath(), "special://videoplaylists/"))
items.SetContent("playlists");
else if (!items.IsVirtualDirectoryRoot())
{ // load info from the database
std::string label;
if (items.GetLabel().empty() && m_rootDir.IsSource(items.GetPath(), CMediaSourceSettings::GetInstance().GetSources("video"), &label))
items.SetLabel(label);
if (!items.IsSourcesPath() && !items.IsLibraryFolder())
LoadVideoInfo(items);
}
CVideoDbUrl videoUrl;
if (videoUrl.FromString(items.GetPath()) && items.GetContent() == "tags" &&
!items.Contains("newtag://" + videoUrl.GetType()))
{
CFileItemPtr newTag(new CFileItem("newtag://" + videoUrl.GetType(), false));
newTag->SetLabel(g_localizeStrings.Get(20462));
newTag->SetLabelPreformated(true);
newTag->SetSpecialSort(SortSpecialOnTop);
items.Add(newTag);
}
}
return bResult;
}
示例10: ApplyWatchedFilter
bool CGUIWindowVideoNav::ApplyWatchedFilter(CFileItemList &items)
{
bool listchanged = false;
CVideoDatabaseDirectory dir;
NODE_TYPE node = dir.GetDirectoryChildType(items.GetPath());
// now filter watched items as necessary
bool filterWatched=false;
if (node == NODE_TYPE_EPISODES
|| node == NODE_TYPE_SEASONS
|| node == NODE_TYPE_SETS
|| node == NODE_TYPE_TAGS
|| node == NODE_TYPE_TITLE_MOVIES
|| node == NODE_TYPE_TITLE_TVSHOWS
|| node == NODE_TYPE_TITLE_MUSICVIDEOS
|| node == NODE_TYPE_RECENTLY_ADDED_EPISODES
|| node == NODE_TYPE_RECENTLY_ADDED_MOVIES
|| node == NODE_TYPE_RECENTLY_ADDED_MUSICVIDEOS)
filterWatched = true;
if (!items.IsVideoDb())
filterWatched = true;
if (items.GetContent() == "tvshows" &&
(items.IsSmartPlayList() || items.IsLibraryFolder()))
node = NODE_TYPE_TITLE_TVSHOWS; // so that the check below works
int watchMode = CMediaSettings::GetInstance().GetWatchedMode(m_vecItems->GetContent());
for (int i = 0; i < items.Size(); i++)
{
CFileItemPtr item = items.Get(i);
if(item->HasVideoInfoTag() && (node == NODE_TYPE_TITLE_TVSHOWS || node == NODE_TYPE_SEASONS))
{
if (watchMode == WatchedModeUnwatched)
item->GetVideoInfoTag()->m_iEpisode = (int)item->GetProperty("unwatchedepisodes").asInteger();
if (watchMode == WatchedModeWatched)
item->GetVideoInfoTag()->m_iEpisode = (int)item->GetProperty("watchedepisodes").asInteger();
if (watchMode == WatchedModeAll)
item->GetVideoInfoTag()->m_iEpisode = (int)item->GetProperty("totalepisodes").asInteger();
item->SetProperty("numepisodes", item->GetVideoInfoTag()->m_iEpisode);
listchanged = true;
}
if (filterWatched)
{
if(!item->IsParentFolder() && // Don't delete the go to parent folder
((watchMode == WatchedModeWatched && item->GetVideoInfoTag()->GetPlayCount() == 0) ||
(watchMode == WatchedModeUnwatched && item->GetVideoInfoTag()->GetPlayCount() > 0)))
{
items.Remove(i);
i--;
listchanged = true;
}
}
}
// Remove the parent folder icon, if it's the only thing in the folder. This is needed for hiding seasons.
if (items.GetObjectCount() == 0 && items.GetFileCount() > 0 && items.Get(0)->IsParentFolder())
items.Remove(0);
if(node == NODE_TYPE_TITLE_TVSHOWS || node == NODE_TYPE_SEASONS)
{
// the watched filter may change the "numepisodes" property which is reflected in the TV_SHOWS and SEASONS nodes
// therefore, the items labels have to be refreshed, and possibly the list needs resorting as well.
items.ClearSortState(); // this is needed to force resorting even if sort method did not change
FormatAndSort(items);
}
return listchanged;
}
示例11: if
//.........这里部分代码省略.........
AddSortMethod(SortByNumberOfEpisodes, 20360, LABEL_MASKS("%L", "%M", "%L", "%M")); // Label, #Episodes | Label, #Episodes
AddSortMethod(SortByLastPlayed, 568, LABEL_MASKS("%T", "%p", "%T", "%p")); // Title, #Last played | Title, #Last played
AddSortMethod(SortByDateAdded, 570, LABEL_MASKS("%T", "%a", "%T", "%a")); // Title, DateAdded | Title, DateAdded
AddSortMethod(SortByYear, 562, LABEL_MASKS("%L","%Y","%L","%Y")); // Label, Year | Label, Year
AddSortMethod(SortByUserRating, 38018, LABEL_MASKS("%T", "%r", "%T", "%r")); // Title, Userrating | Title, Userrating
SetSortMethod(SortByLabel);
const CViewState *viewState = CViewStateSettings::GetInstance().Get("videonavtvshows");
SetViewAsControl(viewState->m_viewMode);
SetSortOrder(viewState->m_sortDescription.sortOrder);
}
break;
case NODE_TYPE_MUSICVIDEOS_ALBUM:
case NODE_TYPE_GENRE:
case NODE_TYPE_COUNTRY:
case NODE_TYPE_STUDIO:
{
AddSortMethod(SortByLabel, 551, LABEL_MASKS("%T", "%R", "%L", "")); // Title, Rating | Label, empty
SetSortMethod(SortByLabel);
const CViewState *viewState = CViewStateSettings::GetInstance().Get("videonavgenres");
SetViewAsControl(viewState->m_viewMode);
SetSortOrder(viewState->m_sortDescription.sortOrder);
}
break;
case NODE_TYPE_SETS:
{
AddSortMethod(SortByLabel, sortAttributes, 551, LABEL_MASKS("%T","%R", "%T","%R")); // Title, Rating | Title, Rating
AddSortMethod(SortByYear, 562, LABEL_MASKS("%T", "%Y", "%T", "%Y")); // Title, Year | Title, Year
AddSortMethod(SortByRating, 563, LABEL_MASKS("%T", "%R", "%T", "%R")); // Title, Rating | Title, Rating
AddSortMethod(SortByDateAdded, 570, LABEL_MASKS("%T", "%a", "%T", "%a")); // Title, DateAdded | Title, DateAdded
if (CMediaSettings::GetInstance().GetWatchedMode(items.GetContent()) == WatchedModeAll)
AddSortMethod(SortByPlaycount, 567, LABEL_MASKS("%T", "%V", "%T", "%V")); // Title, Playcount | Title, Playcount
SetSortMethod(SortByLabel);
const CViewState *viewState = CViewStateSettings::GetInstance().Get("videonavgenres");
SetViewAsControl(viewState->m_viewMode);
SetSortOrder(viewState->m_sortDescription.sortOrder);
}
break;
case NODE_TYPE_TAGS:
{
AddSortMethod(SortByLabel, sortAttributes, 551, LABEL_MASKS("%T","", "%T","")); // Title, empty | Title, empty
SetSortMethod(SortByLabel);
const CViewState *viewState = CViewStateSettings::GetInstance().Get("videonavgenres");
SetViewAsControl(viewState->m_viewMode);
SetSortOrder(viewState->m_sortDescription.sortOrder);
}
break;
case NODE_TYPE_EPISODES:
{
if (params.GetSeason() > -1)
{
AddSortMethod(SortByEpisodeNumber, 20359, LABEL_MASKS("%E. %T","%R")); // Episode. Title, Rating | empty, empty
AddSortMethod(SortByRating, 563, LABEL_MASKS("%E. %T", "%R")); // Episode. Title, Rating | empty, empty
AddSortMethod(SortByUserRating, 38018, LABEL_MASKS("%E. %T", "%r")); // Episode. Title, Userrating | empty, empty
AddSortMethod(SortByMPAA, 20074, LABEL_MASKS("%E. %T", "%O")); // Episode. Title, MPAA | empty, empty
AddSortMethod(SortByProductionCode, 20368, LABEL_MASKS("%E. %T","%P", "%E. %T","%P")); // Episode. Title, ProductionCode | Episode. Title, ProductionCode
AddSortMethod(SortByDate, 552, LABEL_MASKS("%E. %T","%J","%E. %T","%J")); // Episode. Title, Date | Episode. Title, Date
if (CMediaSettings::GetInstance().GetWatchedMode(items.GetContent()) == WatchedModeAll)
AddSortMethod(SortByPlaycount, 567, LABEL_MASKS("%E. %T", "%V")); // Episode. Title, Playcount | empty, empty
示例12: if
CGUIViewStateMusicSmartPlaylist::CGUIViewStateMusicSmartPlaylist(const CFileItemList& items) : CGUIViewStateWindowMusic(items)
{
SortAttribute sortAttribute = SortAttributeNone;
if (CSettings::GetInstance().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
sortAttribute = SortAttributeIgnoreArticle;
const CViewState *viewState = CViewStateSettings::GetInstance().Get("musicnavsongs");
if (items.GetContent() == "songs" || items.GetContent() == "mixed")
{
std::string strTrack=CSettings::GetInstance().GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
AddSortMethod(SortByTrackNumber, 554, LABEL_MASKS(strTrack, "%N")); // Userdefined, Track Number| empty, empty
AddSortMethod(SortByTitle, sortAttribute, 556, LABEL_MASKS("%T - %A", "%D")); // Title, Artist, Duration| empty, empty
AddSortMethod(SortByAlbum, sortAttribute, 558, LABEL_MASKS("%B - %T - %A", "%D")); // Album, Titel, Artist, Duration| empty, empty
AddSortMethod(SortByArtist, sortAttribute, 557, LABEL_MASKS("%A - %T", "%D")); // Artist, Titel, Duration| empty, empty
AddSortMethod(SortByArtistThenYear, sortAttribute, 578, LABEL_MASKS("%A - %T", "%D")); // Artist, Titel, Duration| empty, empty
AddSortMethod(SortByLabel, sortAttribute, 551, LABEL_MASKS(strTrack, "%D"));
AddSortMethod(SortByTime, 180, LABEL_MASKS("%T - %A", "%D")); // Titel, Artist, Duration| empty, empty
AddSortMethod(SortByRating, 563, LABEL_MASKS("%T - %A", "%R")); // Titel, Artist, Rating| empty, empty
if (items.IsSmartPlayList() || items.IsLibraryFolder())
AddPlaylistOrder(items, LABEL_MASKS(strTrack, "%D"));
else
{
SetSortMethod(viewState->m_sortDescription);
SetSortOrder(viewState->m_sortDescription.sortOrder);
}
SetViewAsControl(CViewStateSettings::GetInstance().Get("musicnavsongs")->m_viewMode);
}
else if (items.GetContent() == "albums")
{
std::string strAlbum = g_advancedSettings.m_strMusicLibraryAlbumFormat;
if (strAlbum.empty())
strAlbum = "%B"; // album
// album
AddSortMethod(SortByAlbum, sortAttribute, 558, LABEL_MASKS("%F", "", strAlbum, "")); // Filename, empty | Userdefined, empty
// artist
AddSortMethod(SortByArtist, sortAttribute, 557, LABEL_MASKS("%F", "", strAlbum, "%A")); // Filename, empty | Userdefined, Artist
// artist / year
AddSortMethod(SortByArtistThenYear, sortAttribute, 578, LABEL_MASKS("%F", "", strAlbum, "%A / %Y")); // Filename, empty | Userdefined, Artist / Year
// year
AddSortMethod(SortByYear, 562, LABEL_MASKS("%F", "", strAlbum, "%Y"));
if (items.IsSmartPlayList() || items.IsLibraryFolder())
AddPlaylistOrder(items, LABEL_MASKS("%F", "", strAlbum, "%D"));
else
{
SetSortMethod(viewState->m_sortDescription);
SetSortOrder(viewState->m_sortDescription.sortOrder);
}
SetViewAsControl(CViewStateSettings::GetInstance().Get("musicnavalbums")->m_viewMode);
}
else
{
CLog::Log(LOGERROR,"Music Smart Playlist must be one of songs, mixed or albums");
}
LoadViewState(items.GetPath(), WINDOW_MUSIC_NAV);
}
示例13: if
CGUIViewStateMusicSmartPlaylist::CGUIViewStateMusicSmartPlaylist(const CFileItemList& items) : CGUIViewStateWindowMusic(items)
{
if (items.GetContent() == "songs" || items.GetContent() == "mixed")
{
CStdString strTrackLeft=g_guiSettings.GetString("musicfiles.trackformat");
CStdString strTrackRight=g_guiSettings.GetString("musicfiles.trackformatright");
AddSortMethod(SORT_METHOD_PLAYLIST_ORDER, 559, LABEL_MASKS(strTrackLeft, strTrackRight));
AddSortMethod(SORT_METHOD_TRACKNUM, 554, LABEL_MASKS(strTrackLeft, strTrackRight)); // Userdefined, Userdefined| empty, empty
if (g_guiSettings.GetBool("filelists.ignorethewhensorting"))
{
AddSortMethod(SORT_METHOD_TITLE_IGNORE_THE, 556, LABEL_MASKS("%T - %A", "%D")); // Title, Artist, Duration| empty, empty
AddSortMethod(SORT_METHOD_ALBUM_IGNORE_THE, 558, LABEL_MASKS("%B - %T - %A", "%D")); // Album, Titel, Artist, Duration| empty, empty
AddSortMethod(SORT_METHOD_ARTIST_IGNORE_THE, 557, LABEL_MASKS("%A - %T", "%D")); // Artist, Titel, Duration| empty, empty
AddSortMethod(SORT_METHOD_LABEL_IGNORE_THE, 551, LABEL_MASKS(strTrackLeft, strTrackRight));
}
else
{
AddSortMethod(SORT_METHOD_TITLE, 556, LABEL_MASKS("%T - %A", "%D")); // Title, Artist, Duration| empty, empty
AddSortMethod(SORT_METHOD_ALBUM, 558, LABEL_MASKS("%B - %T - %A", "%D")); // Album, Titel, Artist, Duration| empty, empty
AddSortMethod(SORT_METHOD_ARTIST, 557, LABEL_MASKS("%A - %T", "%D")); // Artist, Titel, Duration| empty, empty
AddSortMethod(SORT_METHOD_LABEL, 551, LABEL_MASKS(strTrackLeft, strTrackRight));
}
AddSortMethod(SORT_METHOD_DURATION, 555, LABEL_MASKS("%T - %A", "%D")); // Titel, Artist, Duration| empty, empty
AddSortMethod(SORT_METHOD_SONG_RATING, 563, LABEL_MASKS("%T - %A", "%R")); // Titel, Artist, Rating| empty, empty
SetSortMethod(SORT_METHOD_PLAYLIST_ORDER);
SetViewAsControl(g_settings.m_viewStateMusicNavSongs.m_viewMode);
SetSortOrder(g_settings.m_viewStateMusicNavSongs.m_sortOrder);
}
else if (items.GetContent() == "albums")
{
CStdString strAlbumLeft = g_advancedSettings.m_strMusicLibraryAlbumFormat;
if (strAlbumLeft.IsEmpty())
strAlbumLeft = "%B"; // album
CStdString strAlbumRight = g_advancedSettings.m_strMusicLibraryAlbumFormatRight;
if (strAlbumRight.IsEmpty())
strAlbumRight = "%A"; // artist
AddSortMethod(SORT_METHOD_PLAYLIST_ORDER, 559, LABEL_MASKS("%F", "", strAlbumLeft, strAlbumRight));
// album
if (g_guiSettings.GetBool("filelists.ignorethewhensorting"))
AddSortMethod(SORT_METHOD_ALBUM_IGNORE_THE, 558, LABEL_MASKS("%F", "", strAlbumLeft, strAlbumRight)); // Filename, empty | Userdefined, Userdefined
else
AddSortMethod(SORT_METHOD_ALBUM, 558, LABEL_MASKS("%F", "", strAlbumLeft, strAlbumRight)); // Filename, empty | Userdefined, Userdefined
// artist
if (g_guiSettings.GetBool("filelists.ignorethewhensorting"))
AddSortMethod(SORT_METHOD_ARTIST_IGNORE_THE, 557, LABEL_MASKS("%F", "", strAlbumLeft, strAlbumRight)); // Filename, empty | Userdefined, Userdefined
else
AddSortMethod(SORT_METHOD_ARTIST, 557, LABEL_MASKS("%F", "", strAlbumLeft, strAlbumRight)); // Filename, empty | Userdefined, Userdefined
// year
AddSortMethod(SORT_METHOD_YEAR, 562, LABEL_MASKS("%F", "", strAlbumLeft, strAlbumRight));
SetSortMethod(SORT_METHOD_PLAYLIST_ORDER);
SetViewAsControl(g_settings.m_viewStateMusicNavAlbums.m_viewMode);
SetSortOrder(g_settings.m_viewStateMusicNavAlbums.m_sortOrder);
}
else
{
CLog::Log(LOGERROR,"Music Smart Playlist must be one of songs, mixed or albums");
}
LoadViewState(items.GetPath(), WINDOW_MUSIC_NAV);
}
示例14: if
//.........这里部分代码省略.........
case NODE_TYPE_COUNTRY:
case NODE_TYPE_STUDIO:
{
AddSortMethod(SORT_METHOD_LABEL, 551, LABEL_MASKS("%T", "%R", "%L", "")); // Filename, Duration | Foldername, empty
SetSortMethod(SORT_METHOD_LABEL);
SetViewAsControl(g_settings.m_viewStateVideoNavGenres.m_viewMode);
SetSortOrder(g_settings.m_viewStateVideoNavGenres.m_sortOrder);
}
break;
case NODE_TYPE_SETS:
{
if (g_guiSettings.GetBool("filelists.ignorethewhensorting"))
AddSortMethod(SORT_METHOD_LABEL_IGNORE_THE, 551, LABEL_MASKS("%T","%R")); // Filename, Duration | Foldername, empty
else
AddSortMethod(SORT_METHOD_LABEL, 551, LABEL_MASKS("%T", "%R")); // Filename, Duration | Foldername, empty
SetSortMethod(SORT_METHOD_LABEL_IGNORE_THE);
SetViewAsControl(g_settings.m_viewStateVideoNavGenres.m_viewMode);
SetSortOrder(g_settings.m_viewStateVideoNavGenres.m_sortOrder);
}
break;
case NODE_TYPE_EPISODES:
{
if (params.GetSeason() > -1)
{
AddSortMethod(SORT_METHOD_EPISODE,20359,LABEL_MASKS("%E. %T","%R"));
AddSortMethod(SORT_METHOD_VIDEO_RATING, 563, LABEL_MASKS("%E. %T", "%R")); // Filename, Duration | Foldername, empty
AddSortMethod(SORT_METHOD_PRODUCTIONCODE,20368,LABEL_MASKS("%E. %T","%P", "%E. %T","%P"));
AddSortMethod(SORT_METHOD_DATE,552,LABEL_MASKS("%E. %T","%J","%E. %T","%J"));
if (g_settings.GetWatchMode(items.GetContent()) == VIDEO_SHOW_ALL)
AddSortMethod(SORT_METHOD_PLAYCOUNT, 576, LABEL_MASKS("%E. %T", "%V"));
}
else
{
AddSortMethod(SORT_METHOD_EPISODE,20359,LABEL_MASKS("%H. %T","%R"));
AddSortMethod(SORT_METHOD_VIDEO_RATING, 563, LABEL_MASKS("%H. %T", "%R")); // Filename, Duration | Foldername, empty
AddSortMethod(SORT_METHOD_PRODUCTIONCODE,20368,LABEL_MASKS("%H. %T","%P", "%H. %T","%P"));
AddSortMethod(SORT_METHOD_DATE,552,LABEL_MASKS("%H. %T","%J","%H. %T","%J"));
if (g_settings.GetWatchMode(items.GetContent()) == VIDEO_SHOW_ALL)
AddSortMethod(SORT_METHOD_PLAYCOUNT, 576, LABEL_MASKS("%H. %T", "%V"));
}
if (g_guiSettings.GetBool("filelists.ignorethewhensorting"))
AddSortMethod(SORT_METHOD_LABEL_IGNORE_THE, 551, LABEL_MASKS("%T","%R")); // Filename, Duration | Foldername, empty
else
AddSortMethod(SORT_METHOD_LABEL, 551, LABEL_MASKS("%T", "%R")); // Filename, Duration | Foldername, empty
SetSortMethod(g_settings.m_viewStateVideoNavEpisodes.m_sortMethod);
SetViewAsControl(g_settings.m_viewStateVideoNavEpisodes.m_viewMode);
SetSortOrder(g_settings.m_viewStateVideoNavEpisodes.m_sortOrder);
break;
}
case NODE_TYPE_RECENTLY_ADDED_EPISODES:
{
AddSortMethod(SORT_METHOD_NONE, 552, LABEL_MASKS("%Z - %H. %T", "%R")); // Filename, Duration | Foldername, empty
SetSortMethod(SORT_METHOD_NONE);
SetViewAsControl(g_settings.m_viewStateVideoNavEpisodes.m_viewMode);
SetSortOrder(SORT_ORDER_NONE);
示例15: if
CGUIViewStateWindowMusicNav::CGUIViewStateWindowMusicNav(const CFileItemList& items) : CGUIViewStateWindowMusic(items)
{
SortAttribute sortAttribute = SortAttributeNone;
if (CSettings::GetInstance().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
sortAttribute = SortAttributeIgnoreArticle;
if (items.IsVirtualDirectoryRoot())
{
AddSortMethod(SortByNone, 551, LABEL_MASKS("%F", "%I", "%L", "")); // Filename, Size | Foldername, empty
SetSortMethod(SortByNone);
SetViewAsControl(DEFAULT_VIEW_LIST);
SetSortOrder(SortOrderNone);
}
else
{
if (items.IsVideoDb() && items.Size() > (CSettings::GetInstance().GetBool(CSettings::SETTING_FILELISTS_SHOWPARENTDIRITEMS)?1:0))
{
XFILE::VIDEODATABASEDIRECTORY::CQueryParams params;
XFILE::CVideoDatabaseDirectory::GetQueryParams(items[CSettings::GetInstance().GetBool(CSettings::SETTING_FILELISTS_SHOWPARENTDIRITEMS)?1:0]->GetPath(),params);
if (params.GetMVideoId() != -1)
{
AddSortMethod(SortByLabel, sortAttribute, 551, LABEL_MASKS("%T", "%Y")); // Filename, Duration | Foldername, empty
AddSortMethod(SortByYear, 562, LABEL_MASKS("%T", "%Y"));
AddSortMethod(SortByArtist, sortAttribute, 557, LABEL_MASKS("%A - %T", "%Y"));
AddSortMethod(SortByArtistThenYear, sortAttribute, 578, LABEL_MASKS("%A - %T", "%Y"));
AddSortMethod(SortByAlbum, sortAttribute, 558, LABEL_MASKS("%B - %T", "%Y"));
std::string strTrack=CSettings::GetInstance().GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
AddSortMethod(SortByTrackNumber, 554, LABEL_MASKS(strTrack, "%D")); // Userdefined, Duration| empty, empty
}
else
{
AddSortMethod(SortByLabel, 551, LABEL_MASKS("%F", "%D", "%L", "")); // Filename, Duration | Foldername, empty
SetSortMethod(SortByLabel);
}
}
else if (items.GetContent() == "chapters") // audiobooks in library
{
std::string strTrackLeft=CSettings::GetInstance().GetString("musicfiles.trackformat");
std::string strTrackRight=CSettings::GetInstance().GetString("musicfiles.trackformatright");
AddSortMethod(SortByTrackNumber, 554, LABEL_MASKS(strTrackLeft, strTrackRight)); // Userdefined, Userdefined| empty, empty
AddSortMethod(SortByTime, 180, LABEL_MASKS("%T - %A", "%D")); // Titel, Artist, Duration| empty, empty
const CViewState *viewState = CViewStateSettings::GetInstance().Get("musicnavsongs");
SetSortMethod(viewState->m_sortDescription);
AddSortMethod(SortByPlaycount, 567, LABEL_MASKS("%T - %A", "%V")); // Titel - Artist, PlayCount
SetViewAsControl(viewState->m_viewMode);
SetSortOrder(viewState->m_sortDescription.sortOrder);
}
else
{
//In navigation of music files tag data is scanned whenever present and can be used as sort criteria
//hence sort methods available are similar to song node (not the same as only tag data)
//Unfortunately anything here appears at all levels of file navigation even if no song files there.
std::string strTrack = CSettings::GetInstance().GetString(CSettings::SETTING_MUSICFILES_LIBRARYTRACKFORMAT);
if (strTrack.empty())
strTrack = CSettings::GetInstance().GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
AddSortMethod(SortByLabel, 551, LABEL_MASKS(strTrack, "%D", "%L", ""), // Userdefined, Duration | FolderName, empty
CSettings::GetInstance().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
AddSortMethod(SortBySize, 553, LABEL_MASKS("%F", "%I", "%L", "%I")); // Filename, Size | Foldername, Size
AddSortMethod(SortByDate, 552, LABEL_MASKS("%F", "%J", "%L", "%J")); // Filename, Date | Foldername, Date
AddSortMethod(SortByFile, 561, LABEL_MASKS("%F", "%I", "%L", "")); // Filename, Size | Label, empty
AddSortMethod(SortByTrackNumber, 554, LABEL_MASKS(strTrack, "%D")); // Userdefined, Duration| empty, empty
AddSortMethod(SortByTitle, sortAttribute, 556, LABEL_MASKS("%T - %A", "%D")); // Title, Artist, Duration| empty, empty
AddSortMethod(SortByAlbum, sortAttribute, 558, LABEL_MASKS("%B - %T - %A", "%D")); // Album, Title, Artist, Duration| empty, empty
AddSortMethod(SortByArtist, sortAttribute, 557, LABEL_MASKS("%A - %T", "%D")); // Artist, Title, Duration| empty, empty
AddSortMethod(SortByArtistThenYear, sortAttribute, 578, LABEL_MASKS("%A - %T", "%Y")); // Artist(year), Title, Year| empty, empty
AddSortMethod(SortByTime, 180, LABEL_MASKS("%T - %A", "%D")); // Titel, Artist, Duration| empty, empty
AddSortMethod(SortByYear, 562, LABEL_MASKS("%T - %A", "%Y")); // Title, Artist, Year
SetSortMethod(SortByLabel);
}
const CViewState *viewState = CViewStateSettings::GetInstance().Get("musicnavsongs");
SetViewAsControl(viewState->m_viewMode);
SetSortOrder(viewState->m_sortDescription.sortOrder);
SetSortOrder(SortOrderAscending);
}
LoadViewState(items.GetPath(), WINDOW_MUSIC_NAV);
}