| 151 | } |
| 152 | |
| 153 | inline std::shared_ptr<AudioBus> MakeBusFromSampleFile(char const*const name, int argc, char** argv) |
| 154 | { |
| 155 | std::string path_prefix; |
| 156 | auto cmds = SplitCommandLine(argc, argv); |
| 157 | |
| 158 | if (cmds.size() > 1) |
| 159 | path_prefix = cmds[1] + "/"; // cmds[0] is the path to the exe |
| 160 | |
| 161 | std::string path = path_prefix + name; |
| 162 | std::shared_ptr<AudioBus> bus = MakeBusFromFile(path, false); |
| 163 | |
| 164 | if (!bus) { |
| 165 | path = std::string(SAMPLE_SRC_DIR) + "/" + std::string(name); |
| 166 | bus = MakeBusFromFile(path, false); |
| 167 | } |
| 168 | |
| 169 | if (!bus) |
| 170 | throw std::runtime_error("couldn't open " + path); |
| 171 | |
| 172 | return bus; |
| 173 | } |
| 174 | }; |
| 175 | |
| 176 | #endif |
nothing calls this directly
no test coverage detected