Changed the descriptive static text to show the paragraph about missing files only if any are actually missing.
Added extra updating to enabling "Copy Selected Audio", e.g., for cases were all the aliased files are missing.
Made the dialog dismiss after "Copy Selected Audio" if all non-missing files have been copied in and all that remain are missing files, same as case where there are no missing files and all non-missing have been copied in.
Added extra updating to enabling "Copy All Audio", e.g., disabled when there are missing files in the list -- we cannot copy them.
Changed missing file entries in the list from italicized to prefixed with "MISSING " so screen readers can distinguish.
Was able to make the bug occur after lots of fast clicking around, by double-clicking Preview in Amplify dialog.
The key seems to be the call to wxYield. That function is obsolete, but looking at the documentation for its successor, wxApp::Yield():
"Caution should be exercised, however, since yielding may allow the user to perform actions which are not compatible with the current task. Disabling menu items or whole menus during processing can avoid unwanted reentrance of code: see ::wxSafeYield for a better function."
That sounds like exactly the situations where this has occurred. And the documentation for ::wxSafeYieldsays:
"This function is similar to wxYield, except that it disables the user input to all program windows before calling wxYield and re-enables it again afterwards."
Sounds like what we need. So I went through the code and for all the wxYield and wxGetApp()::Yield occurrences where Audacity is doing some drawing or already in the process of responding to a GUI event, I replaced them with ::wxSafeYield. Replaced all the remaining wxYield calls with calls to wxGetApp()::Yield().
Haven't been able to replicate the bug since these changes. Please test.
Basic problem was in using wxConvUTF8 instead of wxConvFile. I believe wxConvFile should work on all platforms, but if not we can "#ifdef _WIN32" its use.
Also simplified the code by getting rid of the mFileNameChar member. It was used only in ODPCMAliasBlockFile::WriteSummary() so there's no reason to do the conversion from mFileName in so many places -- just do it once, in ODPCMAliasBlockFile::WriteSummary().
Fixed a formerly unnoticed crash bug. If user selected a subset of the dependency files list, then clicked "Copy Selected Audio Into Project", it removed the selected dependency/dependencies, but then crashed on bad reference trying to delete the non-selected dependency/dependencies. This was due to a consistent misuse of wxHashMap::operator[] to check for the existence of a hash element. If you call it with a key that's not in the hash map, yes it returns NULL, the first time, but it creates an entry for that key. So if you test it again with the same key it returns a bad entry. Replaced it with a correct call to wxHashMap::count(). Leland had fixed one of these, but there were 4 more.
RemoveDependencies() always returned true, and was never checked, so made it return nothing.
More readability improvements.
Update header block.
Move declarations that aren't used elsewhere, from .h file. No need to expose them there, used only in this file.
Working on first part of bug 113 where moved/deleted file is allowed to be copied into project:
* Made class AliasedFile know whether its original file exists in specified location.
* Dependency dialog:
** Updated so message states some original files were moved/deleted, and what to do about it.
** Missing dependencies shown in red, italic text.
** Missing dependencies cannot be selected for copying into project.
* Fixed bug where deselecting all items did not disable "Copy Selected..." button.
FindDependencies always returns true, so removed return value and its handling.
Sundry readability improvements: var names, {} brackets usage consistency, indenting, clearer names, etc.
Get rid of vim/emacs declarations. Matt said they're unnecessary, ages ago.
Update header block.
Move declarations that aren't used elsewhere, into cpp file. No need to expose them here.
Get rid of vim/emacs declarations. Matt said they're unnecessary, ages ago.
* Make progress messages not have ellipsis at end, as convention in other cases.
* Reword "Continue without deleting" radio button about orphan files.
* Fix the removal of empty dirs at the end of DirManager::ProjectFSCK() which previously did nothing because it passed a hardcoded zero count for the file list, to what is now RecursivelyRemove(). Added RecursivelyCountSubdirs() so progress dialog has correct maximum (directory count, not blockCount as previously). Added RecursivelyRemoveEmptyDirs().
* Found that Windows SDK functions sometimes do not remove empty directories and added code to help it in some cases.
(still in progress, per "//vvvvv" comments):
Update credits and copyright.
Fix some grammar and remove obvious comments.
(For example, stack vars are always destroyed when
"out of context" (i.e, scope, when stack popped),
so no need to comment on it).
Remove wxWidgets error squelching.
"rm_dash_rf*" static functions
Rename all the "rm_dash_rf*" static functions to better
reflect what they actually do (per "finally
misnomer" comment). Not very mnemonic to
name functions on *nix-specific shell command
"rm- rf" that they do not emulate. Only 1 of the 4
so-named actually removed anything.
Remove one unnecessary function (originally
"rm_dash_rf_enumerate"), replaced by
parameter defaults on main recursive function
(originally rm_dash_rf_enumerate_i").
Remove unused parameter "prompt" from
rm_dash_rf_enumerate_i (now RecursivelyEnumerate).
The files_p and dirs_p ints were actually used only
as bools, so make them bools bFiles and bDirs.
Rename "prompt" vars to match ProgressDialog
"message" arg. They do not prompt user to do
anything, they're informational.
files_p and dirs_p were int but used only as bools,
so make them bool for better readability.
Also some minor refactoring.
This feature works with mp3 right now - may work on other formats, but that will be a seperate commit.
It is not enabled so most of the changes won't even be compiled, and those that do won't be run.
To enable it uncommment the EXPERIMENTAL_ODFFMPEG def in Experimental.h