1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 09:20:16 +01:00

More exception-safety for recording...

... Do not call Autosave (which might fail) when recovering from exceptions in
recording, but rely on the last good Autosave that happened during recording.

If dropout labels are needed, then immediately modify the undo history item, but
we can accept it if that modification fails.

Also, be sure NOT to skip Autosave in all other places that push the undo
history.  Make Autosave the default unless otherwise specified.

Finally removed one unnecessary call to Autosave.
This commit is contained in:
Paul Licameli
2020-07-10 13:19:59 -04:00
parent 975ee0cc07
commit 06f22e942b
8 changed files with 56 additions and 48 deletions

View File

@@ -97,9 +97,9 @@ using SpaceArray = std::vector <unsigned long long> ;
// Default is AUTOSAVE
// Frequent/faster actions use CONSOLIDATE
enum class UndoPush : unsigned char {
MINIMAL = 0,
NONE = 0,
CONSOLIDATE = 1 << 0,
AUTOSAVE = 1 << 1
NOAUTOSAVE = 1 << 1
};
inline UndoPush operator | (UndoPush a, UndoPush b)
@@ -126,7 +126,7 @@ class AUDACITY_DLL_API UndoManager final
const std::shared_ptr<Tags> &tags,
const TranslatableString &longDescription,
const TranslatableString &shortDescription,
UndoPush flags = UndoPush::AUTOSAVE);
UndoPush flags = UndoPush::NONE);
void ModifyState(const TrackList * l,
const SelectedRegion &selectedRegion, const std::shared_ptr<Tags> &tags);
void ClearStates();