本文整理汇总了C++中CGUIWindowVideoNav::OnInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIWindowVideoNav::OnInfo方法的具体用法?C++ CGUIWindowVideoNav::OnInfo怎么用?C++ CGUIWindowVideoNav::OnInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIWindowVideoNav
的用法示例。
在下文中一共展示了CGUIWindowVideoNav::OnInfo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnContextButton
bool CGUIWindowMusicNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
{
CFileItemPtr item;
if (itemNumber >= 0 && itemNumber < m_vecItems->Size())
item = m_vecItems->Get(itemNumber);
switch (button)
{
case CONTEXT_BUTTON_INFO:
{
if (!item->IsVideoDb())
return CGUIWindowMusicBase::OnContextButton(itemNumber,button);
// music videos - artists
if (StringUtils::StartsWithNoCase(item->GetPath(), "videodb://musicvideos/artists/"))
{
long idArtist = m_musicdatabase.GetArtistByName(item->GetLabel());
if (idArtist == -1)
return false;
CStdString path = StringUtils::Format("musicdb://artists/%ld/", idArtist);
CArtist artist;
m_musicdatabase.GetArtistInfo(idArtist,artist,false);
*item = CFileItem(artist);
item->SetPath(path);
CGUIWindowMusicBase::OnContextButton(itemNumber,button);
Refresh();
m_viewControl.SetSelectedItem(itemNumber);
return true;
}
// music videos - albums
if (StringUtils::StartsWithNoCase(item->GetPath(), "videodb://musicvideos/albums/"))
{
long idAlbum = m_musicdatabase.GetAlbumByName(item->GetLabel());
if (idAlbum == -1)
return false;
CStdString path = StringUtils::Format("musicdb://albums/%ld/", idAlbum);
CAlbum album;
m_musicdatabase.GetAlbumInfo(idAlbum,album,NULL);
*item = CFileItem(path,album);
item->SetPath(path);
CGUIWindowMusicBase::OnContextButton(itemNumber,button);
Refresh();
m_viewControl.SetSelectedItem(itemNumber);
return true;
}
if (item->HasVideoInfoTag() && !item->GetVideoInfoTag()->m_strTitle.empty())
{
CGUIWindowVideoNav* pWindow = (CGUIWindowVideoNav*)g_windowManager.GetWindow(WINDOW_VIDEO_NAV);
if (pWindow)
{
ADDON::ScraperPtr info;
pWindow->OnInfo(item.get(),info);
Refresh();
}
}
return true;
}
case CONTEXT_BUTTON_INFO_ALL:
OnInfoAll(itemNumber);
return true;
case CONTEXT_BUTTON_SET_DEFAULT:
CSettings::Get().SetString("mymusic.defaultlibview", GetQuickpathName(item->GetPath()));
CSettings::Get().Save();
return true;
case CONTEXT_BUTTON_CLEAR_DEFAULT:
CSettings::Get().SetString("mymusic.defaultlibview", "");
CSettings::Get().Save();
return true;
case CONTEXT_BUTTON_GO_TO_ARTIST:
{
CStdString strPath;
CVideoDatabase database;
database.Open();
strPath = StringUtils::Format("videodb://musicvideos/artists/%ld/",
database.GetMatchingMusicVideo(StringUtils::Join(item->GetMusicInfoTag()->GetArtist(), g_advancedSettings.m_musicItemSeparator)));
g_windowManager.ActivateWindow(WINDOW_VIDEO_NAV,strPath);
return true;
}
case CONTEXT_BUTTON_PLAY_OTHER:
{
CVideoDatabase database;
database.Open();
CVideoInfoTag details;
database.GetMusicVideoInfo("",details,database.GetMatchingMusicVideo(StringUtils::Join(item->GetMusicInfoTag()->GetArtist(), g_advancedSettings.m_musicItemSeparator),item->GetMusicInfoTag()->GetAlbum(),item->GetMusicInfoTag()->GetTitle()));
CApplicationMessenger::Get().PlayFile(CFileItem(details));
return true;
}
case CONTEXT_BUTTON_MARK_WATCHED:
CGUIDialogVideoInfo::MarkWatched(item, true);
CUtil::DeleteVideoDatabaseDirectoryCache();
Refresh();
return true;
//.........这里部分代码省略.........
示例2: OnContextButton
bool CGUIWindowMusicNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
{
CFileItemPtr item;
if (itemNumber >= 0 && itemNumber < m_vecItems->Size())
item = m_vecItems->Get(itemNumber);
switch (button)
{
case CONTEXT_BUTTON_INFO:
{
if (!item->IsVideoDb())
return CGUIWindowMusicBase::OnContextButton(itemNumber,button);
// music videos - artists
if (item->GetPath().Left(14).Equals("videodb://3/4/"))
{
long idArtist = m_musicdatabase.GetArtistByName(item->GetLabel());
if (idArtist == -1)
return false;
CStdString path; path.Format("musicdb://2/%ld/", idArtist);
item->SetPath(path);
CGUIWindowMusicBase::OnContextButton(itemNumber,button);
Update(m_vecItems->GetPath());
m_viewControl.SetSelectedItem(itemNumber);
return true;
}
// music videos - albums
if (item->GetPath().Left(14).Equals("videodb://3/5/"))
{
long idAlbum = m_musicdatabase.GetAlbumByName(item->GetLabel());
if (idAlbum == -1)
return false;
CStdString path; path.Format("musicdb://3/%ld/", idAlbum);
item->SetPath(path);
CGUIWindowMusicBase::OnContextButton(itemNumber,button);
Update(m_vecItems->GetPath());
m_viewControl.SetSelectedItem(itemNumber);
return true;
}
if (item->HasVideoInfoTag() && !item->GetVideoInfoTag()->m_strTitle.IsEmpty())
{
CGUIWindowVideoNav* pWindow = (CGUIWindowVideoNav*)g_windowManager.GetWindow(WINDOW_VIDEO_NAV);
if (pWindow)
{
ADDON::ScraperPtr info;
pWindow->OnInfo(item.get(),info);
Update(m_vecItems->GetPath());
}
}
return true;
}
case CONTEXT_BUTTON_INFO_ALL:
OnInfoAll(itemNumber);
return true;
case CONTEXT_BUTTON_UPDATE_LIBRARY:
{
CGUIDialogMusicScan *scanner = (CGUIDialogMusicScan *)g_windowManager.GetWindow(WINDOW_DIALOG_MUSIC_SCAN);
if (scanner)
scanner->StartScanning("");
return true;
}
case CONTEXT_BUTTON_SET_DEFAULT:
g_settings.m_defaultMusicLibSource = GetQuickpathName(item->GetPath());
g_settings.Save();
return true;
case CONTEXT_BUTTON_CLEAR_DEFAULT:
g_settings.m_defaultMusicLibSource.Empty();
g_settings.Save();
return true;
case CONTEXT_BUTTON_GO_TO_ARTIST:
{
CStdString strPath;
CVideoDatabase database;
database.Open();
strPath.Format("videodb://3/4/%ld/",database.GetMatchingMusicVideo(item->GetMusicInfoTag()->GetArtist()));
g_windowManager.ActivateWindow(WINDOW_VIDEO_NAV,strPath);
return true;
}
case CONTEXT_BUTTON_PLAY_OTHER:
{
CVideoDatabase database;
database.Open();
CVideoInfoTag details;
database.GetMusicVideoInfo("",details,database.GetMatchingMusicVideo(item->GetMusicInfoTag()->GetArtist(),item->GetMusicInfoTag()->GetAlbum(),item->GetMusicInfoTag()->GetTitle()));
g_application.getApplicationMessenger().PlayFile(CFileItem(details));
return true;
}
case CONTEXT_BUTTON_MARK_WATCHED:
CGUIWindowVideoBase::MarkWatched(item,true);
CUtil::DeleteVideoDatabaseDirectoryCache();
Update(m_vecItems->GetPath());
//.........这里部分代码省略.........
示例3: OnContextButton
bool CGUIWindowMusicNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
{
switch (button)
{
case CONTEXT_BUTTON_INFO:
{
if (!m_vecItems->Get(itemNumber)->IsVideoDb())
return CGUIWindowMusicBase::OnContextButton(itemNumber,button);
if (m_vecItems->Get(itemNumber)->m_strPath.Left(14).Equals("videodb://3/4/"))
{
long idArtist = m_musicdatabase.GetArtistByName(m_vecItems->Get(itemNumber)->GetLabel());
if (idArtist == -1)
return false;
m_vecItems->Get(itemNumber)->m_strPath.Format("musicdb://2/%ld/",
m_musicdatabase.GetArtistByName(m_vecItems->Get(itemNumber)->GetLabel()));
CGUIWindowMusicBase::OnContextButton(itemNumber,button);
Update(m_vecItems->m_strPath);
m_viewControl.SetSelectedItem(itemNumber);
return true;
}
CGUIWindowVideoNav* pWindow = (CGUIWindowVideoNav*)m_gWindowManager.GetWindow(WINDOW_VIDEO_NAV);
if (pWindow)
{
SScraperInfo info;
pWindow->OnInfo(m_vecItems->Get(itemNumber),info);
Update(m_vecItems->m_strPath);
}
return true;
}
case CONTEXT_BUTTON_INFO_ALL:
OnInfoAll(itemNumber);
return true;
case CONTEXT_BUTTON_SET_ARTIST_THUMB:
case CONTEXT_BUTTON_SET_PLUGIN_THUMB:
SetThumb(itemNumber, button);
return true;
case CONTEXT_BUTTON_UPDATE_LIBRARY:
{
CGUIDialogMusicScan *scanner = (CGUIDialogMusicScan *)m_gWindowManager.GetWindow(WINDOW_DIALOG_MUSIC_SCAN);
if (scanner)
scanner->StartScanning("");
return true;
}
case CONTEXT_BUTTON_SET_DEFAULT:
g_settings.m_defaultMusicLibSource = GetQuickpathName(m_vecItems->Get(itemNumber)->m_strPath);
g_settings.Save();
return true;
case CONTEXT_BUTTON_CLEAR_DEFAULT:
g_settings.m_defaultMusicLibSource.Empty();
g_settings.Save();
return true;
case CONTEXT_BUTTON_GO_TO_ARTIST:
{
CStdString strPath;
CVideoDatabase database;
database.Open();
strPath.Format("videodb://3/4/%ld/",database.GetMusicVideoArtistByName(m_vecItems->Get(itemNumber)->GetMusicInfoTag()->GetArtist()));
m_gWindowManager.ActivateWindow(WINDOW_VIDEO_NAV,strPath);
return true;
}
case CONTEXT_BUTTON_PLAY_OTHER:
{
CVideoDatabase database;
database.Open();
CVideoInfoTag details;
database.GetMusicVideoInfo("",details,database.GetMusicVideoByArtistAndAlbumAndTitle(m_vecItems->Get(itemNumber)->GetMusicInfoTag()->GetArtist(),m_vecItems->Get(itemNumber)->GetMusicInfoTag()->GetAlbum(),m_vecItems->Get(itemNumber)->GetMusicInfoTag()->GetTitle()));
g_application.getApplicationMessenger().PlayFile(CFileItem(details));
return true;
}
case CONTEXT_BUTTON_MARK_WATCHED:
CGUIWindowVideoBase::MarkWatched(m_vecItems->Get(itemNumber));
CUtil::DeleteVideoDatabaseDirectoryCache();
Update(m_vecItems->m_strPath);
return true;
case CONTEXT_BUTTON_MARK_UNWATCHED:
CGUIWindowVideoBase::MarkUnWatched(m_vecItems->Get(itemNumber));
CUtil::DeleteVideoDatabaseDirectoryCache();
Update(m_vecItems->m_strPath);
return true;
case CONTEXT_BUTTON_RENAME:
CGUIWindowVideoBase::UpdateVideoTitle(m_vecItems->Get(itemNumber));
CUtil::DeleteVideoDatabaseDirectoryCache();
Update(m_vecItems->m_strPath);
return true;
case CONTEXT_BUTTON_DELETE:
CGUIWindowVideoNav::DeleteItem(m_vecItems->Get(itemNumber));
CUtil::DeleteVideoDatabaseDirectoryCache();
Update(m_vecItems->m_strPath);
return true;
//.........这里部分代码省略.........