| 355 | } |
| 356 | |
| 357 | XnStatus xnConfigureAddNodeToRecording(XnNodeHandle hNode, const TiXmlElement* pOpcode) |
| 358 | { |
| 359 | XnStatus nRetVal = XN_STATUS_OK; |
| 360 | |
| 361 | const XnChar* strName; |
| 362 | nRetVal = xnXmlReadStringAttribute(pOpcode, "name", &strName); |
| 363 | XN_IS_STATUS_OK(nRetVal); |
| 364 | |
| 365 | const XnChar* strCodec; |
| 366 | nRetVal = xnXmlReadStringAttribute(pOpcode, "codec", &strCodec); |
| 367 | XN_IS_STATUS_OK(nRetVal); |
| 368 | |
| 369 | // find node |
| 370 | XnContext* pContext = hNode->pContext; |
| 371 | XnNodeHandle hOther = NULL; |
| 372 | nRetVal = xnGetRefNodeHandleByName(pContext, strName, &hOther); |
| 373 | XN_IS_STATUS_OK(nRetVal); |
| 374 | |
| 375 | // find codec |
| 376 | if (strlen(strCodec) != sizeof(XnCodecID)) |
| 377 | { |
| 378 | xnProductionNodeRelease(hOther); |
| 379 | XN_LOG_ERROR_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_OPEN_NI, "'%s' is not a valid codec ID!", strCodec); |
| 380 | } |
| 381 | |
| 382 | XnCodecID codecID; |
| 383 | xnOSMemCopy(&codecID, strCodec, sizeof(codecID)); |
| 384 | |
| 385 | nRetVal = xnAddNodeToRecording(hNode, hOther, codecID); |
| 386 | xnProductionNodeRelease(hOther); |
| 387 | XN_IS_STATUS_OK(nRetVal); |
| 388 | |
| 389 | return (XN_STATUS_OK); |
| 390 | } |
| 391 | |
| 392 | XnStatus xnConfigureSetOpcode(XnNodeHandle hNode, const TiXmlElement* pOpcode) |
| 393 | { |
no test coverage detected