//////////////////////////////////////////////////////////////////////////
| 628 | |
| 629 | /////////////////////////////////////////////////////////////////////////////// |
| 630 | bool Acclaim::readAMCData(const char* filename, Acclaim::ASFData& asfData, Acclaim::AMCData& amcData) |
| 631 | { |
| 632 | using namespace Acclaim; |
| 633 | |
| 634 | char token[MAX_TOKEN_LENGTH]; |
| 635 | |
| 636 | SampleArray<FrameData> tempFrameData; |
| 637 | tempFrameData.reserve(300); |
| 638 | |
| 639 | SampleFramework::File* fp = NULL; |
| 640 | PxToolkit::fopen_s(&fp, filename, "r"); |
| 641 | |
| 642 | if (!fp) |
| 643 | return false; |
| 644 | |
| 645 | SampleFileBuffer buffer(fp); |
| 646 | |
| 647 | while (buffer.getNextToken(token, false) == true) |
| 648 | { |
| 649 | if (token[0] == '#') // comment |
| 650 | { |
| 651 | buffer.skipUntilNextLine(); |
| 652 | continue; |
| 653 | } |
| 654 | else if (token[0] == ':') // blocks |
| 655 | { |
| 656 | const char* str = token + 1; // remainder of the string |
| 657 | |
| 658 | if (strcmp(str, "FULLY-SPECIFIED") == 0) |
| 659 | continue; |
| 660 | else if (strcmp(str, "DEGREES") == 0) |
| 661 | continue; |
| 662 | } |
| 663 | else if (isNumeric(token[0]) == true) |
| 664 | { |
| 665 | // frame number |
| 666 | //int frameNo = atoi(token); |
| 667 | |
| 668 | FrameData frameData; |
| 669 | if (readFrameData(buffer, asfData, frameData) == true) |
| 670 | tempFrameData.pushBack(frameData); |
| 671 | } |
| 672 | } |
| 673 | |
| 674 | amcData.mNbFrames = tempFrameData.size(); |
| 675 | |
| 676 | amcData.mFrameData = (FrameData*)malloc(sizeof(FrameData) * amcData.mNbFrames); |
| 677 | memcpy(amcData.mFrameData, tempFrameData.begin(), sizeof(FrameData) * amcData.mNbFrames); |
| 678 | |
| 679 | fclose(fp); |
| 680 | |
| 681 | return true; |
| 682 | } |
| 683 |
nothing calls this directly
no test coverage detected