| 123 | } |
| 124 | |
| 125 | void StudioApp::selectSingleFile(const std::string& absPath) |
| 126 | { |
| 127 | namespace fs = std::filesystem; |
| 128 | FileEntry f; |
| 129 | f.fullPath = absPath; |
| 130 | f.name = fs::path(absPath).filename().string(); |
| 131 | f.extension = fs::path(absPath).extension().string(); |
| 132 | std::transform(f.extension.begin(), f.extension.end(), f.extension.begin(), ::tolower); |
| 133 | std::error_code ec; |
| 134 | f.size = (int64_t)fs::file_size(absPath, ec); |
| 135 | |
| 136 | selectedFile = f.name; |
| 137 | selectedEntry = f; |
| 138 | selectedIndex = -1; |
| 139 | previewInfo.clear(); |
| 140 | clearPreviewTexture(); |
| 141 | stopSound(); |
| 142 | cachedInfoFile.clear(); |
| 143 | cachedInfoText.clear(); |
| 144 | configFile.reset(); |
| 145 | configFilePath.clear(); |
| 146 | configSearchActive = false; |
| 147 | memset(configSearch, 0, sizeof(configSearch)); |
| 148 | configSearchResults.clear(); |
| 149 | currentPreview = previewTypeFromExtension(f.extension); |
| 150 | singleFileMode = true; |
| 151 | |
| 152 | log("Single-file: " + f.name); |
| 153 | } |
| 154 | |
| 155 | void StudioApp::playSoundFile(const std::string& path) |
| 156 | { |