当前位置: 首页>>代码示例>>C++>>正文


C++ CMusicInfoScanner::UpdateDatabaseArtistInfo方法代码示例

本文整理汇总了C++中CMusicInfoScanner::UpdateDatabaseArtistInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ CMusicInfoScanner::UpdateDatabaseArtistInfo方法的具体用法?C++ CMusicInfoScanner::UpdateDatabaseArtistInfo怎么用?C++ CMusicInfoScanner::UpdateDatabaseArtistInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CMusicInfoScanner的用法示例。


在下文中一共展示了CMusicInfoScanner::UpdateDatabaseArtistInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ShowArtistInfo

void CGUIWindowMusicBase::ShowArtistInfo(const CFileItem *pItem, bool bShowInfo /* = true */)
{
    CQueryParams params;
    CDirectoryNode::GetDatabaseInfo(pItem->GetPath(), params);

    ADDON::ScraperPtr scraper;
    if (!m_musicdatabase.GetScraperForPath(pItem->GetPath(), scraper, ADDON::ADDON_SCRAPER_ARTISTS))
        return;

    CArtist artist;
    if (!m_musicdatabase.GetArtist(params.GetArtistId(), artist))
        return;

    m_musicdatabase.GetArtistPath(params.GetArtistId(), artist.strPath);
    while (1)
    {
        // Check if we have the information in the database first
        if (!m_musicdatabase.HasArtistBeenScraped(params.GetArtistId()))
        {
            if (!CProfilesManager::GetInstance().GetCurrentProfile().canWriteDatabases() && !g_passwordManager.bMasterUser)
                break; // should display a dialog saying no permissions

            if (g_application.IsMusicScanning())
            {
                CGUIDialogOK::ShowAndGetInput(CVariant{189}, CVariant{14057});
                break;
            }

            // show dialog box indicating we're searching the album
            if (m_dlgProgress && bShowInfo)
            {
                m_dlgProgress->SetHeading(CVariant{21889});
                m_dlgProgress->SetLine(0, CVariant{pItem->GetMusicInfoTag()->GetArtist()});
                m_dlgProgress->SetLine(1, CVariant{""});
                m_dlgProgress->SetLine(2, CVariant{""});
                m_dlgProgress->Open();
            }

            CMusicInfoScanner scanner;
            if (scanner.UpdateDatabaseArtistInfo(artist, scraper, bShowInfo, m_dlgProgress) != INFO_ADDED)
            {
                CGUIDialogOK::ShowAndGetInput(CVariant{21889}, CVariant{20199});
                break;
            }
        }

        if (m_dlgProgress)
            m_dlgProgress->Close();

        CGUIDialogMusicInfo *pDlgArtistInfo = (CGUIDialogMusicInfo*)g_windowManager.GetWindow(WINDOW_DIALOG_MUSIC_INFO);
        if (pDlgArtistInfo)
        {
            pDlgArtistInfo->SetArtist(artist, artist.strPath);
            pDlgArtistInfo->Open();

            if (pDlgArtistInfo->NeedRefresh())
            {
                m_musicdatabase.ClearArtistLastScrapedTime(params.GetArtistId());
                continue;
            }
            else if (pDlgArtistInfo->HasUpdatedThumb())
            {
                Update(m_vecItems->GetPath());
            }
        }
        break;
    }
    if (m_dlgProgress)
        m_dlgProgress->Close();
}
开发者ID:nihalsunthankar,项目名称:xbmc,代码行数:70,代码来源:GUIWindowMusicBase.cpp

示例2: ShowArtistInfo

void CGUIWindowMusicBase::ShowArtistInfo(const CFileItem *pItem, bool bShowInfo /* = true */)
{
  CQueryParams params;
  CDirectoryNode::GetDatabaseInfo(pItem->GetPath(), params);
  CMusicArtistInfo artistInfo;
  while (1)
  {
    // Check if we have the information in the database first
    if (!m_musicdatabase.HasArtistInfo(params.GetArtistId()) ||
        !m_musicdatabase.GetArtistInfo(params.GetArtistId(), artistInfo.GetArtist()))
    {
      if (!CProfilesManager::Get().GetCurrentProfile().canWriteDatabases() && !g_passwordManager.bMasterUser)
        break; // should display a dialog saying no permissions

      if (g_application.IsMusicScanning())
      {
        CGUIDialogOK::ShowAndGetInput(189, 14057, 0, 0);
        break;
      }

      // show dialog box indicating we're searching the album
      if (m_dlgProgress && bShowInfo)
      {
        m_dlgProgress->SetHeading(21889);
        m_dlgProgress->SetLine(0, pItem->GetMusicInfoTag()->GetArtist());
        m_dlgProgress->SetLine(1, "");
        m_dlgProgress->SetLine(2, "");
        m_dlgProgress->StartModal();
      }

      CMusicInfoScanner scanner;
      if (scanner.UpdateDatabaseArtistInfo(pItem->GetPath(), artistInfo, bShowInfo) != INFO_ADDED || !artistInfo.Loaded())
      {
        CGUIDialogOK::ShowAndGetInput(21889, 0, 20199, 0);
        break;
      }
    }

    if (m_dlgProgress)
      m_dlgProgress->Close();

    CGUIDialogMusicInfo *pDlgArtistInfo = (CGUIDialogMusicInfo*)g_windowManager.GetWindow(WINDOW_DIALOG_MUSIC_INFO);
    if (pDlgArtistInfo)
    {
      CStdString strPath;
      m_musicdatabase.GetArtistPath(params.GetArtistId(), strPath);
      pDlgArtistInfo->SetArtist(artistInfo.GetArtist(), strPath);
      pDlgArtistInfo->DoModal();

      if (pDlgArtistInfo->NeedRefresh())
      {
        m_musicdatabase.DeleteArtistInfo(params.GetArtistId());
        continue;
      } 
      else if (pDlgArtistInfo->HasUpdatedThumb()) 
      {
        Update(m_vecItems->GetPath());
      }
    }
    break;
  }
  if (m_dlgProgress)
    m_dlgProgress->Close();
}
开发者ID:Inferno1977,项目名称:xbmc,代码行数:64,代码来源:GUIWindowMusicBase.cpp


注:本文中的CMusicInfoScanner::UpdateDatabaseArtistInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。