本文整理汇总了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;
}
示例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;
}
示例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);
}
}
示例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;
}