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

Method fixWavetableIndexInSingleFile

Source/Utilities.cpp:1722–1740  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 +
1724 ".h"); // File to read from
1725 std::ofstream fileout("/home/frot/odin2/Source/audio/Oscillators/Wavetables/TEMP/" + p_filename + ".h");
1726
1727 if (!filein || !fileout) {
1728 DBG("Error opening files!");
1729 return;
1730 }
1731
1732 std::string line;
1733 while (getline(filein, line)) {
1734 if (line.find("#define WT_NR") != std::string::npos) {
1735 line = "#define WT_NR " + std::to_string(p_number);
1736 }
1737 line += "\n";
1738 fileout << line;
1739 }
1740}
1741
1742float sgn(float x) {
1743 return x < 0 ? -1 : 1;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected