| 106 | } |
| 107 | |
| 108 | std::string ofToFactoryPath(const std::string& subdir) |
| 109 | { |
| 110 | std::string result; |
| 111 | #if BESPOKE_MAC |
| 112 | auto resDir = juce::File::getSpecialLocation(juce::File::SpecialLocationType::currentApplicationFile).getChildFile("Contents/Resources").getChildFile(subdir); |
| 113 | #else |
| 114 | auto resDir = juce::File::getSpecialLocation(juce::File::SpecialLocationType::currentExecutableFile).getSiblingFile(subdir); |
| 115 | #if BESPOKE_LINUX |
| 116 | if (!resDir.isDirectory()) |
| 117 | { |
| 118 | resDir = juce::File::getSpecialLocation(juce::File::SpecialLocationType::currentApplicationFile).getChildFile("../../share/BespokeSynth").getChildFile(subdir); |
| 119 | if (!resDir.isDirectory()) |
| 120 | resDir = juce::File{ juce::CharPointer_UTF8{ Bespoke::CMAKE_INSTALL_PREFIX } }.getChildFile("share/BespokeSynth").getChildFile(subdir); |
| 121 | } |
| 122 | #endif |
| 123 | #endif |
| 124 | if (!resDir.isDirectory()) |
| 125 | throw std::runtime_error{ "Application directory not found. Please reinstall Bespoke." }; |
| 126 | |
| 127 | result = resDir.getFullPathName().toStdString(); |
| 128 | #if BESPOKE_WINDOWS |
| 129 | std::replace(begin(result), end(result), '\\', '/'); |
| 130 | #endif |
| 131 | return result; |
| 132 | } |
| 133 | |
| 134 | std::string ofToResourcePath(const std::string& path) |
| 135 | { |
no outgoing calls
no test coverage detected