本文整理汇总了C++中xbmcthreads::EndTime::MillisLeft方法的典型用法代码示例。如果您正苦于以下问题:C++ EndTime::MillisLeft方法的具体用法?C++ EndTime::MillisLeft怎么用?C++ EndTime::MillisLeft使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xbmcthreads::EndTime
的用法示例。
在下文中一共展示了EndTime::MillisLeft方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Process
void CActiveAESink::Process()
{
Message *msg = NULL;
Protocol *port = NULL;
bool gotMsg;
XbmcThreads::EndTime timer;
m_state = S_TOP_UNCONFIGURED;
m_extTimeout = 1000;
m_bStateMachineSelfTrigger = false;
m_extAppFocused = true;
while (!m_bStop)
{
gotMsg = false;
timer.Set(m_extTimeout);
if (m_bStateMachineSelfTrigger)
{
m_bStateMachineSelfTrigger = false;
// self trigger state machine
StateMachine(msg->signal, port, msg);
if (!m_bStateMachineSelfTrigger)
{
msg->Release();
msg = NULL;
}
continue;
}
// check control port
else if (m_controlPort.ReceiveOutMessage(&msg))
{
gotMsg = true;
port = &m_controlPort;
}
// check data port
else if (m_dataPort.ReceiveOutMessage(&msg))
{
gotMsg = true;
port = &m_dataPort;
}
if (gotMsg)
{
StateMachine(msg->signal, port, msg);
if (!m_bStateMachineSelfTrigger)
{
msg->Release();
msg = NULL;
}
continue;
}
// wait for message
else if (m_outMsgEvent.WaitMSec(m_extTimeout))
{
m_extTimeout = timer.MillisLeft();
continue;
}
// time out
else
{
msg = m_controlPort.GetMessage();
msg->signal = CSinkControlProtocol::TIMEOUT;
port = 0;
// signal timeout to state machine
StateMachine(msg->signal, port, msg);
if (!m_bStateMachineSelfTrigger)
{
msg->Release();
msg = NULL;
}
}
}
}