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


C++ CEvent::WaitMSec方法代码示例

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


在下文中一共展示了CEvent::WaitMSec方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
开发者ID:anaconda,项目名称:xbmc,代码行数:26,代码来源:GUIDialogBusy.cpp

示例2: WaitOnEvent

static NPT_Result WaitOnEvent(CEvent& event, XbmcThreads::EndTime& timeout, CGUIDialogBusy*& dialog)
{
  if(event.WaitMSec(0))
    return NPT_SUCCESS;

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

  g_windowManager.ProcessRenderLoop(false);

  do {
    if(event.WaitMSec(100))
      return NPT_SUCCESS;

    g_windowManager.ProcessRenderLoop(false);

    if(dialog->IsCanceled())
      return NPT_FAILURE;

  } while(!timeout.IsTimePast());

  return NPT_FAILURE;
}
开发者ID:wm3ndez,项目名称:xbmc,代码行数:25,代码来源:UPnPPlayer.cpp

示例3: Run

void CVideoSyncAML::Run(CEvent& stopEvent)
{
  // We use the wall clock for timout handling (no AML h/w, startup)
  std::chrono::time_point<std::chrono::system_clock> now(std::chrono::system_clock::now());
  unsigned int waittime (3000 / m_fps);
  uint64_t numVBlanks (0);

  /* This shouldn't be very busy and timing is important so increase priority */
  CThread::GetCurrentThread()->SetPriority(CThread::GetCurrentThread()->GetPriority() + 1);

  while (!stopEvent.Signaled() && !m_abort)
  {
    int countVSyncs(1);
    if( !g_aml_sync_event.WaitMSec(waittime))
    {
      std::chrono::milliseconds elapsed(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() - now).count());
      uint64_t curVBlanks = (m_fps * elapsed.count()) / 1000;
      int64_t lastVBlankTime((curVBlanks * 1000) / m_fps);
      if (elapsed.count() > lastVBlankTime)
      {
        lastVBlankTime = (++curVBlanks * 1000) / m_fps;
        std::this_thread::sleep_for(std::chrono::milliseconds(lastVBlankTime - elapsed.count()));
      }
      countVSyncs = curVBlanks - numVBlanks;
      numVBlanks = curVBlanks;
    }
    else
      ++numVBlanks;

    uint64_t now = CurrentHostCounter();

    UpdateClock(countVSyncs, now, m_refClock);
  }
}
开发者ID:AMoo-Miki,项目名称:xbmc,代码行数:34,代码来源:VideoSyncAML.cpp

示例4: WaitOnEvent

static NPT_Result WaitOnEvent(CEvent& event, XbmcThreads::EndTime& timeout, CGUIDialogBusy*& dialog)
{
  if(event.WaitMSec(0))
    return NPT_SUCCESS;

  if (!CGUIDialogBusy::WaitOnEvent(event))
    return NPT_FAILURE;

  return NPT_SUCCESS;
}
开发者ID:0xheart0,项目名称:xbmc,代码行数:10,代码来源:UPnPPlayer.cpp


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