| 806 | } |
| 807 | |
| 808 | int CsoundFile::getInstrumentCount() const |
| 809 | { |
| 810 | int beginDefinition = 0; |
| 811 | int endDefinition = 0; |
| 812 | int index; |
| 813 | for(index = 0; true; ) |
| 814 | { |
| 815 | beginDefinition = findToken(orchestra, "instr", beginDefinition); |
| 816 | if(beginDefinition == -1) |
| 817 | { |
| 818 | return index; |
| 819 | } |
| 820 | endDefinition = findToken(orchestra, "endin", beginDefinition); |
| 821 | if(endDefinition == -1) |
| 822 | { |
| 823 | return index; |
| 824 | } |
| 825 | endDefinition += 6; |
| 826 | std::string definition = orchestra.substr(beginDefinition, |
| 827 | endDefinition - beginDefinition); |
| 828 | std::string pre; |
| 829 | std::string id; |
| 830 | std::string name; |
| 831 | std::string post; |
| 832 | if(parseInstrument(definition, pre, id, name, post)) |
| 833 | { |
| 834 | index++; |
| 835 | beginDefinition++; |
| 836 | } |
| 837 | else |
| 838 | { |
| 839 | break; |
| 840 | } |
| 841 | } |
| 842 | return index; |
| 843 | } |
| 844 | |
| 845 | bool CsoundFile::getInstrument(int number, std::string &definition_) const |
| 846 | { |
nothing calls this directly
no test coverage detected