本文整理汇总了C++中CFileItem::IsSmartPlayList方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItem::IsSmartPlayList方法的具体用法?C++ CFileItem::IsSmartPlayList怎么用?C++ CFileItem::IsSmartPlayList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItem
的用法示例。
在下文中一共展示了CFileItem::IsSmartPlayList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetExecutePath
std::string CFavouritesDirectory::GetExecutePath(const CFileItem &item, const std::string &contextWindow)
{
std::string execute;
if (item.m_bIsFolder && (g_advancedSettings.m_playlistAsFolders ||
!(item.IsSmartPlayList() || item.IsPlayList())))
{
if (!contextWindow.empty())
execute = StringUtils::Format("ActivateWindow(%s,%s,return)", contextWindow.c_str(), StringUtils::Paramify(item.GetPath()).c_str());
}
/* TODO:STRING_CLEANUP */
else if (item.IsAndroidApp() && item.GetPath().size() > 26) // androidapp://sources/apps/<foo>
execute = StringUtils::Format("StartAndroidActivity(%s)", StringUtils::Paramify(item.GetPath().substr(26)).c_str());
else // assume a media file
{
if (item.IsVideoDb() && item.HasVideoInfoTag())
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetVideoInfoTag()->m_strFileNameAndPath).c_str());
else if (item.IsMusicDb() && item.HasMusicInfoTag())
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetMusicInfoTag()->GetURL()).c_str());
else if (item.IsPicture())
execute = StringUtils::Format("ShowPicture(%s)", StringUtils::Paramify(item.GetPath()).c_str());
else
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetPath()).c_str());
}
return execute;
}
示例2: GetContextButtons
void CGUIWindowMusicBase::GetContextButtons(int itemNumber, CContextButtons &buttons)
{
CFileItem *item = (itemNumber >= 0 && itemNumber < m_vecItems->Size()) ? m_vecItems->Get(itemNumber) : NULL;
if (item && !item->IsParentFolder())
{
if (item->GetExtraInfo().Equals("lastfmloved"))
{
buttons.Add(CONTEXT_BUTTON_LASTFM_UNLOVE_ITEM, 15295); //unlove
}
else if (item->GetExtraInfo().Equals("lastfmbanned"))
{
buttons.Add(CONTEXT_BUTTON_LASTFM_UNBAN_ITEM, 15296); //unban
}
else if (item->CanQueue())
{
buttons.Add(CONTEXT_BUTTON_QUEUE_ITEM, 13347); //queue
// allow a folder to be ad-hoc queued and played by the default player
if (item->m_bIsFolder || (item->IsPlayList() &&
!g_advancedSettings.m_playlistAsFolders))
{
buttons.Add(CONTEXT_BUTTON_PLAY_ITEM, 208); // Play
}
else
{ // check what players we have, if we have multiple display play with option
VECPLAYERCORES vecCores;
CPlayerCoreFactory::GetPlayers(*item, vecCores);
if (vecCores.size() >= 1)
buttons.Add(CONTEXT_BUTTON_PLAY_WITH, 15213); // Play With...
}
if (item->IsSmartPlayList())
{
buttons.Add(CONTEXT_BUTTON_PLAY_PARTYMODE, 15216); // Play in Partymode
}
if (item->IsSmartPlayList() || m_vecItems->IsSmartPlayList())
buttons.Add(CONTEXT_BUTTON_EDIT_SMART_PLAYLIST, 586);
else if (item->IsPlayList() || m_vecItems->IsPlayList())
buttons.Add(CONTEXT_BUTTON_EDIT, 586);
}
}
CGUIMediaWindow::GetContextButtons(itemNumber, buttons);
}
示例3: GetExecutePath
CStdString CFavouritesDirectory::GetExecutePath(const CFileItem &item, const std::string &contextWindow)
{
CStdString execute;
if (item.m_bIsFolder && (g_advancedSettings.m_playlistAsFolders ||
!(item.IsSmartPlayList() || item.IsPlayList())))
{
if (!contextWindow.empty())
execute = StringUtils::Format("ActivateWindow(%s,%s,return)", contextWindow.c_str(), StringUtils::Paramify(item.GetPath()).c_str());
}
else if (item.IsScript())
execute = StringUtils::Format("RunScript(%s)", StringUtils::Paramify(item.GetPath().substr(9)).c_str());
else if (item.IsAndroidApp())
execute = StringUtils::Format("StartAndroidActivity(%s)", StringUtils::Paramify(item.GetPath().substr(26)).c_str());
else // assume a media file
{
if (item.IsVideoDb() && item.HasVideoInfoTag())
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetVideoInfoTag()->m_strFileNameAndPath).c_str());
else
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetPath()).c_str());
}
return execute;
}
示例4: GetExecutePath
std::string CFavouritesService::GetExecutePath(const CFileItem &item, const std::string &contextWindow) const
{
std::string execute;
if (URIUtils::IsProtocol(item.GetPath(), "favourites"))
{
const CURL url(item.GetPath());
execute = CURL::Decode(url.GetHostName());
}
else if (item.m_bIsFolder && (g_advancedSettings.m_playlistAsFolders ||
!(item.IsSmartPlayList() || item.IsPlayList())))
{
if (!contextWindow.empty())
execute = StringUtils::Format("ActivateWindow(%s,%s,return)", contextWindow.c_str(), StringUtils::Paramify(item.GetPath()).c_str());
}
//! @todo STRING_CLEANUP
else if (item.IsScript() && item.GetPath().size() > 9) // script://<foo>
execute = StringUtils::Format("RunScript(%s)", StringUtils::Paramify(item.GetPath().substr(9)).c_str());
else if (item.IsAddonsPath() && item.GetPath().size() > 9) // addons://<foo>
{
CURL url(item.GetPath());
execute = StringUtils::Format("RunAddon(%s)", url.GetFileName().c_str());
}
else if (item.IsAndroidApp() && item.GetPath().size() > 26) // androidapp://sources/apps/<foo>
execute = StringUtils::Format("StartAndroidActivity(%s)", StringUtils::Paramify(item.GetPath().substr(26)).c_str());
else // assume a media file
{
if (item.IsVideoDb() && item.HasVideoInfoTag())
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetVideoInfoTag()->m_strFileNameAndPath).c_str());
else if (item.IsMusicDb() && item.HasMusicInfoTag())
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetMusicInfoTag()->GetURL()).c_str());
else if (item.IsPicture())
execute = StringUtils::Format("ShowPicture(%s)", StringUtils::Paramify(item.GetPath()).c_str());
else
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetPath()).c_str());
}
return execute;
}
示例5: GetContextButtons
void CGUIWindowMusicNav::GetContextButtons(int itemNumber, CContextButtons &buttons)
{
CGUIWindowMusicBase::GetContextButtons(itemNumber, buttons);
CGUIDialogMusicScan *musicScan = (CGUIDialogMusicScan *)m_gWindowManager.GetWindow(WINDOW_DIALOG_MUSIC_SCAN);
CFileItem *item = (itemNumber >= 0 && itemNumber < m_vecItems->Size()) ? m_vecItems->Get(itemNumber) : NULL;
if (item && (item->GetExtraInfo().Find("lastfm") < 0))
{
// are we in the playlists location?
bool inPlaylists = m_vecItems->m_strPath.Equals(CUtil::MusicPlaylistsLocation()) ||
m_vecItems->m_strPath.Equals("special://musicplaylists/");
CMusicDatabaseDirectory dir;
SScraperInfo info;
m_musicdatabase.GetScraperForPath(item->m_strPath,info);
// enable music info button on an album or on a song.
if (item->IsAudio() && !item->IsPlayList() && !item->IsSmartPlayList() &&
!item->IsLastFM() && !item->IsShoutCast())
{
buttons.Add(CONTEXT_BUTTON_SONG_INFO, 658);
}
else if (item->IsVideoDb())
{
if (!item->m_bIsFolder) // music video
buttons.Add(CONTEXT_BUTTON_INFO, 20393);
if (item->m_strPath.Left(14).Equals("videodb://3/4/") &&
item->m_strPath.size() > 14 && item->m_bIsFolder)
{
long idArtist = m_musicdatabase.GetArtistByName(m_vecItems->Get(itemNumber)->GetLabel());
if (idArtist > - 1)
buttons.Add(CONTEXT_BUTTON_INFO,21891);
}
}
else if (!inPlaylists && (dir.HasAlbumInfo(item->m_strPath)||
dir.IsArtistDir(item->m_strPath) ) &&
!dir.IsAllItem(item->m_strPath) && !item->IsParentFolder() &&
!item->IsLastFM() && !item->IsShoutCast() &&
!item->m_strPath.Left(14).Equals("musicsearch://"))
{
if (dir.IsArtistDir(item->m_strPath))
buttons.Add(CONTEXT_BUTTON_INFO, 21891);
else
buttons.Add(CONTEXT_BUTTON_INFO, 13351);
}
// enable query all albums button only in album view
if (dir.HasAlbumInfo(item->m_strPath) && !dir.IsAllItem(item->m_strPath) &&
item->m_bIsFolder && !item->IsVideoDb() && !item->IsParentFolder() &&
!item->IsLastFM() && !item->IsShoutCast() &&
!item->m_strPath.Left(14).Equals("musicsearch://"))
{
buttons.Add(CONTEXT_BUTTON_INFO_ALL, 20059);
}
// enable query all artist button only in album view
if (dir.IsArtistDir(item->m_strPath) && !dir.IsAllItem(item->m_strPath) &&
item->m_bIsFolder && !item->IsVideoDb() && !info.strContent.IsEmpty())
{
buttons.Add(CONTEXT_BUTTON_INFO_ALL, 21884);
}
// turn off set artist image if not at artist listing.
if (dir.IsArtistDir(item->m_strPath) && !dir.IsAllItem(item->m_strPath) ||
(item->m_strPath.Left(14).Equals("videodb://3/4/") &&
item->m_strPath.size() > 14 && item->m_bIsFolder))
{
buttons.Add(CONTEXT_BUTTON_SET_ARTIST_THUMB, 13359);
}
if (m_vecItems->m_strPath.Equals("plugin://music/"))
buttons.Add(CONTEXT_BUTTON_SET_PLUGIN_THUMB, 1044);
//Set default or clear default
NODE_TYPE nodetype = dir.GetDirectoryType(item->m_strPath);
if (!item->IsParentFolder() && !inPlaylists &&
(nodetype == NODE_TYPE_ROOT ||
nodetype == NODE_TYPE_OVERVIEW ||
nodetype == NODE_TYPE_TOP100))
{
if (!item->m_strPath.Equals(g_settings.m_defaultMusicLibSource))
buttons.Add(CONTEXT_BUTTON_SET_DEFAULT, 13335); // set default
if (strcmp(g_settings.m_defaultMusicLibSource, ""))
buttons.Add(CONTEXT_BUTTON_CLEAR_DEFAULT, 13403); // clear default
}
NODE_TYPE childtype = dir.GetDirectoryChildType(item->m_strPath);
if (childtype == NODE_TYPE_ALBUM || childtype == NODE_TYPE_ARTIST ||
nodetype == NODE_TYPE_GENRE || nodetype == NODE_TYPE_ALBUM)
{
// we allow the user to set content for
// 1. general artist and album nodes
// 2. specific per genre
// 3. specific per artist
// 4. specific per album
buttons.Add(CONTEXT_BUTTON_SET_CONTENT,20195);
}
if (item->HasMusicInfoTag() && item->GetMusicInfoTag()->GetArtist().size() > 0)
{
CVideoDatabase database;
database.Open();
if (database.GetMusicVideoArtistByName(item->GetMusicInfoTag()->GetArtist()) > -1)
//.........这里部分代码省略.........