... 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)
... for wxString and wxArrayStringEx, holding file extensions (without dot);
to be replaced later with different types
(not yet using std::vector, becase of some uses of wxArrayString::Index with
two arguments)
And simplify some constructions of arrays
... for wxString and vector thereof, when holding plugin paths (which may or
may not be interpreted as file paths, depending on the module); to be replaced
later with different types
Set the SDK to 10.0.17763.
Set a default WXWIN property if the WXWIN environment variable is not set.
Source files will be interpreted as UTF-8 by default.
Use LTCG for release builds.
The bug:
1. Set Audio host to WASAPI
2. choose recording and playback devices which have different default sample rates in shared mode.
3. Set overdub, and playthrough to off.
4. make a short recording.
5. playback. Fails with error dialog.
Cause of bug:
In AudioIO::GetBestRate, the last returned sample rate is cached. If the function is called again, with the same requested sample rate, then the cached value is returned. So in the above steps, when GetBestRate is called for playback, the sample rate of the recording device is returned.
Fix:
Include in the conditions for returning the cached rate that the values of playing and capturing as the same as in the previous call.
... more use of standard library style alternatives instead.
Other types may then more easily replace them in future: std::vector of
wxString or of other string-like classes.
... 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