| 1023 | } |
| 1024 | |
| 1025 | double CsoundFile::getInstrumentNumber(std::string name_) const |
| 1026 | { |
| 1027 | trim(name_); |
| 1028 | int beginDefinition = 0; |
| 1029 | int endDefinition = 0; |
| 1030 | for(;;) |
| 1031 | { |
| 1032 | beginDefinition = findToken(orchestra, "instr", beginDefinition); |
| 1033 | if(beginDefinition == -1) |
| 1034 | { |
| 1035 | return false; |
| 1036 | } |
| 1037 | endDefinition = findToken(orchestra, "endin", beginDefinition); |
| 1038 | if(endDefinition == -1) |
| 1039 | { |
| 1040 | return false; |
| 1041 | } |
| 1042 | endDefinition += 6; |
| 1043 | std::string definition = orchestra.substr(beginDefinition, |
| 1044 | endDefinition - beginDefinition); |
| 1045 | std::string pre; |
| 1046 | std::string id; |
| 1047 | std::string name; |
| 1048 | std::string post; |
| 1049 | if(parseInstrument(definition, pre, id, name, post)) |
| 1050 | { |
| 1051 | if(name_.compare(name) == 0 || id.compare(name) == 0) |
| 1052 | { |
| 1053 | return atof(id.c_str()); |
| 1054 | } |
| 1055 | } |
| 1056 | beginDefinition++; |
| 1057 | } |
| 1058 | return -1.0; |
| 1059 | } |
| 1060 | |
| 1061 | bool CsoundFile::exportForPerformance() const |
| 1062 | { |
nothing calls this directly
no test coverage detected