Check the BlockFiles against the disk state. Missing Blockfile data can be regenerated if possible or replaced with silence. Orphan blockfiles can be deleted. Note that even BlockFiles not referenced by the current savefile (but locked by history) will be reflected in the mBlockFileHash, and that's a good thing; this is one reason why we use the hash and not the most recent savefile.
| 30 | // good thing; this is one reason why we use the hash and not the most |
| 31 | // recent savefile. |
| 32 | int ProjectFSCK( |
| 33 | DirManager &dm, const bool bForceError, const bool bAutoRecoverMode) |
| 34 | { |
| 35 | #pragma message( "====================================================================") |
| 36 | #pragma message( "Don\'t forget to redo ProjectFSCK") |
| 37 | #pragma message( "====================================================================") |
| 38 | // In earlier versions of this method, enumerations of errors were |
| 39 | // all done in sequence, then the user was prompted for each type of error. |
| 40 | // The enumerations are now interleaved with prompting, because, for example, |
| 41 | // user choosing to replace missing aliased block files with silence |
| 42 | // needs to put in SilentBlockFiles and DELETE the corresponding auf files, |
| 43 | // so those would then not be cumulated in missingAUFHash. |
| 44 | // We still do the FindX methods outside the conditionals, |
| 45 | // so the log always shows all found errors. |
| 46 | |
| 47 | int action; // choice of action for each type of error |
| 48 | int nResult = 0; |
| 49 | |
| 50 | if (bForceError && !bAutoRecoverMode) |
| 51 | { |
| 52 | // TODO: Replace with more user friendly error message? |
| 53 | /* i18n-hint: The audacity project file is XML and has 'tags' in it, |
| 54 | rather like html tags <something>some stuff</something>. |
| 55 | This error message is about the tags that hold the sequence information. |
| 56 | The error message is confusing to users in English, and could just say |
| 57 | "Found problems with <sequence> when checking project file." */ |
| 58 | auto msg = XO("Project check read faulty Sequence tags."); |
| 59 | const TranslatableStrings buttons{ |
| 60 | XO("Close project immediately with no changes"), |
| 61 | XO("Continue with repairs noted in log, and check for more errors. This will save the project in its current state, unless you \"Close project immediately\" on further error alerts.") |
| 62 | }; |
| 63 | wxLog::FlushActive(); // MultiDialog has "Show Log..." button, so make sure log is current. |
| 64 | action = ShowMultiDialog(msg, |
| 65 | XO("Warning - Problems Reading Sequence Tags"), |
| 66 | buttons,""); |
| 67 | if (action == 0) |
| 68 | nResult = FSCKstatus_CLOSE_REQ; |
| 69 | else |
| 70 | nResult = FSCKstatus_CHANGED | FSCKstatus_SAVE_AUP; |
| 71 | } |
| 72 | #if 0 |
| 73 | FilePaths filePathArray; // *all* files in the project directory/subdirectories |
| 74 | auto dirPath = ( dm.GetDataFilesDir() ); |
| 75 | DirManager::RecursivelyEnumerateWithProgress( |
| 76 | dirPath, |
| 77 | filePathArray, // output: all files in project directory tree |
| 78 | wxEmptyString, // All dirs |
| 79 | wxEmptyString, // All files |
| 80 | true, false, |
| 81 | dm.NumBlockFiles(), // rough guess of how many BlockFiles will be found/processed, for progress |
| 82 | XO("Inspecting project file data")); |
| 83 | |
| 84 | // |
| 85 | // MISSING ALIASED AUDIO FILES |
| 86 | // |
| 87 | MissingAliasFilesDialog::SetShouldShow(false); |
| 88 | BlockHash missingAliasFilesAUFHash; // (.auf) AliasBlockFiles whose aliased files are missing |
| 89 | BlockHash missingAliasFilesPathHash; // full paths of missing aliased files |
nothing calls this directly
no test coverage detected