| 382 | } |
| 383 | |
| 384 | XnStatus 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 | /**************/ |
no test coverage detected