... for wxString and wxArrayStringEx, holding file paths (absolute or relative,
directory or plain file); to be replaced later with different types
(not yet using std::vector, becase of some uses of wxArrayString::Index with
two arguments)
... Strong, meaning that the file at the specified path is created or modified
only if all write operations complete without exceptions, barring one very
unlikely possibility that a final file rename fails, but even in that case the
output is successfully written to some path.
This commit does not add throws, but changes the type thrown to a subclass of
AudacityException, so that GuardedCall will cause the user to see an error
dialog in all cases.
Duplicated logic for making temporary files and backups is now all in one
place, the class XMLWriter.
There may be more new GuardedCalls than necessary -- the catch-all for the
event loop, AudacityApp::OnExceptionInMainLoop, might be trusted instead in
some cases -- but they are sufficient.
... for functions in final classes.
override is like const -- it's not necessary, but it helps the compiler to
catch mistakes.
There may be some overriding functions not explicitly declared virtual and I did
not identify such cases, in which I might also add override.
... Should have no effect on generated code, except perhaps some slight faster
virtual function calls. Mostly useful as documentation of design intent.
Tried to mark every one of our classes that inherits from another, or is a
base for others, or has abstract virtual functions, and a few others besides.
On Windows, you use:
/d <filename>
--decode <filename>
On Linux and OSX, you use:
-d <filename>
--decode <filename>
Note that the input (binary) file IS replaced with the decoded
XML file.
This changes the autosave XML file to a binary representation
during writing to speed up autosave processing. A lot of the
time used during autosave is a result of having to convert and
print all of the values to the XML file.
Writing the same information, but in binary format, reduces
all of that to just the bare essentials and the actual write
I/O.
During recovery, the binary file is read and converted to
the real xML representation and processing happens as it
did before.
It is a noticeable difference with very long or many tracks.
The included fix has to do with append recording.
Say you have 3 tracks and you want to append recorded audio
to the middle track. Sometime later Audacity crashes and
upon recovery, the recorded audio is actually appended to
the third track, not the second one.
This fixes that by adding an "autosaveid" to each track as
it is written to the autosave file. The same ID is written
to the recording recovery appends to the autosave file.
Then, during recovery, the IDs are matched up and the audio
gets appended to the proper track.
These autosaveid attributes are only present in the autosave
file and not in saved project files.