| 622 | } |
| 623 | |
| 624 | Result Buffer2Ascii::sanityCheck() const |
| 625 | { |
| 626 | if (numLines == 0) |
| 627 | return Result::fail("numLines must not be zero"); |
| 628 | |
| 629 | if (getNumSamples() == 0) |
| 630 | return Result::fail("Buffer must not have zero length"); |
| 631 | |
| 632 | if (isMultiChannel()) |
| 633 | { |
| 634 | for (int i = getNumChannels() - 1; i >= 0; i--) |
| 635 | { |
| 636 | auto c = getChannel(i); |
| 637 | if (c == nullptr) |
| 638 | return Result::fail("channel " + String(i + 1) + " is not a buffer"); |
| 639 | |
| 640 | if (c->size != getNumSamples()) |
| 641 | return Result::fail("channel size mismatch at channel " + String(i + 1)); |
| 642 | } |
| 643 | } |
| 644 | |
| 645 | return Result::ok(); |
| 646 | } |
| 647 | |
| 648 | juce::juce_wchar Buffer2Ascii::getChannelChar(int channelIndex) const |
| 649 | { |
no test coverage detected