The original fix of years ago must have caused leaked memory, and was
undone by my other changes to track memory management. This fix preserves
the intent, and avoids leaked memory.
Fix affects windows only.
In the case of Save and SaveAs creates the directory too, so that the dialog can be positioned there.
For Export Multiple, will prompt if the directory does not exist.
Previously we relied on Windows doing this. With the fix to now use Documents directory, if none was set, Windows no longer remembers the directory. So now we remember it instead.
... At startup, spawn a copy process in main() and crash it at once. The
child process continues. (The fix was ineffective when the parent continued
and the child crashed.)
Re-activiation of the application is also needed or else the windows are
hidden behind other applications.
Another sleep when closing a project, to fix occurrences of the bug caused by
closing of a project window without saving changes.
I have done as suggested in the bug comments, and used:
Windows: Users\username\Documents
Unix/Mac: ~/Documents .
We could though use GetLocalizedResourcesDir() and could use Music rather than Documents.
Opening Audacity can give a project window that straddles screens (if that is what the user wants and had last time they closed).
New windows created from menu item new will still start out initially all on one screen.
Works by un-full-screening before closing. Patching wxWidgets was needed to
make that work correctly after full-screening by clicking on the green circle
in the title bar, but that fix is not needed for full screen after command+/
Several users have stated confusion about the old message,
thinking that it meant 'changes to the imported file', whereas
it actually refers to the 'project'.
Also fix a couple of compiler warnings.
Caused by declaring a variable later than a conditionally compiled piece of code.
Net result is that Mac will be less tolerant of a window partly off the top of the screen than Windows will be, and will reset it to the default.
Splash screen still always appears on first screen (intentional).
Also I fixed issue where new project windows would appear on first screen, even if Audacity on second.
Fixed by being more tolerant of window being (slightly) off screen. Windows 10 appears to mis-report the window size by 6 pixels. This fix allows the user to restore a window that is (slightly) off screen. That's OK and helps those users who position and size the window very precisely.
Problem was that cfd7648fce2388ec8ae35b38004f2ae111c484af fixed a memory leak
but created a dangling pointer bug, which does not happen during usual run
of Audacity because AudacityProject::OnCloseWindow is reached then before
destroying AudacityProject.
Fixed it by using a std::shared_pointer for the TrackList that both
AudacityProject and TrackPanel must use.
This introduces a new variable, mStopIfWasPaused (default true). Actions which require AudioIONotBusyFlag will now stop the audio, if audio was busy but paused and attempt to continue.
We could perhaps make mStopAudioIfWasPaused into a preference, but I don't think we need to keep even the option of the old behaviour.
There is a very slight performance cost in using the sample-format set in preferences that does not seem to matter in practice. That's because the status message is updated infrequently, not every screen refresh, and the actual cost per look up is small. See http://bugzilla.audacityteam.org/show_bug.cgi?id=1436 for information on slow reading of preferences.