| 61 | NVGcontext* gFontBoundsNanoVG = nullptr; |
| 62 | |
| 63 | std::string ofToSamplePath(const std::string& path) |
| 64 | { |
| 65 | if (!path.empty() && (path[0] == '.' || juce::File::isAbsolutePath(path))) |
| 66 | return path; |
| 67 | |
| 68 | auto result = ofToDataPath(path); |
| 69 | |
| 70 | auto samplesPath = UserPrefs.samples_path.Get(); |
| 71 | if (samplesPath.empty()) |
| 72 | samplesPath = "samples/"; |
| 73 | |
| 74 | if (juce::File::isAbsolutePath(samplesPath)) |
| 75 | result = samplesPath; |
| 76 | else |
| 77 | result += samplesPath; |
| 78 | |
| 79 | #if BESPOKE_WINDOWS |
| 80 | std::replace(begin(result), end(result), '\\', '/'); |
| 81 | #endif |
| 82 | if (result.back() != '/') |
| 83 | result += '/'; |
| 84 | |
| 85 | return result + path; |
| 86 | } |
| 87 | |
| 88 | std::string ofToDataPath(const std::string& path) |
| 89 | { |
no test coverage detected