I refactored the code into AudacityApp with a new timer. This is provisional pending discussion - if it is decided that it should go somewhere else I will move it.
At bottom of http://bugzilla.audacityteam.org/show_bug.cgi?id=137#c17:
> I noticed that although when we open the same project a second time with File >
> Open or File > Recent Files we show an error "is already open in another
> window", there is no block on executing the .aup from your file manager and
> opening as many copies of the project as you like. I had not done that when
> Audacity moved the files around in error the first time, but can we block this
> anyway?
This is a different bug from Bug 137, repeatable, and I think lower priority. But I went ahead and fixed it with this commit.
Also fixed previously unnoted bug where AudacityApp::MRUOpen() returned true when it actually failed to open the file. Also removed AudacityApp::OnMRUProject() cruft.
Unfortunately, it still creates a new, empty project window on Win Explorer open whereas Open and Recent Files commands do not. I think that constitutes a new, separate P5 bug.
Overall, this is another aspect of what I was talking about in http://bugzilla.audacityteam.org/show_bug.cgi?id=322#c26. Opening files vs projects got conflated for convenience, but this code is hacked in some regards, rather than being a good design, and that's why this type of bug shows up.
Fixed bug in resetting mPrevT1. That caused remaining issue noted in Bug 258 comments 2 and 3.
Moved call to UpdateMeters from TrackPanel::OnTimer() to audacityAudioCallback, where it calls gAudioIO->mOutputMeter->UpdateDisplay(), so the updates are synchronized with Meter Toolbar updates.
Removed unnecessary call to MixerBoard::UpdateMeters() in AudacityProject::UpdateMixerBoard().
Various cleanup.
Changed the bSilentlyCorrect parameter to DirManager::ProjectFSCK() to be bAutoRecoverMode. If project check errors are found during auto-recovery, it's hazardous to allow the user the various options available during normal project open. But rather than squelching the messages as well as option dialogs during auto-recover, show the messages in the log and bring up an alert.
This means the helper methods Find*() no longer need bSilentlyCorrect -- they always report to the log.
EXPERIMENTAL_LINKING -> EXPERIMENTAL_SYNC_LOCK
Restore some "border" lines in TrackInfo.
Get rid of unused DEFINE_COLOUR( clrTrackInfoSyncLockSel...).
Clean out some undocumented commented-out code. Add/remove some comments.
In light of discussion about crazy things users do, decided to leave in the former "Temporarily replace..." options, but changed the wording to "Treat missing audio as silence" and warn that the waveform may not show silence.
Added FSCKstatus_SAVE_AUP flag (and returned FSCKstatus_* to being flags). FSCKstatus_SAVE_AUP is set for missing aliased files, so that AudacityProject does a save, fixing a bug where after "Close project immediately...", opening other projects failed in a way that made them incorrectly report missing _data folders, rather than go through Project Check (DirManager::ProjectFSCK).
Decided to continue with the fake-out fixes for missing aliased files and missing SimpleBlockFiles, i.e., writing zeroes instead of replacing with SilentBlockFiles. Replacing is difficult, and there are other places where the zeroes trick is used, e.g., after project check, if there's a disk error, such as a .au being inaccessible in the middle of edits.
Made the "permanent immediately" and "regenerate" options not do a PushState, because they were not possible to Undo.
More comments about things to fix (FIX-ME items this time).
Made AudacityProject::OnShowLog make the log window taller so more likely to show the bottom. The implementation of wxLogWindow makes it hard/impossible to scroll to the bottom.
Fix error of duplicate reports of missing aliased files.
restructuring and renaming for clarity, granularity, and reduction of code duplication
Found and commented on more errors in this code. In the "Close immediately" cases, it doesn't do a real close and that can break subsequent opening of other or the same problematic projects.
Changed several cases where GetDirManager()->ProjectFSCK returned FSCKstatus_CHANGED. These caused a PushState, but Undo could not do anything. Changed corresponding wordings for "Replace missing audio with silence" to say "permanent immediately" instead of "permanent on save", which was incorrect.
Comments about what's wrong with the DirManager::ProjectFSCK "Missing Aliased Files" dialog actions and what to do about it. (More to follow!)
Changed PushState for project repair from "Repair" to "Project Repair" to distinguish from Repair effect.
renames for clarity