本文整理汇总了C++中CFileItemPtr::IsLastFM方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItemPtr::IsLastFM方法的具体用法?C++ CFileItemPtr::IsLastFM怎么用?C++ CFileItemPtr::IsLastFM使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItemPtr
的用法示例。
在下文中一共展示了CFileItemPtr::IsLastFM方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetContextButtons
void CGUIWindowMusicPlayList::GetContextButtons(int itemNumber, CContextButtons &buttons)
{
// is this playlist playing?
int itemPlaying = g_playlistPlayer.GetCurrentSong();
if (itemNumber >= 0 && itemNumber < m_vecItems->Size())
{
CFileItemPtr item;
item = m_vecItems->Get(itemNumber);
if (m_movingFrom >= 0)
{
// we can move the item to any position not where we are, and any position not above currently
// playing item in party mode
#ifndef _BOXEE_
if (itemNumber != m_movingFrom && (!g_partyModeManager.IsEnabled() || itemNumber > itemPlaying))
buttons.Add(CONTEXT_BUTTON_MOVE_HERE, 13252); // move item here
#endif
buttons.Add(CONTEXT_BUTTON_CANCEL_MOVE, 13253);
}
else
{ // aren't in a move
if (!item->IsLastFM() && !item->IsShoutCast())
buttons.Add(CONTEXT_BUTTON_SONG_INFO, 658); // Song Info
if (CFavourites::IsFavourite(item.get(), GetID()))
buttons.Add(CONTEXT_BUTTON_ADD_FAVOURITE, 14077); // Remove Favourite
#ifndef _BOXEE_
else
buttons.Add(CONTEXT_BUTTON_ADD_FAVOURITE, 14076); // Add To Favourites;
if (itemNumber > (g_partyModeManager.IsEnabled() ? 1 : 0))
buttons.Add(CONTEXT_BUTTON_MOVE_ITEM_UP, 13332);
#endif
if (itemNumber + 1 < m_vecItems->Size())
buttons.Add(CONTEXT_BUTTON_MOVE_ITEM_DOWN, 13333);
#ifndef _BOXEE_
if (!g_partyModeManager.IsEnabled() || itemNumber != itemPlaying)
buttons.Add(CONTEXT_BUTTON_MOVE_ITEM, 13251);
#endif
if (itemNumber != itemPlaying)
buttons.Add(CONTEXT_BUTTON_DELETE, 1210); // Remove
}
}
#ifndef _BOXEE_
if (g_partyModeManager.IsEnabled())
{
buttons.Add(CONTEXT_BUTTON_EDIT_PARTYMODE, 21439);
buttons.Add(CONTEXT_BUTTON_CANCEL_PARTYMODE, 588); // cancel party mode
}
#endif
}
示例2: GetContextButtons
void CGUIWindowMusicPlayList::GetContextButtons(int itemNumber, CContextButtons &buttons)
{
// is this playlist playing?
int itemPlaying = g_playlistPlayer.GetCurrentSong();
if (itemNumber >= 0 && itemNumber < m_vecItems->Size())
{
CFileItemPtr item;
item = m_vecItems->Get(itemNumber);
if (m_movingFrom >= 0)
{
// we can move the item to any position not where we are, and any position not above currently
// playing item in party mode
if (itemNumber != m_movingFrom && (!g_partyModeManager.IsEnabled() || itemNumber > itemPlaying))
buttons.Add(CONTEXT_BUTTON_MOVE_HERE, 13252); // move item here
buttons.Add(CONTEXT_BUTTON_CANCEL_MOVE, 13253);
}
else
{ // aren't in a move
// check what players we have, if we have multiple display play with option
VECPLAYERCORES vecCores;
CPlayerCoreFactory::Get().GetPlayers(*item, vecCores);
if (vecCores.size() > 1)
buttons.Add(CONTEXT_BUTTON_PLAY_WITH, 15213); // Play With...
if (!item->IsLastFM())
buttons.Add(CONTEXT_BUTTON_SONG_INFO, 658); // Song Info
if (CFavourites::IsFavourite(item.get(), GetID()))
buttons.Add(CONTEXT_BUTTON_ADD_FAVOURITE, 14077); // Remove Favourite
else
buttons.Add(CONTEXT_BUTTON_ADD_FAVOURITE, 14076); // Add To Favourites;
if (itemNumber > (g_partyModeManager.IsEnabled() ? 1 : 0))
buttons.Add(CONTEXT_BUTTON_MOVE_ITEM_UP, 13332);
if (itemNumber + 1 < m_vecItems->Size())
buttons.Add(CONTEXT_BUTTON_MOVE_ITEM_DOWN, 13333);
if (!g_partyModeManager.IsEnabled() || itemNumber != itemPlaying)
buttons.Add(CONTEXT_BUTTON_MOVE_ITEM, 13251);
if (itemNumber != itemPlaying)
buttons.Add(CONTEXT_BUTTON_DELETE, 1210); // Remove
}
}
if (g_partyModeManager.IsEnabled())
{
buttons.Add(CONTEXT_BUTTON_EDIT_PARTYMODE, 21439);
buttons.Add(CONTEXT_BUTTON_CANCEL_PARTYMODE, 588); // cancel party mode
}
}
示例3: OnPlayMedia
bool CGUIWindowMusicBase::OnPlayMedia(int iItem)
{
CFileItemPtr pItem = m_vecItems->Get(iItem);
if (pItem->m_strPath == "add" && pItem->GetLabel() == g_localizeStrings.Get(1026)) // 'add source button' in empty root
{
if (CGUIDialogMediaSource::ShowAndAddMediaSource("music"))
{
Update("");
return true;
}
return false;
}
// party mode
#ifndef _BOXEE_
if (g_partyModeManager.IsEnabled() && !pItem->IsLastFM())
{
CPlayList playlistTemp;
playlistTemp.Add(pItem);
g_partyModeManager.AddUserSongs(playlistTemp, true);
return true;
}
else
#endif
if (!pItem->IsPlayList() && !pItem->IsInternetStream())
{ // single music file - if we get here then we have autoplaynextitem turned off, but we
// still want to use the playlist player in order to handle more queued items following etc.
g_playlistPlayer.Reset();
g_playlistPlayer.ClearPlaylist(PLAYLIST_MUSIC);
g_playlistPlayer.Add(PLAYLIST_MUSIC, pItem);
g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_MUSIC);
g_playlistPlayer.Play();
return true;
}
return CGUIMediaWindow::OnPlayMedia(iItem);
}
示例4: GetContextButtons
void CGUIWindowMusicNav::GetContextButtons(int itemNumber, CContextButtons &buttons)
{
CGUIWindowMusicBase::GetContextButtons(itemNumber, buttons);
CGUIDialogMusicScan *musicScan = (CGUIDialogMusicScan *)g_windowManager.GetWindow(WINDOW_DIALOG_MUSIC_SCAN);
CFileItemPtr item;
if (itemNumber >= 0 && itemNumber < m_vecItems->Size())
item = m_vecItems->Get(itemNumber);
if (item && (item->GetExtraInfo().Find("lastfm") < 0))
{
// are we in the playlists location?
bool inPlaylists = m_vecItems->GetPath().Equals(CUtil::MusicPlaylistsLocation()) ||
m_vecItems->GetPath().Equals("special://musicplaylists/");
CMusicDatabaseDirectory dir;
// enable music info button on an album or on a song.
if (item->IsAudio() && !item->IsPlayList() && !item->IsSmartPlayList() &&
!item->IsLastFM() && !item->m_bIsFolder)
{
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->GetPath().Left(14).Equals("videodb://3/4/") &&
item->GetPath().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->GetPath())||
dir.IsArtistDir(item->GetPath()) ) &&
!dir.IsAllItem(item->GetPath()) && !item->IsParentFolder() &&
!item->IsLastFM() && !item->IsPlugin() && !item->IsScript() &&
!item->GetPath().Left(14).Equals("musicsearch://"))
{
if (dir.IsArtistDir(item->GetPath()))
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->GetPath()) && !dir.IsAllItem(item->GetPath()) &&
item->m_bIsFolder && !item->IsVideoDb() && !item->IsParentFolder() &&
!item->IsLastFM() &&
!item->IsPlugin() && !item->GetPath().Left(14).Equals("musicsearch://"))
{
buttons.Add(CONTEXT_BUTTON_INFO_ALL, 20059);
}
// enable query all artist button only in album view
if (dir.IsArtistDir(item->GetPath()) && !dir.IsAllItem(item->GetPath()) &&
item->m_bIsFolder && !item->IsVideoDb())
{
ADDON::ScraperPtr info;
m_musicdatabase.GetScraperForPath(item->GetPath(), info, ADDON::ADDON_SCRAPER_ARTISTS);
if (info && info->Supports(CONTENT_ARTISTS))
buttons.Add(CONTEXT_BUTTON_INFO_ALL, 21884);
}
//Set default or clear default
NODE_TYPE nodetype = dir.GetDirectoryType(item->GetPath());
if (!item->IsParentFolder() && !inPlaylists &&
(nodetype == NODE_TYPE_ROOT ||
nodetype == NODE_TYPE_OVERVIEW ||
nodetype == NODE_TYPE_TOP100))
{
if (!item->GetPath().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->GetPath());
if (childtype == NODE_TYPE_ALBUM ||
childtype == NODE_TYPE_ARTIST ||
nodetype == NODE_TYPE_GENRE ||
nodetype == NODE_TYPE_ALBUM ||
nodetype == NODE_TYPE_ALBUM_RECENTLY_ADDED ||
nodetype == NODE_TYPE_ALBUM_COMPILATIONS)
{
// 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.GetMatchingMusicVideo(item->GetMusicInfoTag()->GetArtist()) > -1)
buttons.Add(CONTEXT_BUTTON_GO_TO_ARTIST, 20400);
}
if (item->HasMusicInfoTag() && item->GetMusicInfoTag()->GetArtist().size() > 0 &&
item->GetMusicInfoTag()->GetAlbum().size() > 0 &&
//.........这里部分代码省略.........
示例5: GetContextButtons
void CGUIWindowMusicSongs::GetContextButtons(int itemNumber, CContextButtons &buttons)
{
CFileItemPtr item;
if (itemNumber >= 0 && itemNumber < m_vecItems->Size())
item = m_vecItems->Get(itemNumber);
if (item)
{
// are we in the playlists location?
bool inPlaylists = m_vecItems->m_strPath.Equals(CUtil::MusicPlaylistsLocation()) ||
m_vecItems->m_strPath.Equals("special://musicplaylists/");
if (m_vecItems->IsVirtualDirectoryRoot())
{
// get the usual music shares, and anything for all media windows
CGUIDialogContextMenu::GetContextButtons("music", item, buttons);
// enable Rip CD an audio disc
if (CDetectDVDMedia::IsDiscInDrive() && item->IsCDDA())
{
// those cds can also include Audio Tracks: CDExtra and MixedMode!
CCdInfo *pCdInfo = CDetectDVDMedia::GetCdInfo();
if (pCdInfo->IsAudio(1) || pCdInfo->IsCDExtra(1) || pCdInfo->IsMixedMode(1))
buttons.Add(CONTEXT_BUTTON_RIP_CD, 600);
}
CGUIMediaWindow::GetContextButtons(itemNumber, buttons);
}
else
{
CGUIWindowMusicBase::GetContextButtons(itemNumber, buttons);
if (item->GetPropertyBOOL("pluginreplacecontextitems"))
return;
if (!item->IsPlayList())
{
if (item->IsAudio() && !item->IsLastFM() && !item->IsShoutCast())
buttons.Add(CONTEXT_BUTTON_SONG_INFO, 658); // Song Info
else if (!item->IsParentFolder() && !item->IsLastFM() && !item->IsShoutCast() &&
!item->m_strPath.Left(3).Equals("new") && item->m_bIsFolder)
{
#if 0
if (m_musicdatabase.GetAlbumIdByPath(item->m_strPath) > -1)
#endif
buttons.Add(CONTEXT_BUTTON_INFO, 13351); // Album Info
}
}
// enable Rip CD Audio or Track button if we have an audio disc
if (CDetectDVDMedia::IsDiscInDrive() && m_vecItems->IsCDDA())
{
// those cds can also include Audio Tracks: CDExtra and MixedMode!
CCdInfo *pCdInfo = CDetectDVDMedia::GetCdInfo();
if (pCdInfo->IsAudio(1) || pCdInfo->IsCDExtra(1) || pCdInfo->IsMixedMode(1))
buttons.Add(CONTEXT_BUTTON_RIP_TRACK, 610);
}
// enable CDDB lookup if the current dir is CDDA
if (CDetectDVDMedia::IsDiscInDrive() && m_vecItems->IsCDDA() &&
(g_settings.m_vecProfiles[g_settings.m_iLastLoadedProfileIndex].canWriteDatabases() || g_passwordManager.bMasterUser))
{
buttons.Add(CONTEXT_BUTTON_CDDB, 16002);
}
if (!item->IsParentFolder() && !item->IsReadOnly())
{
// either we're at the playlist location or its been explicitly allowed
if (inPlaylists || g_guiSettings.GetBool("filelists.allowfiledeletion"))
{
buttons.Add(CONTEXT_BUTTON_DELETE, 117);
buttons.Add(CONTEXT_BUTTON_RENAME, 118);
}
}
}
// Add the scan button(s)
CGUIDialogMusicScan *pScanDlg = (CGUIDialogMusicScan *)m_gWindowManager.GetWindow(WINDOW_DIALOG_MUSIC_SCAN);
if (g_guiSettings.GetBool("musiclibrary.enabled") && pScanDlg)
{
if (pScanDlg->IsScanning())
buttons.Add(CONTEXT_BUTTON_STOP_SCANNING, 13353); // Stop Scanning
else if (!inPlaylists && !m_vecItems->IsInternetStream() &&
!item->IsLastFM() && !item->IsShoutCast() &&
!item->m_strPath.Equals("add") && !item->IsParentFolder() &&
(g_settings.m_vecProfiles[g_settings.m_iLastLoadedProfileIndex].canWriteDatabases() || g_passwordManager.bMasterUser))
{
buttons.Add(CONTEXT_BUTTON_SCAN, 13352);
}
}
}
if (!m_vecItems->IsVirtualDirectoryRoot())
buttons.Add(CONTEXT_BUTTON_SWITCH_MEDIA, 523);
CGUIWindowMusicBase::GetNonContextButtons(buttons);
}
示例6: GetContextButtons
void CGUIWindowMusicSongs::GetContextButtons(int itemNumber, CContextButtons &buttons)
{
CFileItemPtr item;
if (itemNumber >= 0 && itemNumber < m_vecItems->Size())
item = m_vecItems->Get(itemNumber);
if (item)
{
// are we in the playlists location?
bool inPlaylists = m_vecItems->GetPath().Equals(CUtil::MusicPlaylistsLocation()) ||
m_vecItems->GetPath().Equals("special://musicplaylists/");
if (m_vecItems->IsVirtualDirectoryRoot())
{
// get the usual music shares, and anything for all media windows
CGUIDialogContextMenu::GetContextButtons("music", item, buttons);
#ifdef HAS_DVD_DRIVE
// enable Rip CD an audio disc
if (g_mediaManager.IsDiscInDrive() && item->IsCDDA())
{
// those cds can also include Audio Tracks: CDExtra and MixedMode!
CCdInfo *pCdInfo = g_mediaManager.GetCdInfo();
if (pCdInfo->IsAudio(1) || pCdInfo->IsCDExtra(1) || pCdInfo->IsMixedMode(1))
{
if (CJobManager::GetInstance().IsProcessing("cdrip"))
buttons.Add(CONTEXT_BUTTON_CANCEL_RIP_CD, 14100);
else
buttons.Add(CONTEXT_BUTTON_RIP_CD, 600);
}
}
#endif
CGUIMediaWindow::GetContextButtons(itemNumber, buttons);
}
else
{
CGUIWindowMusicBase::GetContextButtons(itemNumber, buttons);
if (item->GetProperty("pluginreplacecontextitems").asBoolean())
return;
if (!item->IsPlayList() && !item->IsPlugin() && !item->IsScript())
{
if (item->IsAudio() && !item->IsLastFM())
buttons.Add(CONTEXT_BUTTON_SONG_INFO, 658); // Song Info
else if (!item->IsParentFolder() && !item->IsLastFM() &&
!item->GetPath().Left(3).Equals("new") && item->m_bIsFolder)
{
#if 0
if (m_musicdatabase.GetAlbumIdByPath(item->GetPath()) > -1)
#endif
buttons.Add(CONTEXT_BUTTON_INFO, 13351); // Album Info
}
}
#ifdef HAS_DVD_DRIVE
// enable Rip CD Audio or Track button if we have an audio disc
if (g_mediaManager.IsDiscInDrive() && m_vecItems->IsCDDA())
{
// those cds can also include Audio Tracks: CDExtra and MixedMode!
CCdInfo *pCdInfo = g_mediaManager.GetCdInfo();
if (pCdInfo->IsAudio(1) || pCdInfo->IsCDExtra(1) || pCdInfo->IsMixedMode(1))
buttons.Add(CONTEXT_BUTTON_RIP_TRACK, 610);
}
#endif
// enable CDDB lookup if the current dir is CDDA
if (g_mediaManager.IsDiscInDrive() && m_vecItems->IsCDDA() &&
(g_settings.GetCurrentProfile().canWriteDatabases() || g_passwordManager.bMasterUser))
{
buttons.Add(CONTEXT_BUTTON_CDDB, 16002);
}
if (!item->IsParentFolder() && !item->IsReadOnly())
{
// either we're at the playlist location or its been explicitly allowed
if (inPlaylists || g_guiSettings.GetBool("filelists.allowfiledeletion"))
{
buttons.Add(CONTEXT_BUTTON_DELETE, 117);
buttons.Add(CONTEXT_BUTTON_RENAME, 118);
}
}
}
// Add the scan button(s)
if (g_application.IsMusicScanning())
buttons.Add(CONTEXT_BUTTON_STOP_SCANNING, 13353); // Stop Scanning
else if (!inPlaylists && !m_vecItems->IsInternetStream() &&
!item->IsLastFM() &&
!item->GetPath().Equals("add") && !item->IsParentFolder() &&
!item->IsPlugin() &&
!item->GetPath().Left(9).Equals("addons://") &&
(g_settings.GetCurrentProfile().canWriteDatabases() || g_passwordManager.bMasterUser))
{
buttons.Add(CONTEXT_BUTTON_SCAN, 13352);
}
if (item->IsPlugin() || item->IsScript() || m_vecItems->IsPlugin())
buttons.Add(CONTEXT_BUTTON_PLUGIN_SETTINGS, 1045);
}
if (!m_vecItems->IsVirtualDirectoryRoot() && !m_vecItems->IsPlugin())
buttons.Add(CONTEXT_BUTTON_SWITCH_MEDIA, 523);
CGUIWindowMusicBase::GetNonContextButtons(buttons);
}