本文整理汇总了C++中CFileItemList::HasProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItemList::HasProperty方法的具体用法?C++ CFileItemList::HasProperty怎么用?C++ CFileItemList::HasProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItemList
的用法示例。
在下文中一共展示了CFileItemList::HasProperty方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSongs
JSONRPC_STATUS CAudioLibrary::GetSongs(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CMusicDatabase musicdatabase;
if (!musicdatabase.Open())
return InternalError;
CMusicDbUrl musicUrl;
musicUrl.FromString("musicdb://songs/");
int genreID = -1, albumID = -1, artistID = -1;
const CVariant &filter = parameterObject["filter"];
if (filter.isMember("artistid"))
artistID = (int)filter["artistid"].asInteger();
else if (filter.isMember("artist"))
musicUrl.AddOption("artist", filter["artist"].asString());
else if (filter.isMember("genreid"))
genreID = (int)filter["genreid"].asInteger();
else if (filter.isMember("genre"))
musicUrl.AddOption("genre", filter["genre"].asString());
else if (filter.isMember("albumid"))
albumID = (int)filter["albumid"].asInteger();
else if (filter.isMember("album"))
musicUrl.AddOption("album", filter["album"].asString());
else if (filter.isObject())
{
CStdString xsp;
if (!GetXspFiltering("songs", filter, xsp))
return InvalidParams;
musicUrl.AddOption("xsp", xsp);
}
SortDescription sorting;
ParseLimits(parameterObject, sorting.limitStart, sorting.limitEnd);
if (!ParseSorting(parameterObject, sorting.sortBy, sorting.sortOrder, sorting.sortAttributes))
return InvalidParams;
CFileItemList items;
if (!musicdatabase.GetSongsNav(musicUrl.ToString(), items, genreID, artistID, albumID, sorting))
return InternalError;
JSONRPC_STATUS ret = GetAdditionalSongDetails(parameterObject, items, musicdatabase);
if (ret != OK)
return ret;
int size = items.Size();
if (items.HasProperty("total") && items.GetProperty("total").asInteger() > size)
size = (int)items.GetProperty("total").asInteger();
HandleFileItemList("songid", true, "songs", items, parameterObject, result, size, false);
return OK;
}
示例2: AddPlaylistOrder
void CGUIViewState::AddPlaylistOrder(const CFileItemList &items, LABEL_MASKS label_masks)
{
SortBy sortBy = SortByPlaylistOrder;
int sortLabel = 559;
SortOrder sortOrder = SortOrderAscending;
if (items.HasProperty(PROPERTY_SORT_ORDER))
{
sortBy = (SortBy)items.GetProperty(PROPERTY_SORT_ORDER).asInteger();
if (sortBy != SortByNone)
{
sortLabel = SortUtils::GetSortLabel(sortBy);
sortOrder = items.GetProperty(PROPERTY_SORT_ASCENDING).asBoolean() ? SortOrderAscending : SortOrderDescending;
}
}
AddSortMethod(sortBy, sortLabel, label_masks, SortAttributeNone, sortOrder);
SetSortMethod(sortBy, sortOrder);
}
示例3: Modify
bool CSmartPlaylistFileItemListModifier::Modify(CFileItemList &items) const
{
if (items.HasProperty(PROPERTY_SORT_ORDER))
return false;
std::string xspOption = GetUrlOption(items.GetPath(), URL_OPTION_XSP);
if (xspOption.empty())
return false;
// check for smartplaylist-specific sorting information
CSmartPlaylist xsp;
if (!xsp.LoadFromJson(xspOption))
return false;
items.SetProperty(PROPERTY_SORT_ORDER, (int)xsp.GetOrder());
items.SetProperty(PROPERTY_SORT_ASCENDING, xsp.GetOrderDirection() == SortOrderAscending);
return true;
}
示例4: AddPlaylistOrder
void CGUIViewState::AddPlaylistOrder(const CFileItemList &items, LABEL_MASKS label_masks)
{
SORT_METHOD sortMethod = SORT_METHOD_PLAYLIST_ORDER;
int sortLabel = 559;
SortOrder sortOrder = SortOrderAscending;
if (items.HasProperty(PROPERTY_SORT_ORDER))
{
SortBy sortBy = (SortBy)items.GetProperty(PROPERTY_SORT_ORDER).asInteger();
if (sortBy != SortByNone)
{
sortMethod = SortUtils::TranslateOldSortMethod(sortBy, g_guiSettings.GetBool("filelists.ignorethewhensorting"));
if (sortMethod == SORT_METHOD_NONE)
sortMethod = SORT_METHOD_PLAYLIST_ORDER;
else
{
sortLabel = SortUtils::GetSortLabel(sortBy);
sortOrder = items.GetProperty(PROPERTY_SORT_ASCENDING).asBoolean() ? SortOrderAscending : SortOrderDescending;
}
}
}
AddSortMethod(sortMethod, sortLabel, label_masks);
SetSortMethod(sortMethod);
SetSortOrder(sortOrder);
}
示例5: ProcessMessage
//.........这里部分代码省略.........
g_windowManager.GetActiveWindow() == WINDOW_VISUALISATION)
g_windowManager.PreviousWindow();
g_application.ResetScreenSaver();
g_application.WakeUpScreenSaverAndDPMS();
//g_application.StopPlaying();
// play file
if(pMsg->lpVoid)
{
CFileItemList *list = (CFileItemList *)pMsg->lpVoid;
if (list->Size() > 0)
{
int playlist = PLAYLIST_MUSIC;
for (int i = 0; i < list->Size(); i++)
{
if ((*list)[i]->IsVideo())
{
playlist = PLAYLIST_VIDEO;
break;
}
}
g_playlistPlayer.ClearPlaylist(playlist);
g_playlistPlayer.SetCurrentPlaylist(playlist);
//For single item lists try PlayMedia. This covers some more cases where a playlist is not appropriate
//It will fall through to PlayFile
if (list->Size() == 1 && !(*list)[0]->IsPlayList())
g_application.PlayMedia(*((*list)[0]), playlist);
else
{
// Handle "shuffled" option if present
if (list->HasProperty("shuffled") && list->GetProperty("shuffled").isBoolean())
g_playlistPlayer.SetShuffle(playlist, list->GetProperty("shuffled").asBoolean(), false);
// Handle "repeat" option if present
if (list->HasProperty("repeat") && list->GetProperty("repeat").isInteger())
g_playlistPlayer.SetRepeat(playlist, (PLAYLIST::REPEAT_STATE)list->GetProperty("repeat").asInteger(), false);
g_playlistPlayer.Add(playlist, (*list));
g_playlistPlayer.Play(pMsg->param1);
}
}
delete list;
}
else if (pMsg->param1 == PLAYLIST_MUSIC || pMsg->param1 == PLAYLIST_VIDEO)
{
if (g_playlistPlayer.GetCurrentPlaylist() != pMsg->param1)
g_playlistPlayer.SetCurrentPlaylist(pMsg->param1);
PlayListPlayerPlay(pMsg->param2);
}
}
break;
case TMSG_MEDIA_RESTART:
g_application.Restart(true);
break;
case TMSG_PICTURE_SHOW:
{
CGUIWindowSlideShow *pSlideShow = (CGUIWindowSlideShow *)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (!pSlideShow) return ;
// stop playing file
示例6: GetTVShows
JSONRPC_STATUS CVideoLibrary::GetTVShows(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
return InternalError;
SortDescription sorting;
ParseLimits(parameterObject, sorting.limitStart, sorting.limitEnd);
if (!ParseSorting(parameterObject, sorting.sortBy, sorting.sortOrder, sorting.sortAttributes))
return InvalidParams;
CVideoDbUrl videoUrl;
videoUrl.FromString("videodb://tvshows/titles/");
int genreID = -1, year = -1;
const CVariant &filter = parameterObject["filter"];
if (filter.isMember("genreid"))
genreID = (int)filter["genreid"].asInteger();
else if (filter.isMember("genre"))
videoUrl.AddOption("genre", filter["genre"].asString());
else if (filter.isMember("year"))
year = (int)filter["year"].asInteger();
else if (filter.isMember("actor"))
videoUrl.AddOption("actor", filter["actor"].asString());
else if (filter.isMember("studio"))
videoUrl.AddOption("studio", filter["studio"].asString());
else if (filter.isMember("tag"))
videoUrl.AddOption("tag", filter["tag"].asString());
else if (filter.isObject())
{
std::string xsp;
if (!GetXspFiltering("tvshows", filter, xsp))
return InvalidParams;
videoUrl.AddOption("xsp", xsp);
}
CFileItemList items;
if (!videodatabase.GetTvShowsNav(videoUrl.ToString(), items, genreID, year, -1, -1, -1, -1, sorting))
return InvalidParams;
bool additionalInfo = false;
for (CVariant::const_iterator_array itr = parameterObject["properties"].begin_array(); itr != parameterObject["properties"].end_array(); itr++)
{
std::string fieldValue = itr->asString();
if (fieldValue == "cast" || fieldValue == "tag")
additionalInfo = true;
}
if (additionalInfo)
{
for (int index = 0; index < items.Size(); index++)
videodatabase.GetTvShowInfo("", *(items[index]->GetVideoInfoTag()), items[index]->GetVideoInfoTag()->m_iDbId);
}
int size = items.Size();
if (items.HasProperty("total") && items.GetProperty("total").asInteger() > size)
size = (int)items.GetProperty("total").asInteger();
HandleFileItemList("tvshowid", true, "tvshows", items, parameterObject, result, size, false);
return OK;
}
示例7: if
//.........这里部分代码省略.........
g_application.WakeUpScreenSaverAndDPMS();
//g_application.StopPlaying();
// play file
if (pMsg->lpVoid)
{
CFileItemList *list = (CFileItemList *)pMsg->lpVoid;
if (list->Size() > 0)
{
int playlist = PLAYLIST_MUSIC;
for (int i = 0; i < list->Size(); i++)
{
if ((*list)[i]->IsVideo())
{
playlist = PLAYLIST_VIDEO;
break;
}
}
ClearPlaylist(playlist);
SetCurrentPlaylist(playlist);
if (list->Size() == 1 && !(*list)[0]->IsPlayList())
{
CFileItemPtr item = (*list)[0];
if (item->IsAudio() || item->IsVideo())
Play(item, pMsg->strParam);
else
g_application.PlayMedia(*item, pMsg->strParam, playlist);
}
else
{
// Handle "shuffled" option if present
if (list->HasProperty("shuffled") && list->GetProperty("shuffled").isBoolean())
SetShuffle(playlist, list->GetProperty("shuffled").asBoolean(), false);
// Handle "repeat" option if present
if (list->HasProperty("repeat") && list->GetProperty("repeat").isInteger())
SetRepeat(playlist, (PLAYLIST::REPEAT_STATE)list->GetProperty("repeat").asInteger(), false);
Add(playlist, (*list));
Play(pMsg->param1, pMsg->strParam);
}
}
delete list;
}
else if (pMsg->param1 == PLAYLIST_MUSIC || pMsg->param1 == PLAYLIST_VIDEO)
{
if (GetCurrentPlaylist() != pMsg->param1)
SetCurrentPlaylist(pMsg->param1);
CApplicationMessenger::GetInstance().SendMsg(TMSG_PLAYLISTPLAYER_PLAY, pMsg->param2);
}
}
break;
case TMSG_MEDIA_RESTART:
g_application.Restart(true);
break;
case TMSG_MEDIA_STOP:
{
// restore to previous window if needed
bool stopSlideshow = true;
bool stopVideo = true;
bool stopMusic = true;
示例8: ProcessMessage
//.........这里部分代码省略.........
g_windowManager.GetActiveWindow() == WINDOW_VISUALISATION)
g_windowManager.PreviousWindow();
g_application.ResetScreenSaver();
g_application.WakeUpScreenSaverAndDPMS();
//g_application.StopPlaying();
// play file
if(pMsg->lpVoid)
{
CFileItemList *list = (CFileItemList *)pMsg->lpVoid;
if (list->Size() > 0)
{
int playlist = PLAYLIST_MUSIC;
for (int i = 0; i < list->Size(); i++)
{
if ((*list)[i]->IsVideo())
{
playlist = PLAYLIST_VIDEO;
break;
}
}
g_playlistPlayer.ClearPlaylist(playlist);
g_playlistPlayer.SetCurrentPlaylist(playlist);
//For single item lists try PlayMedia. This covers some more cases where a playlist is not appropriate
//It will fall through to PlayFile
if (list->Size() == 1 && !(*list)[0]->IsPlayList())
g_application.PlayMedia(*((*list)[0]), playlist);
else
{
// Handle "shuffled" option if present
if (list->HasProperty("shuffled") && list->GetProperty("shuffled").isBoolean())
g_playlistPlayer.SetShuffle(playlist, list->GetProperty("shuffled").asBoolean(), false);
// Handle "repeat" option if present
if (list->HasProperty("repeat") && list->GetProperty("repeat").isInteger())
g_playlistPlayer.SetRepeat(playlist, (PLAYLIST::REPEAT_STATE)list->GetProperty("repeat").asInteger(), false);
g_playlistPlayer.Add(playlist, (*list));
g_playlistPlayer.Play(pMsg->dwParam1);
}
}
delete list;
}
else if (pMsg->dwParam1 == PLAYLIST_MUSIC || pMsg->dwParam1 == PLAYLIST_VIDEO)
{
if (g_playlistPlayer.GetCurrentPlaylist() != (int)pMsg->dwParam1)
g_playlistPlayer.SetCurrentPlaylist(pMsg->dwParam1);
PlayListPlayerPlay(pMsg->dwParam2);
}
}
break;
case TMSG_MEDIA_RESTART:
g_application.Restart(true);
break;
case TMSG_PICTURE_SHOW:
{
CGUIWindowSlideShow *pSlideShow = (CGUIWindowSlideShow *)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (!pSlideShow) return ;
// stop playing file