MCPcopy Create free account
hub / github.com/TheWaveWarden/odin2 / fixWavetableIndexInFiles

Method fixWavetableIndexInFiles

Source/Utilities.cpp:1699–1720  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1697}
1698
1699void Utilities::fixWavetableIndexInFiles() {
1700 std::ifstream filein("/home/frot/odin2/Source/audio//Oscillators/"
1701 "WavetableCoefficients.h"); // File to read from
1702
1703 if (!filein) {
1704 DBG("Error opening files!");
1705 return;
1706 }
1707
1708 std::string line;
1709 while (getline(filein, line)) {
1710 if (line.find("->") != std::string::npos) {
1711 unsigned first = line.find("Coefficients/");
1712 unsigned last = line.find(".h");
1713 std::string strNew = line.substr(first, last - first);
1714 std::string number = line.substr(line.length() - 3, 3);
1715 DBG("name is: " + strNew);
1716 DBG("new number is: " + number);
1717 fixWavetableIndexInSingleFile(strNew, std::stoi(number));
1718 }
1719 }
1720}
1721
1722void Utilities::fixWavetableIndexInSingleFile(const std::string &p_filename, int p_number) {
1723 std::ifstream filein("/home/frot/odin2/Source/audio/Oscillators/Wavetables/" + p_filename +

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected