| 515 | } |
| 516 | |
| 517 | int findUniqueFileName() |
| 518 | { |
| 519 | xnOSCreateDirectory(CAPTURED_FRAMES_DIR_NAME); |
| 520 | |
| 521 | int num = g_Capture.nCapturedFrameUniqueID; |
| 522 | |
| 523 | XnBool bExist = FALSE; |
| 524 | XnStatus nRetVal = XN_STATUS_OK; |
| 525 | XnChar csImageFileName[XN_FILE_MAX_PATH]; |
| 526 | XnChar csDepthFileName[XN_FILE_MAX_PATH]; |
| 527 | XnChar csIRFileName[XN_FILE_MAX_PATH]; |
| 528 | |
| 529 | for (;;) |
| 530 | { |
| 531 | // check image |
| 532 | getImageFileName(num, csImageFileName); |
| 533 | |
| 534 | nRetVal = xnOSDoesFileExist(csImageFileName, &bExist); |
| 535 | if (nRetVal != XN_STATUS_OK) |
| 536 | break; |
| 537 | |
| 538 | if (!bExist) |
| 539 | { |
| 540 | // check depth |
| 541 | getDepthFileName(num, csDepthFileName); |
| 542 | |
| 543 | nRetVal = xnOSDoesFileExist(csDepthFileName, &bExist); |
| 544 | if (nRetVal != XN_STATUS_OK || !bExist) |
| 545 | break; |
| 546 | } |
| 547 | |
| 548 | if (!bExist) |
| 549 | { |
| 550 | // check IR |
| 551 | getIRFileName(num, csIRFileName); |
| 552 | |
| 553 | nRetVal = xnOSDoesFileExist(csIRFileName, &bExist); |
| 554 | if (nRetVal != XN_STATUS_OK || !bExist) |
| 555 | break; |
| 556 | } |
| 557 | |
| 558 | ++num; |
| 559 | } |
| 560 | |
| 561 | return num; |
| 562 | } |
| 563 | |
| 564 | void captureSingleFrame(int) |
| 565 | { |
no test coverage detected