MCPcopy Create free account
hub / github.com/OpenNI/OpenNI / UpdateFrameSync

Method UpdateFrameSync

Source/OpenNI/XnNodeWatcher.cpp:384–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382}
383
384XnStatus GeneratorWatcher::UpdateFrameSync()
385{
386 // go over all nodes, and find the frame synced one
387 Context context;
388 m_generator.GetContext(context);
389
390 NodeInfoList nodes;
391 XnStatus nRetVal = context.EnumerateExistingNodes(nodes);
392 XN_IS_STATUS_OK(nRetVal);
393
394 for (NodeInfoList::Iterator it = nodes.Begin(); it != nodes.End(); ++it)
395 {
396 NodeInfo info = *it;
397 // make sure this is a generator
398 if (xnIsTypeDerivedFrom(info.GetDescription().Type, XN_NODE_TYPE_GENERATOR))
399 {
400 Generator otherGen;
401 nRetVal = info.GetInstance(otherGen);
402 XN_IS_STATUS_OK(nRetVal);
403
404 if (m_generator.GetFrameSyncCap().IsFrameSyncedWith(otherGen))
405 {
406 nRetVal = NotifyStringPropChanged(XN_PROP_FRAME_SYNCED_WITH, otherGen.GetName());
407 XN_IS_STATUS_OK(nRetVal);
408
409 return XN_STATUS_OK;
410 }
411 }
412 }
413
414 // if we got here, we're not frame synced
415 nRetVal = NotifyStringPropChanged(XN_PROP_FRAME_SYNCED_WITH, "");
416 XN_IS_STATUS_OK(nRetVal);
417
418 return XN_STATUS_OK;
419}
420
421
422/**************/

Callers 1

HandleFrameSyncChangeMethod · 0.80

Calls 10

xnIsTypeDerivedFromFunction · 0.85
GetContextMethod · 0.80
GetFrameSyncCapMethod · 0.80
GetNameMethod · 0.80
BeginMethod · 0.45
EndMethod · 0.45
GetDescriptionMethod · 0.45
GetInstanceMethod · 0.45
IsFrameSyncedWithMethod · 0.45

Tested by

no test coverage detected