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


C++ CGUIDialogBusy::Show方法代码示例

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


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

示例1: Hibernate

bool CPowerManager::Hibernate()
{
  if (CanHibernate() && m_instance->Hibernate())
  {
    CGUIDialogBusy* dialog = (CGUIDialogBusy*)g_windowManager.GetWindow(WINDOW_DIALOG_BUSY);
    if (dialog)
      dialog->Show();

    return true;
  }

  return false;
}
开发者ID:Jmend25,项目名称:boxeebox-xbmc,代码行数:13,代码来源:PowerManager.cpp

示例2: Reboot

bool CPowerManager::Reboot()
{
  bool success = CanReboot() ? m_instance->Reboot() : false;

  if (success)
  {
    CAnnouncementManager::Get().Announce(System, "xbmc", "OnRestart");

    CGUIDialogBusy* dialog = (CGUIDialogBusy*)g_windowManager.GetWindow(WINDOW_DIALOG_BUSY);
    if (dialog)
      dialog->Show();
  }

  return success;
}
开发者ID:Jmend25,项目名称:boxeebox-xbmc,代码行数:15,代码来源:PowerManager.cpp

示例3: OpenFile


//.........这里部分代码省略.........

    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;
    //play_control.buffing_min        = 0.2;
    //play_control.buffing_middle     = 0.5;
    //play_control.buffing_max        = 0.8;
    //play_control.byteiobufsize      =; // maps to av_open_input_file buffer size
    //play_control.loopbufsize        =;
    //play_control.enable_rw_on_pause =;
    m_aml_state.clear();
    m_aml_state.push_back(0);
    m_pid = player_start(&play_control, 0);
    if (m_pid < 0)
    {
      printf("player start failed! error = %d\n", m_pid);
      return false;
    }

    // setup to spin the busy dialog until we are playing
    m_ready.Reset();

    g_renderManager.PreInit();

    // create the playing thread
    m_StopPlaying = false;
    Create();
    if (!m_ready.WaitMSec(100))
    {
      CGUIDialogBusy *dialog = (CGUIDialogBusy*)g_windowManager.GetWindow(WINDOW_DIALOG_BUSY);
      dialog->Show();
      while (!m_ready.WaitMSec(1))
        g_windowManager.ProcessRenderLoop(false);
      dialog->Close();
    }

    // Playback might have been stopped due to some error.
    if (m_bStop || m_StopPlaying)
      return false;

    return true;
  }
  catch (...)
  {
    CLog::Log(LOGERROR, "%s - Exception thrown on open", __FUNCTION__);
    return false;
  }
}
开发者ID:achellies,项目名称:xbmc-android-old,代码行数:101,代码来源:AMLPlayer.cpp

示例4: 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__);
  }
//.........这里部分代码省略.........
开发者ID:hgmeier,项目名称:xbmc,代码行数:101,代码来源:Directory.cpp


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