MCPcopy Create free account
hub / github.com/LabSound/LabSound / MakeBusFromSampleFile

Method MakeBusFromSampleFile

examples/src/ExamplesCommon.h:153–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

MakeBusFromFileFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected