... Remove all uses of the three-valued Cmp comparison member function, which
returns 0 for equality, except in one place. Use operators == and != instead.
(C++20's spaceship operator hasn't landed here yet!)
... Replacing:
Insert => insert
RemoveAt => erase
Remove => erase
IsSameAs => operator == or operator !=
(but only when second argument was true or default)
... instead use the utility make_iterator_range and its index() or contains()
method. This generic utility works with any container defining begin() and
end().
This further lessens dependency on wxWidgets container idioms.
... which will make it easier to change the types of those containers to
std::vectors of other string-like classes
for wxString,
IsEmpty => empty
Clear => clear
Alloc => reserve
for wxArrayString,
Count => size
GetCount => size
IsEmpty => empty
Add => push_back
Clear => clear
Empty => clear
Sort => std::sort (only with default comparator)
SetCount => resize
Last => back
Item => operator []
Alloc => reserve
... Cross platform differences in Focus handling are confusing, and we don't
know yet how to abort drags and also put focus back where we want it on Linux.
So don't take focus even temporarily in the time ruler. Sorry, ESC key won't
work.
Problem:
1. Set no access to microphone in Privacy category of Settings app.
2. Try to record in a new track. (not append to an existing track.)
3. Audacity crashes.
Cause of crash:
TrackPanel::OnTrackListResizing is called with a track after a call to
TrackList::ClearPendingTracks, which has removed its owner.
TrackPanel::OnTrackListResizing ends up calling TrackPanel::UpdateTrackVRuler,
and this function calls TrackList::Channels(t)), which assumes the track has an owner.
Crash.
Fix: in TrackPanel::OnTrackListResizing, check that the track has an owner.
... Fixed as suggested by David Bailes.
Confirmed on Mac and Windows that the intended ESC key handling to abort drag
in the ruler also now works. (It didn't on Windows in 2.3.0.)
Windows: Macros - "ExportMP3 before" and "ExportMP3 after" overwrite
causing non-critical data loss.
Thanks to Mike Barker for locating the problem.
This fix also corrects the bit-rate for the ExportMP3_56k commands.
... in case clip boundaries don't match and the right channel covers a greater
time extent than the left.
Don't lose those parts of the right channel, before or after, and also make the
start time of the project correct in case the right channel starts earlier.
This is an old bug, going back as far as the git history.