本文整理汇总了C++中CGUIDialogBusy::Close方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIDialogBusy::Close方法的具体用法?C++ CGUIDialogBusy::Close怎么用?C++ CGUIDialogBusy::Close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIDialogBusy
的用法示例。
在下文中一共展示了CGUIDialogBusy::Close方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WaitOnEvent
bool CGUIDialogBusy::WaitOnEvent(CEvent &event, unsigned int displaytime /* = 100 */, bool allowCancel /* = true */)
{
bool cancelled = false;
if (!event.WaitMSec(displaytime))
{
// throw up the progress
CGUIDialogBusy* dialog = g_windowManager.GetWindow<CGUIDialogBusy>(WINDOW_DIALOG_BUSY);
if (dialog)
{
dialog->Open();
while(!event.WaitMSec(1))
{
dialog->ProcessRenderLoop(false);
if (allowCancel && dialog->IsCanceled())
{
cancelled = true;
break;
}
}
dialog->Close();
}
}
return !cancelled;
}
示例2: OnWake
void CPowerManager::OnWake()
{
CLog::Log(LOGNOTICE, "%s: Running resume jobs", __FUNCTION__);
// reset out timers
g_application.ResetShutdownTimers();
CGUIDialogBusy* dialog = (CGUIDialogBusy*)g_windowManager.GetWindow(WINDOW_DIALOG_BUSY);
if (dialog)
dialog->Close();
#if defined(HAS_SDL) || defined(TARGET_WINDOWS)
if (g_Windowing.IsFullScreen())
{
#if defined(TARGET_WINDOWS)
ShowWindow(g_hWnd,SW_RESTORE);
SetForegroundWindow(g_hWnd);
#endif
}
g_application.ResetScreenSaver();
#endif
// restart lirc
#if defined(HAS_LIRC) || defined(HAS_IRSERVERSUITE)
CLog::Log(LOGNOTICE, "%s: Restarting lirc", __FUNCTION__);
CBuiltins::Execute("LIRC.Start");
#endif
CAEFactory::Resume();
g_application.UpdateLibraries();
g_weatherManager.Refresh();
CAnnouncementManager::Get().Announce(System, "xbmc", "OnWake");
}
示例3: OnWake
void CPowerManager::OnWake()
{
CLog::Log(LOGNOTICE, "%s: Running resume jobs", __FUNCTION__);
CServiceBroker::GetNetwork().WaitForNet();
// reset out timers
g_application.ResetShutdownTimers();
CGUIDialogBusy* dialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogBusy>(WINDOW_DIALOG_BUSY);
if (dialog)
dialog->Close(true); // force close. no closing animation, sound etc at this early stage
#if defined(HAS_SDL) || defined(TARGET_WINDOWS)
if (CServiceBroker::GetWinSystem()->IsFullScreen())
{
#if defined(TARGET_WINDOWS_DESKTOP)
ShowWindow(g_hWnd, SW_RESTORE);
SetForegroundWindow(g_hWnd);
#endif
}
g_application.ResetScreenSaver();
#endif
CServiceBroker::GetActiveAE()->Resume();
g_application.UpdateLibraries();
CServiceBroker::GetWeatherManager().Refresh();
CServiceBroker::GetPVRManager().OnWake();
RestorePlayerState();
CAnnouncementManager::GetInstance().Announce(System, "xbmc", "OnWake");
}
示例4: OpenFile
bool CUPnPPlayer::OpenFile(const CFileItem& file, const CPlayerOptions& options)
{
CGUIDialogBusy* dialog = NULL;
XbmcThreads::EndTime timeout(10000);
/* if no path we want to attach to a already playing player */
if(file.GetPath() == "")
{
NPT_CHECK_LABEL_SEVERE(m_control->GetTransportInfo(m_delegate->m_device
, m_delegate->m_instance
, m_delegate), failed);
NPT_CHECK_LABEL_SEVERE(WaitOnEvent(m_delegate->m_traevnt, timeout, dialog), failed);
/* make sure the attached player is actually playing */
{ CSingleLock lock(m_delegate->m_section);
if(m_delegate->m_trainfo.cur_transport_state != "PLAYING"
&& m_delegate->m_trainfo.cur_transport_state != "PAUSED_PLAYBACK")
goto failed;
}
}
else
NPT_CHECK_LABEL_SEVERE(PlayFile(file, options, dialog, timeout), failed);
m_stopremote = true;
m_started = true;
m_callback.OnPlayBackStarted();
NPT_CHECK_LABEL_SEVERE(m_control->GetPositionInfo(m_delegate->m_device
, m_delegate->m_instance
, m_delegate), failed);
NPT_CHECK_LABEL_SEVERE(m_control->GetMediaInfo(m_delegate->m_device
, m_delegate->m_instance
, m_delegate), failed);
if(dialog)
dialog->Close();
return true;
failed:
CLog::Log(LOGERROR, "UPNP: CUPnPPlayer::OpenFile - unable to open file %s", file.GetPath().c_str());
if(dialog)
dialog->Close();
return false;
}
示例5: SaveList
void CGUIDialogAudioDSPManager::SaveList(void)
{
if (!m_bContainsChanges)
return;
/* display the progress dialog */
CGUIDialogBusy* pDlgBusy = g_windowManager.GetWindow<CGUIDialogBusy>(WINDOW_DIALOG_BUSY);
if (!pDlgBusy)
{
helper_LogError(__FUNCTION__);
return;
}
pDlgBusy->Open();
pDlgBusy->Close();
}
示例6: OnWake
void CPowerManager::OnWake()
{
CLog::Log(LOGNOTICE, "%s: Running resume jobs", __FUNCTION__);
// reset out timers
g_application.ResetShutdownTimers();
CGUIDialogBusy* dialog = (CGUIDialogBusy*)g_windowManager.GetWindow(WINDOW_DIALOG_BUSY);
if (dialog)
dialog->Close();
#if defined(HAS_SDL) || defined(TARGET_WINDOWS)
if (g_Windowing.IsFullScreen())
{
#if defined(_WIN32)
ShowWindow(g_hWnd,SW_RESTORE);
SetForegroundWindow(g_hWnd);
#elif !defined(TARGET_DARWIN_OSX)
// Hack to reclaim focus, thus rehiding system mouse pointer.
// Surely there's a better way?
g_graphicsContext.ToggleFullScreenRoot();
g_graphicsContext.ToggleFullScreenRoot();
#endif
}
g_application.ResetScreenSaver();
#endif
// restart lirc
#if defined(HAS_LIRC) || defined(HAS_IRSERVERSUITE)
CLog::Log(LOGNOTICE, "%s: Restarting lirc", __FUNCTION__);
CBuiltins::Execute("LIRC.Start");
#endif
CAEFactory::Resume();
g_application.UpdateLibraries();
g_weatherManager.Refresh();
CAnnouncementManager::Announce(System, "xbmc", "OnWake");
}
示例7: OpenFile
bool CAMLPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
{
try
{
CLog::Log(LOGNOTICE, "CAMLPlayer: Opening: %s", file.GetPath().c_str());
// if playing a file close it first
// this has to be changed so we won't have to close it.
if (ThreadHandle())
CloseFile();
m_item = file;
m_options = options;
m_elapsed_ms = 0;
m_duration_ms = 0;
m_audio_info = "none";
m_audio_delay = g_settings.m_currentVideoSettings.m_AudioDelay;
m_video_info = "none";
m_video_width = 0;
m_video_height = 0;
m_video_fps_numerator = 25;
m_video_fps_denominator = 1;
m_subtitle_delay = 0;
m_subtitle_thread = NULL;
m_chapter_index = 0;
m_chapter_count = 0;
m_show_mainvideo = -1;
m_dst_rect.SetRect(0, 0, 0, 0);
ClearStreamInfos();
static URLProtocol vfs_protocol = {
"vfs",
CFileURLProtocol::Open,
CFileURLProtocol::Read,
CFileURLProtocol::Write,
CFileURLProtocol::Seek,
CFileURLProtocol::SeekEx, // url_exseek, an amlogic extension.
CFileURLProtocol::Close,
};
CStdString url = m_item.GetPath();
if (url.Left(strlen("smb://")).Equals("smb://"))
{
// the name string needs to persist
static const char *smb_name = "smb";
vfs_protocol.name = smb_name;
}
else if (url.Left(strlen("afp://")).Equals("afp://"))
{
// the name string needs to persist
static const char *afp_name = "afp";
vfs_protocol.name = afp_name;
}
else if (url.Left(strlen("nfs://")).Equals("nfs://"))
{
// the name string needs to persist
static const char *nfs_name = "nfs";
vfs_protocol.name = nfs_name;
}
else if (url.Left(strlen("http://")).Equals("http://"))
{
// the name string needs to persist
static const char *http_name = "xb-http";
vfs_protocol.name = http_name;
url = "xb-" + url;
}
printf("CAMLPlayer::OpenFile: URL=%s\n", url.c_str());
if (player_init() != PLAYER_SUCCESS)
{
printf("player init failed\n");
return false;
}
printf("player init......\n");
// must be after player_init
av_register_protocol2(&vfs_protocol, sizeof(vfs_protocol));
static play_control_t play_control;
memset(&play_control, 0, sizeof(play_control_t));
// if we do not register a callback,
// then the libamplayer will free run checking status.
player_register_update_callback(&play_control.callback_fn, &UpdatePlayerInfo, 1000);
// leak file_name for now.
play_control.file_name = (char*)strdup(url.c_str());
//play_control->nosound = 1; // if disable audio...,must call this api
play_control.video_index = -1; //MUST
play_control.audio_index = -1; //MUST
play_control.sub_index = -1; //MUST
play_control.hassub = 1;
play_control.t_pos = -1;
play_control.need_start = 1; // if 0,you can omit player_start_play API.
// just play video/audio immediately.
// if 1,then need call "player_start_play" API;
//play_control.auto_buffing_enable = 1;
//.........这里部分代码省略.........
示例8: GetDirectory
bool CDirectory::GetDirectory(const CURL& url, CFileItemList &items, const CHints &hints, bool allowThreads)
{
try
{
CURL realURL = URIUtils::SubstitutePath(url);
std::shared_ptr<IDirectory> pDirectory(CDirectoryFactory::Create(realURL));
if (!pDirectory.get())
return false;
// check our cache for this path
if (g_directoryCache.GetDirectory(realURL.Get(), items, (hints.flags & DIR_FLAG_READ_CACHE) == DIR_FLAG_READ_CACHE))
items.SetURL(url);
else
{
// need to clear the cache (in case the directory fetch fails)
// and (re)fetch the folder
if (!(hints.flags & DIR_FLAG_BYPASS_CACHE))
g_directoryCache.ClearDirectory(realURL.Get());
pDirectory->SetFlags(hints.flags);
bool result = false, cancel = false;
while (!result && !cancel)
{
const std::string pathToUrl(url.Get());
if (g_application.IsCurrentThread() && allowThreads && !URIUtils::IsSpecial(pathToUrl))
{
CSingleExit ex(g_graphicsContext);
CGetDirectory get(pDirectory, realURL, url);
if(!get.Wait(TIME_TO_BUSY_DIALOG))
{
CGUIDialogBusy* dialog = (CGUIDialogBusy*)g_windowManager.GetWindow(WINDOW_DIALOG_BUSY);
if (dialog)
{
dialog->Open();
while(!get.Wait(10))
{
CSingleLock lock(g_graphicsContext);
// update progress
float progress = pDirectory->GetProgress();
if (progress > 0)
dialog->SetProgress(progress);
if (dialog->IsCanceled())
{
cancel = true;
pDirectory->CancelDirectory();
break;
}
lock.Leave(); // prevent an occasional deadlock on exit
g_windowManager.ProcessRenderLoop(false);
}
dialog->Close();
}
}
result = get.GetDirectory(items);
}
else
{
items.SetURL(url);
result = pDirectory->GetDirectory(realURL, items);
}
if (!result)
{
if (!cancel && g_application.IsCurrentThread() && pDirectory->ProcessRequirements())
continue;
CLog::Log(LOGERROR, "%s - Error getting %s", __FUNCTION__, url.GetRedacted().c_str());
return false;
}
}
// cache the directory, if necessary
if (!(hints.flags & DIR_FLAG_BYPASS_CACHE))
g_directoryCache.SetDirectory(realURL.Get(), items, pDirectory->GetCacheType(url));
}
// now filter for allowed files
if (!pDirectory->AllowAll())
{
pDirectory->SetMask(hints.mask);
for (int i = 0; i < items.Size(); ++i)
{
CFileItemPtr item = items[i];
if (!item->m_bIsFolder && !pDirectory->IsAllowed(item->GetURL()))
{
items.Remove(i);
i--; // don't confuse loop
}
}
}
// filter hidden files
// TODO: we shouldn't be checking the gui setting here, callers should use getHidden instead
if (!CSettings::Get().GetBool("filelists.showhidden") && !(hints.flags & DIR_FLAG_GET_HIDDEN))
{
//.........这里部分代码省略.........
示例9: OpenFile
//.........这里部分代码省略.........
/* if no path we want to attach to a already playing player */
if(path != "") {
if (file.IsVideoDb())
thumb_loader = NPT_Reference<CThumbLoader>(new CVideoThumbLoader());
else if (item.IsMusicDb())
thumb_loader = NPT_Reference<CThumbLoader>(new CMusicThumbLoader());
obj = BuildObject(item, path, false, thumb_loader, NULL, CUPnP::GetServer());
if(obj.IsNull()) goto failed;
NPT_CHECK_LABEL_SEVERE(PLT_Didl::ToDidl(*obj, "", tmp), failed);
tmp.Insert(didl_header, 0);
tmp.Append(didl_footer);
/* The resource uri's are stored in the Didl. We must choose the best resource
* for the playback device */
NPT_Cardinal res_index;
NPT_CHECK_LABEL_SEVERE(m_control->FindBestResource(m_delegate->m_device, *obj, res_index), failed);
/* dlna specifies that a return code of 705 should be returned
* if TRANSPORT_STATE is not STOPPED or NO_MEDIA_PRESENT */
NPT_CHECK_LABEL_SEVERE(m_control->Stop(m_delegate->m_device
, m_delegate->m_instance
, m_delegate), failed);
NPT_CHECK_LABEL_SEVERE(WaitOnEvent(m_delegate->m_resevent, timeout, dialog), failed);
NPT_CHECK_LABEL_SEVERE(m_delegate->m_resstatus, failed);
NPT_CHECK_LABEL_SEVERE(m_control->SetAVTransportURI(m_delegate->m_device
, m_delegate->m_instance
, obj->m_Resources[res_index].m_Uri
, (const char*)tmp
, m_delegate), failed);
NPT_CHECK_LABEL_SEVERE(WaitOnEvent(m_delegate->m_resevent, timeout, dialog), failed);
NPT_CHECK_LABEL_SEVERE(m_delegate->m_resstatus, failed);
NPT_CHECK_LABEL_SEVERE(m_control->Play(m_delegate->m_device
, m_delegate->m_instance
, "1"
, m_delegate), failed);
NPT_CHECK_LABEL_SEVERE(WaitOnEvent(m_delegate->m_resevent, timeout, dialog), failed);
NPT_CHECK_LABEL_SEVERE(m_delegate->m_resstatus, failed);
}
/* wait for PLAYING state */
do {
NPT_CHECK_LABEL_SEVERE(m_control->GetTransportInfo(m_delegate->m_device
, m_delegate->m_instance
, m_delegate), failed);
{ CSingleLock lock(m_delegate->m_section);
if(m_delegate->m_trainfo.cur_transport_state == "PLAYING"
|| m_delegate->m_trainfo.cur_transport_state == "PAUSED_PLAYBACK")
break;
if(m_delegate->m_trainfo.cur_transport_state == "STOPPED"
&& m_delegate->m_trainfo.cur_transport_status != "OK")
{
CLog::Log(LOGERROR, "UPNP: CUPnPPlayer::OpenFile - remote player signalled error %s", file.GetPath().c_str());
goto failed;
}
}
NPT_CHECK_LABEL_SEVERE(WaitOnEvent(m_delegate->m_traevnt, timeout, dialog), failed);
} while(!timeout.IsTimePast());
if(options.starttime > 0)
{
/* many upnp units won't load file properly until after play (including xbmc) */
NPT_CHECK_LABEL(m_control->Seek(m_delegate->m_device
, m_delegate->m_instance
, "REL_TIME"
, PLT_Didl::FormatTimeStamp((NPT_UInt32)options.starttime)
, m_delegate), failed);
}
m_started = true;
m_callback.OnPlayBackStarted();
NPT_CHECK_LABEL_SEVERE(m_control->GetPositionInfo(m_delegate->m_device
, m_delegate->m_instance
, m_delegate), failed);
NPT_CHECK_LABEL_SEVERE(m_control->GetMediaInfo(m_delegate->m_device
, m_delegate->m_instance
, m_delegate), failed);
if(dialog)
dialog->Close();
return true;
failed:
CLog::Log(LOGERROR, "UPNP: CUPnPPlayer::OpenFile - unable to open file %s", file.GetPath().c_str());
if(dialog)
dialog->Close();
return false;
}
示例10: GetDirectory
bool CDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items, CStdString strMask /*=""*/, bool bUseFileDirectories /* = true */, bool allowPrompting /* = false */, DIR_CACHE_TYPE cacheDirectory /* = DIR_CACHE_ONCE */, bool extFileInfo /* = true */, bool allowThreads /* = false */, bool getHidden /* = false */)
{
try
{
CStdString realPath = URIUtils::SubstitutePath(strPath);
boost::shared_ptr<IDirectory> pDirectory(CFactoryDirectory::Create(realPath));
if (!pDirectory.get())
return false;
// check our cache for this path
if (g_directoryCache.GetDirectory(strPath, items, cacheDirectory == DIR_CACHE_ALWAYS))
items.SetPath(strPath);
else
{
// need to clear the cache (in case the directory fetch fails)
// and (re)fetch the folder
if (cacheDirectory != DIR_CACHE_NEVER)
g_directoryCache.ClearDirectory(strPath);
pDirectory->SetAllowPrompting(allowPrompting);
pDirectory->SetCacheDirectory(cacheDirectory);
pDirectory->SetUseFileDirectories(bUseFileDirectories);
pDirectory->SetExtFileInfo(extFileInfo);
bool result = false, cancel = false;
while (!result && !cancel)
{
if (g_application.IsCurrentThread() && allowThreads && !URIUtils::IsSpecial(strPath))
{
CSingleExit ex(g_graphicsContext);
CGetDirectory get(pDirectory, realPath);
if(!get.Wait(TIME_TO_BUSY_DIALOG))
{
CGUIDialogBusy* dialog = (CGUIDialogBusy*)g_windowManager.GetWindow(WINDOW_DIALOG_BUSY);
dialog->Show();
while(!get.Wait(10))
{
CSingleLock lock(g_graphicsContext);
if(dialog->IsCanceled())
{
cancel = true;
break;
}
g_windowManager.ProcessRenderLoop(false);
}
if(dialog)
dialog->Close();
}
result = get.GetDirectory(items);
}
else
{
items.SetPath(strPath);
result = pDirectory->GetDirectory(realPath, items);
}
if (!result)
{
if (!cancel && g_application.IsCurrentThread() && pDirectory->ProcessRequirements())
continue;
CLog::Log(LOGERROR, "%s - Error getting %s", __FUNCTION__, strPath.c_str());
return false;
}
}
// cache the directory, if necessary
if (cacheDirectory != DIR_CACHE_NEVER)
g_directoryCache.SetDirectory(strPath, items, pDirectory->GetCacheType(strPath));
}
// now filter for allowed files
pDirectory->SetMask(strMask);
for (int i = 0; i < items.Size(); ++i)
{
CFileItemPtr item = items[i];
// TODO: we shouldn't be checking the gui setting here;
// callers should use getHidden instead
if ((!item->m_bIsFolder && !pDirectory->IsAllowed(item->GetPath())) ||
(item->GetPropertyBOOL("file:hidden") && !getHidden && !g_guiSettings.GetBool("filelists.showhidden")))
{
items.Remove(i);
i--; // don't confuse loop
}
}
// Should any of the files we read be treated as a directory?
// Disable for database folders, as they already contain the extracted items
if (bUseFileDirectories && !items.IsMusicDb() && !items.IsVideoDb() && !items.IsSmartPlayList())
FilterFileDirectories(items, strMask);
return true;
}
#ifndef _LINUX
catch (const win32_exception &e)
{
e.writelog(__FUNCTION__);
}
//.........这里部分代码省略.........
示例11: Update
void CGUIDialogAudioDSPManager::Update()
{
CGUIDialogBusy* pDlgBusy = (CGUIDialogBusy*)g_windowManager.GetWindow(WINDOW_DIALOG_BUSY);
if (!pDlgBusy)
{
helper_LogError(__FUNCTION__);
return;
}
pDlgBusy->Open();
Clear();
AE_DSP_MODELIST modes;
CActiveAEDSPDatabase db;
if (!db.Open())
{
pDlgBusy->Close();
CLog::Log(LOGERROR, "DSP Manager - %s - Could not open DSP database for update!", __FUNCTION__);
return;
}
for (int iModeType = 0; iModeType < AE_DSP_MODE_TYPE_MAX; iModeType++)
{
modes.clear();
db.GetModes(modes, iModeType);
// No modes available, nothing to do.
if (!modes.empty())
{
AE_DSP_MENUHOOK_CAT menuHook = helper_GetMenuHookCategory(iModeType);
int continuesNo = 1;
for (unsigned int iModePtr = 0; iModePtr < modes.size(); iModePtr++)
{
CFileItem *listItem = helper_CreateModeListItem(modes[iModePtr].first, menuHook, &continuesNo);
if (listItem)
{
CFileItemPtr pItem(listItem);
if (pItem->GetProperty("ActiveMode").asBoolean())
{
m_activeItems[iModeType]->Add(pItem);
}
else
{
m_availableItems[iModeType]->Add(pItem);
}
}
g_windowManager.ProcessRenderLoop(false);
}
m_availableItems[iModeType]->Sort(SortByLabel, SortOrderAscending);
if (iModeType == AE_DSP_MODE_TYPE_MASTER_PROCESS)
{
m_activeItems[iModeType]->Sort(SortByLabel, SortOrderAscending);
}
}
}
db.Close();
pDlgBusy->Close();
}