本文整理汇总了C++中CSmartPlaylist::GetOrderClause方法的典型用法代码示例。如果您正苦于以下问题:C++ CSmartPlaylist::GetOrderClause方法的具体用法?C++ CSmartPlaylist::GetOrderClause怎么用?C++ CSmartPlaylist::GetOrderClause使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSmartPlaylist
的用法示例。
在下文中一共展示了CSmartPlaylist::GetOrderClause方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDirectory
bool CSmartPlaylistDirectory::GetDirectory(const CStdString& strPath, CFileItemList& items)
{
// Load in the SmartPlaylist and get the WHERE query
CSmartPlaylist playlist;
if (!playlist.Load(strPath))
return false;
bool success = false, success2 = false;
if (playlist.GetType().Equals("music") || playlist.GetType().Equals("mixed") || playlist.GetType().IsEmpty())
{
CMusicDatabase db;
db.Open();
CStdString type=playlist.GetType();
if (type.IsEmpty())
type = "music";
if (playlist.GetType().Equals("mixed"))
playlist.SetType("music");
CStdString whereOrder = playlist.GetWhereClause() + " " + playlist.GetOrderClause();
success = db.GetSongsByWhere("", whereOrder, items);
db.Close();
playlist.SetType(type);
}
if (playlist.GetType().Equals("video") || playlist.GetType().Equals("mixed"))
{
CVideoDatabase db;
db.Open();
CStdString type=playlist.GetType();
if (playlist.GetType().Equals("mixed"))
playlist.SetType("video");
CStdString whereOrder = playlist.GetWhereClause() + " " + playlist.GetOrderClause();
CFileItemList items2;
success2 = db.GetMusicVideosByWhere("videodb://3/2/", whereOrder, items2);
db.Close();
items.Append(items2);
playlist.SetType(type);
}
if (playlist.GetType().Equals("mixed"))
return success || success2;
else if (playlist.GetType().Equals("video"))
return success2;
else
return success;
}
示例2: GetDirectory
bool CSmartPlaylistDirectory::GetDirectory(const CStdString& strPath, CFileItemList& items)
{
// Load in the SmartPlaylist and get the WHERE query
CSmartPlaylist playlist;
if (!playlist.Load(strPath))
return false;
bool success = false, success2 = false;
if (playlist.GetType().Equals("tvshows"))
{
CVideoDatabase db;
db.Open();
CStdString whereOrder = playlist.GetWhereClause(db) + " " + playlist.GetOrderClause(db);
success = db.GetTvShowsByWhere("videodb://2/2/", whereOrder, items);
items.SetContent("tvshows");
db.Close();
}
else if (playlist.GetType().Equals("episodes"))
{
CVideoDatabase db;
db.Open();
CStdString whereOrder = playlist.GetWhereClause(db) + " " + playlist.GetOrderClause(db);
success = db.GetEpisodesByWhere("videodb://2/2/", whereOrder, items);
items.SetContent("episodes");
db.Close();
}
else if (playlist.GetType().Equals("movies"))
{
CVideoDatabase db;
db.Open();
success = db.GetMoviesByWhere("videodb://1/2/", playlist.GetWhereClause(db), playlist.GetOrderClause(db), items, true);
items.SetContent("movies");
db.Close();
}
else if (playlist.GetType().Equals("albums"))
{
CMusicDatabase db;
db.Open();
success = db.GetAlbumsByWhere("musicdb://3/", playlist.GetWhereClause(db), playlist.GetOrderClause(db), items);
items.SetContent("albums");
db.Close();
}
if (playlist.GetType().Equals("songs") || playlist.GetType().Equals("mixed") || playlist.GetType().IsEmpty())
{
CMusicDatabase db;
db.Open();
CStdString type=playlist.GetType();
if (type.IsEmpty())
type = "songs";
if (playlist.GetType().Equals("mixed"))
playlist.SetType("songs");
CStdString whereOrder = playlist.GetWhereClause(db) + " " + playlist.GetOrderClause(db);
success = db.GetSongsByWhere("", whereOrder, items);
items.SetContent("songs");
db.Close();
playlist.SetType(type);
}
if (playlist.GetType().Equals("musicvideos") || playlist.GetType().Equals("mixed"))
{
CVideoDatabase db;
db.Open();
CStdString type=playlist.GetType();
if (playlist.GetType().Equals("mixed"))
playlist.SetType("musicvideos");
CStdString whereOrder = playlist.GetWhereClause(db) + " " + playlist.GetOrderClause(db);
CFileItemList items2;
success2 = db.GetMusicVideosByWhere("videodb://3/2/", whereOrder, items2, false); // TODO: SMARTPLAYLISTS Don't check locks???
db.Close();
items.Append(items2);
if (items2.Size())
items.SetContent("musicvideos");
playlist.SetType(type);
}
// go through and set the playlist order
for (int i = 0; i < items.Size(); i++)
{
CFileItemPtr item = items[i];
item->m_iprogramCount = i; // hack for playlist order
}
if (playlist.GetType().Equals("mixed"))
return success || success2;
else if (playlist.GetType().Equals("musicvideos"))
return success2;
else
return success;
}
示例3: GetDirectory
bool CSmartPlaylistDirectory::GetDirectory(const CSmartPlaylist &playlist, CFileItemList& items)
{
bool success = false, success2 = false;
std::set<CStdString> playlists;
if (playlist.GetType().Equals("tvshows"))
{
CVideoDatabase db;
db.Open();
CStdString whereOrder = playlist.GetWhereClause(db, playlists) + " " + playlist.GetOrderClause(db);
success = db.GetTvShowsByWhere("videodb://2/2/", whereOrder, items);
items.SetContent("tvshows");
db.Close();
}
else if (playlist.GetType().Equals("episodes"))
{
CVideoDatabase db;
db.Open();
CStdString whereOrder = playlist.GetWhereClause(db, playlists) + " " + playlist.GetOrderClause(db);
success = db.GetEpisodesByWhere("videodb://2/2/", whereOrder, items);
items.SetContent("episodes");
db.Close();
}
else if (playlist.GetType().Equals("movies"))
{
CVideoDatabase db;
db.Open();
success = db.GetMoviesByWhere("videodb://1/2/", playlist.GetWhereClause(db, playlists), playlist.GetOrderClause(db), items, true);
items.SetContent("movies");
db.Close();
}
else if (playlist.GetType().Equals("albums"))
{
CMusicDatabase db;
db.Open();
success = db.GetAlbumsByWhere("musicdb://3/", playlist.GetWhereClause(db, playlists), playlist.GetOrderClause(db), items);
items.SetContent("albums");
db.Close();
}
if (playlist.GetType().Equals("songs") || playlist.GetType().Equals("mixed") || playlist.GetType().IsEmpty())
{
CMusicDatabase db;
db.Open();
CStdString whereOrder;
if (playlist.GetType().IsEmpty() || playlist.GetType().Equals("mixed"))
{
CSmartPlaylist songPlaylist(playlist);
songPlaylist.SetType("songs");
whereOrder = songPlaylist.GetWhereClause(db, playlists) + " " + songPlaylist.GetOrderClause(db);
}
else
whereOrder = playlist.GetWhereClause(db, playlists) + " " + playlist.GetOrderClause(db);
success = db.GetSongsByWhere("", whereOrder, items);
items.SetContent("songs");
db.Close();
}
if (playlist.GetType().Equals("musicvideos") || playlist.GetType().Equals("mixed"))
{
CVideoDatabase db;
db.Open();
CStdString whereOrder;
if (playlist.GetType().Equals("mixed"))
{
CSmartPlaylist mvidPlaylist(playlist);
mvidPlaylist.SetType("musicvideos");
whereOrder = mvidPlaylist.GetWhereClause(db, playlists) + " " + mvidPlaylist.GetOrderClause(db);
}
else
whereOrder = playlist.GetWhereClause(db, playlists) + " " + playlist.GetOrderClause(db);
CFileItemList items2;
success2 = db.GetMusicVideosByWhere("videodb://3/2/", whereOrder, items2, false); // TODO: SMARTPLAYLISTS Don't check locks???
db.Close();
items.Append(items2);
if (items2.Size())
items.SetContent("musicvideos");
}
items.SetLabel(playlist.GetName());
// go through and set the playlist order
for (int i = 0; i < items.Size(); i++)
{
CFileItemPtr item = items[i];
item->m_iprogramCount = i; // hack for playlist order
}
if (playlist.GetType().Equals("mixed"))
return success || success2;
else if (playlist.GetType().Equals("musicvideos"))
return success2;
else
return success;
}