... not member functions of AudacityProject
This puts DirManager.cpp and four others back into the big strongly connected
component of link dependencies. They will break out again when Project.cpp
becomes a low-level file.
... To append files during recording or import, it doesn't depend on the
subclasses of BlockFile, instead taking a factory function to which it gives
the filename; and the choice of factory function is also lifted up through the
level of class Sequence which is just above DirManager.
This frees four files from dependency cycles, including DirManager.cpp but not
yet Sequence.cpp
... 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)
... Do NOT remove original files, or change the stored path names, until after
successful creation of ALL new copies; then, it is a no-throw commit operation.
In case of failure of some copies, cleanup code already existed to fix
partial results.
This fix adds flags to RecursivelyRemove to be more specific about what to remove. With the kCleanDirsOnlyIfEmpty option it is now safe to call CleanDir on closing a second unsaved project. In particular, if some of the wave has been copied to the clipboard, that part of the wave does not get deleted on close, and is available to paste into the other project which is still open. In CleanDir the folders containing those block files are not deleted. They will get deleted later when the second project is closed too.
CleanDir is now called with that option when closing a project that is not the last one being closed. .DS_Store files, if present, will be deleted, and any empty directories for that project. I have also tested that clipboard contents are preserved.
Note that CleanDir may be used on a temp directory, deleting entire projects, and in that case
we delete all files too, but do not want to delete files that are at the top level, only ones inside
projects.
... whenever they really describe the size of a buffer that fits in memory, or
of a block file (which is never now more than a megabyte and so could be fit in
memory all at once), or a part thereof.
Doing BalanceInfoDel in this delayed fashion will be needed when the other
call to it is eliminated, as shared_ptr simplifies the management of BlockFile
and makes the many calls to Ref and Deref disappear.
... 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.