| 444 | } |
| 445 | |
| 446 | XnStatus xnConfigureNodeFromXml(XnNodeHandle hNode, const TiXmlElement* pNode) |
| 447 | { |
| 448 | XnStatus nRetVal = XN_STATUS_OK; |
| 449 | |
| 450 | const TiXmlElement* pConfig = pNode->FirstChildElement("Configuration"); |
| 451 | if (pConfig == NULL) |
| 452 | { |
| 453 | return (XN_STATUS_OK); |
| 454 | } |
| 455 | |
| 456 | XnBool bLock = FALSE; |
| 457 | const XnChar* strLock = pConfig->Attribute("lock"); |
| 458 | if (strLock != NULL) |
| 459 | { |
| 460 | xnXmlReadBoolAttribute(pConfig, "lock", &bLock); |
| 461 | } |
| 462 | |
| 463 | XnLockHandle hLock = 0; |
| 464 | |
| 465 | if (bLock) |
| 466 | { |
| 467 | nRetVal = xnLockNodeForChanges(hNode, &hLock); |
| 468 | XN_IS_STATUS_OK(nRetVal); |
| 469 | |
| 470 | nRetVal = xnLockedNodeStartChanges(hNode, hLock); |
| 471 | XN_IS_STATUS_OK(nRetVal); |
| 472 | } |
| 473 | |
| 474 | const TiXmlElement* pOpcode = pConfig->FirstChildElement(); |
| 475 | while (pOpcode != NULL) |
| 476 | { |
| 477 | nRetVal = xnConfigureSetOpcode(hNode, pOpcode); |
| 478 | XN_IS_STATUS_OK(nRetVal); |
| 479 | |
| 480 | pOpcode = pOpcode->NextSiblingElement(); |
| 481 | } |
| 482 | |
| 483 | if (bLock) |
| 484 | { |
| 485 | nRetVal = xnLockedNodeEndChanges(hNode, hLock); |
| 486 | } |
| 487 | |
| 488 | return (XN_STATUS_OK); |
| 489 | } |
| 490 | |
| 491 | static XnBool xnVersionGetNext(XnChar* strCurrent, XnChar** pstrNext) |
| 492 | { |
no test coverage detected