| 1720 | } |
| 1721 | |
| 1722 | void 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 | |
| 1742 | float sgn(float x) { |
| 1743 | return x < 0 ? -1 : 1; |
nothing calls this directly
no outgoing calls
no test coverage detected