MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / ofToSamplePath

Function ofToSamplePath

Source/OpenFrameworksPort.cpp:63–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61NVGcontext* gFontBoundsNanoVG = nullptr;
62
63std::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
88std::string ofToDataPath(const std::string& path)
89{

Callers 9

ReadMethod · 0.85
WriteDataToFileMethod · 0.85
ButtonClickedMethod · 0.85
SampleBrowserMethod · 0.85
SetDirectoryMethod · 0.85
SetupMethod · 0.85
LoadFileMethod · 0.85
SaveFileMethod · 0.85
LoadFileMethod · 0.85

Calls 3

ofToDataPathFunction · 0.85
emptyMethod · 0.80
GetMethod · 0.80

Tested by

no test coverage detected