| 1697 | } |
| 1698 | |
| 1699 | void 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 | |
| 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 + |
nothing calls this directly
no outgoing calls
no test coverage detected