本文整理汇总了C++中CGUIDialogMusicScan::IsDialogRunning方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIDialogMusicScan::IsDialogRunning方法的具体用法?C++ CGUIDialogMusicScan::IsDialogRunning怎么用?C++ CGUIDialogMusicScan::IsDialogRunning使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIDialogMusicScan
的用法示例。
在下文中一共展示了CGUIDialogMusicScan::IsDialogRunning方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnBack
bool CGUIWindowMusicBase::OnBack(int actionID)
{
CGUIDialogMusicScan *musicScan = (CGUIDialogMusicScan *)g_windowManager.GetWindow(WINDOW_DIALOG_MUSIC_SCAN);
if (musicScan && !musicScan->IsDialogRunning())
{
CUtil::ThumbCacheClear();
CUtil::RemoveTempFiles();
}
return CGUIMediaWindow::OnBack(actionID);
}
示例2: OnAction
/// \brief Handle actions on window.
/// \param action Action that can be reacted on.
bool CGUIWindowMusicBase::OnAction(const CAction& action)
{
if (action.GetID() == ACTION_PREVIOUS_MENU)
{
CGUIDialogMusicScan *musicScan = (CGUIDialogMusicScan *)g_windowManager.GetWindow(WINDOW_DIALOG_MUSIC_SCAN);
if (musicScan && !musicScan->IsDialogRunning())
{
CUtil::ThumbCacheClear();
CUtil::RemoveTempFiles();
}
}
return CGUIMediaWindow::OnAction(action);
}
示例3: OnAction
/// \brief Handle actions on window.
/// \param action Action that can be reacted on.
bool CGUIWindowMusicBase::OnAction(const CAction& action)
{
if (action.wID == ACTION_PREVIOUS_MENU)
{
CGUIDialogMusicScan *musicScan = (CGUIDialogMusicScan *)m_gWindowManager.GetWindow(WINDOW_DIALOG_MUSIC_SCAN);
if (musicScan && !musicScan->IsDialogRunning())
{
CUtil::ThumbCacheClear();
CUtil::RemoveTempFiles();
}
}
if (action.wID == ACTION_SHOW_PLAYLIST)
{
m_gWindowManager.ActivateWindow(WINDOW_MUSIC_PLAYLIST);
return true;
}
return CGUIMediaWindow::OnAction(action);
}
示例4: ShowAlbumInfo
void CGUIWindowMusicBase::ShowAlbumInfo(const CAlbum& album, const CStdString& path, bool bRefresh, bool bShowInfo)
{
bool saveDb = album.idAlbum != -1;
if (!g_settings.GetCurrentProfile().canWriteDatabases() && !g_passwordManager.bMasterUser)
saveDb = false;
// check cache
CAlbum albumInfo;
if (!bRefresh && m_musicdatabase.GetAlbumInfo(album.idAlbum, albumInfo, &albumInfo.songs))
{
if (!bShowInfo)
return;
CGUIDialogMusicInfo *pDlgAlbumInfo = (CGUIDialogMusicInfo*)g_windowManager.GetWindow(WINDOW_DIALOG_MUSIC_INFO);
if (pDlgAlbumInfo)
{
pDlgAlbumInfo->SetAlbum(albumInfo, path);
if (bShowInfo)
pDlgAlbumInfo->DoModal();
else
pDlgAlbumInfo->RefreshThumb(); // downloads the thumb if we don't already have one
if (!pDlgAlbumInfo->NeedRefresh())
{
if (pDlgAlbumInfo->HasUpdatedThumb())
UpdateThumb(albumInfo, path);
return;
}
bRefresh = true;
m_musicdatabase.DeleteAlbumInfo(albumInfo.idAlbum);
}
}
// If we are scanning for music info in the background,
// other writing access to the database is prohibited.
CGUIDialogMusicScan* dlgMusicScan = (CGUIDialogMusicScan*)g_windowManager.GetWindow(WINDOW_DIALOG_MUSIC_SCAN);
if (dlgMusicScan->IsDialogRunning())
{
CGUIDialogOK::ShowAndGetInput(189, 14057, 0, 0);
return;
}
CMusicAlbumInfo info;
if (FindAlbumInfo(album.strAlbum, StringUtils::Join(album.artist, g_advancedSettings.m_musicItemSeparator), info, bShowInfo ? (bRefresh ? SELECTION_FORCED : SELECTION_ALLOWED) : SELECTION_AUTO))
{
// download the album info
if ( info.Loaded() )
{
// set album title from musicinfotag, not the one we got from allmusic.com
info.SetTitle(album.strAlbum);
if (saveDb)
{
// save to database
m_musicdatabase.SetAlbumInfo(album.idAlbum, info.GetAlbum(), info.GetSongs());
}
if (m_dlgProgress && bShowInfo)
m_dlgProgress->Close();
UpdateThumb(album, path);
// ok, show album info
CGUIDialogMusicInfo *pDlgAlbumInfo = (CGUIDialogMusicInfo*)g_windowManager.GetWindow(WINDOW_DIALOG_MUSIC_INFO);
if (pDlgAlbumInfo)
{
pDlgAlbumInfo->SetAlbum(info.GetAlbum(), path);
if (bShowInfo)
pDlgAlbumInfo->DoModal();
else
pDlgAlbumInfo->RefreshThumb(); // downloads the thumb if we don't already have one
CAlbum albumInfo = info.GetAlbum();
albumInfo.idAlbum = album.idAlbum;
if (pDlgAlbumInfo->HasUpdatedThumb())
UpdateThumb(albumInfo, path);
if (pDlgAlbumInfo->NeedRefresh())
{
m_musicdatabase.DeleteAlbumInfo(albumInfo.idAlbum);
ShowAlbumInfo(album, path, true, bShowInfo);
return;
}
}
}
else
{
// failed 2 download album info
CGUIDialogOK::ShowAndGetInput(185, 0, 500, 0);
}
}
if (m_dlgProgress && bShowInfo)
m_dlgProgress->Close();
}
示例5: ShowArtistInfo
void CGUIWindowMusicBase::ShowArtistInfo(const CArtist& artist, const CStdString& path, bool bRefresh, bool bShowInfo)
{
bool saveDb = artist.idArtist != -1;
if (!g_settings.GetCurrentProfile().canWriteDatabases() && !g_passwordManager.bMasterUser)
saveDb = false;
// check cache
CArtist artistInfo;
if (!bRefresh && m_musicdatabase.GetArtistInfo(artist.idArtist, artistInfo))
{
if (!bShowInfo)
return;
CGUIDialogMusicInfo *pDlgArtistInfo = (CGUIDialogMusicInfo*)g_windowManager.GetWindow(WINDOW_DIALOG_MUSIC_INFO);
if (pDlgArtistInfo)
{
pDlgArtistInfo->SetArtist(artistInfo, path);
if (bShowInfo)
pDlgArtistInfo->DoModal();
else
pDlgArtistInfo->RefreshThumb(); // downloads the thumb if we don't already have one
if (!pDlgArtistInfo->NeedRefresh())
{
if (pDlgArtistInfo->HasUpdatedThumb())
Update(m_vecItems->GetPath());
return;
}
bRefresh = true;
m_musicdatabase.DeleteArtistInfo(artistInfo.idArtist);
}
}
// If we are scanning for music info in the background,
// other writing access to the database is prohibited.
CGUIDialogMusicScan* dlgMusicScan = (CGUIDialogMusicScan*)g_windowManager.GetWindow(WINDOW_DIALOG_MUSIC_SCAN);
if (dlgMusicScan->IsDialogRunning())
{
CGUIDialogOK::ShowAndGetInput(189, 14057, 0, 0);
return;
}
CMusicArtistInfo info;
if (FindArtistInfo(artist.strArtist, info, bShowInfo ? (bRefresh ? SELECTION_FORCED : SELECTION_ALLOWED) : SELECTION_AUTO))
{
// download the album info
if ( info.Loaded() )
{
if (saveDb)
{
// save to database
m_musicdatabase.SetArtistInfo(artist.idArtist, info.GetArtist());
}
if (m_dlgProgress && bShowInfo)
m_dlgProgress->Close();
// ok, show album info
CGUIDialogMusicInfo *pDlgArtistInfo = (CGUIDialogMusicInfo*)g_windowManager.GetWindow(WINDOW_DIALOG_MUSIC_INFO);
if (pDlgArtistInfo)
{
pDlgArtistInfo->SetArtist(info.GetArtist(), path);
if (bShowInfo)
pDlgArtistInfo->DoModal();
else
pDlgArtistInfo->RefreshThumb(); // downloads the thumb if we don't already have one
CArtist artistInfo = info.GetArtist();
artistInfo.idArtist = artist.idArtist;
/*
if (pDlgAlbumInfo->HasUpdatedThumb())
UpdateThumb(artistInfo, path);
*/
// just update for now
Update(m_vecItems->GetPath());
if (pDlgArtistInfo->NeedRefresh())
{
m_musicdatabase.DeleteArtistInfo(artistInfo.idArtist);
ShowArtistInfo(artist, path, true, bShowInfo);
return;
}
}
}
else
{
// failed 2 download album info
CGUIDialogOK::ShowAndGetInput(21889, 0, 20199, 0);
}
}
if (m_dlgProgress && bShowInfo)
m_dlgProgress->Close();
}
示例6: DoWork
//.........这里部分代码省略.........
if (!m_item.HasVideoInfoTag() || m_item.GetVideoInfoTag()->m_resumePoint.timeInSeconds != m_bookmark.timeInSeconds)
{
if (m_bookmark.timeInSeconds <= 0.0f)
videodatabase.ClearBookMarksOfFile(progressTrackingFile, CBookmark::RESUME);
else
videodatabase.AddBookMarkToFile(progressTrackingFile, m_bookmark, CBookmark::RESUME);
if (m_item.HasVideoInfoTag())
m_item.GetVideoInfoTag()->m_resumePoint = m_bookmark;
// PVR: Set/clear recording's resume bookmark on the backend (if supported)
if (m_item.HasPVRRecordingInfoTag())
{
PVR::CPVRRecordingPtr recording = m_item.GetPVRRecordingInfoTag();
recording->SetLastPlayedPosition(m_bookmark.timeInSeconds <= 0.0f ? 0 : (int)m_bookmark.timeInSeconds);
recording->m_resumePoint = m_bookmark;
}
// UPnP announce resume point changes to clients
// however not if playcount is modified as that already announces
if (m_item.IsVideoDb() && !m_updatePlayCount)
{
CVariant data;
data["id"] = m_item.GetVideoInfoTag()->m_iDbId;
data["type"] = m_item.GetVideoInfoTag()->m_type;
ANNOUNCEMENT::CAnnouncementManager::Get().Announce(ANNOUNCEMENT::VideoLibrary, "xbmc", "OnUpdate", data);
}
updateListing = true;
}
}
if (m_videoSettings != CMediaSettings::Get().GetDefaultVideoSettings())
{
videodatabase.SetVideoSettings(progressTrackingFile, m_videoSettings);
}
if (m_item.HasVideoInfoTag() && m_item.GetVideoInfoTag()->HasStreamDetails())
{
CFileItem dbItem(m_item);
// Check whether the item's db streamdetails need updating
if (!videodatabase.GetStreamDetails(dbItem) || dbItem.GetVideoInfoTag()->m_streamDetails != m_item.GetVideoInfoTag()->m_streamDetails)
{
videodatabase.SetStreamDetailsForFile(m_item.GetVideoInfoTag()->m_streamDetails, progressTrackingFile);
updateListing = true;
}
}
// in order to properly update the the list, we need to update the stack item which is held in g_application.m_stackFileItemToUpdate
if (m_item.HasProperty("stackFileItemToUpdate"))
{
m_item = m_item_discstack; // as of now, the item is replaced by the discstack item
videodatabase.GetResumePoint(*m_item.GetVideoInfoTag());
}
videodatabase.Close();
if (updateListing)
{
CUtil::DeleteVideoDatabaseDirectoryCache();
CFileItemPtr msgItem(new CFileItem(m_item));
if (m_item.HasProperty("original_listitem_url"))
msgItem->SetPath(m_item.GetProperty("original_listitem_url").asString());
CGUIMessage message(GUI_MSG_NOTIFY_ALL, g_windowManager.GetActiveWindow(), 0, GUI_MSG_UPDATE_ITEM, 1, msgItem); // 1 to update the listing as well
g_windowManager.SendThreadMessage(message);
}
}
}
if (m_item.IsAudio())
{
std::string redactPath = CURL::GetRedacted(progressTrackingFile);
CLog::Log(LOGDEBUG, "%s - Saving file state for audio item %s", __FUNCTION__, redactPath.c_str());
if (m_updatePlayCount)
{
#if 0
// Can't write to the musicdatabase while scanning for music info
CGUIDialogMusicScan *dialog = (CGUIDialogMusicScan *)g_windowManager.GetWindow(WINDOW_DIALOG_MUSIC_SCAN);
if (dialog && !dialog->IsDialogRunning())
#endif
{
CMusicDatabase musicdatabase;
if (!musicdatabase.Open())
{
CLog::Log(LOGWARNING, "%s - Unable to open music database. Can not save file state!", __FUNCTION__);
}
else
{
// consider this item as played
CLog::Log(LOGDEBUG, "%s - Marking audio item %s as listened", __FUNCTION__, redactPath.c_str());
musicdatabase.IncrementPlayCount(m_item);
musicdatabase.Close();
}
}
}
}
}
return true;
}