... And corrected improper connections in HistoryWindow and ContrastDialog,
improper because they got called with the wrong this pointer, to
the control instead of the dialog. But that was harmless anyway because the
handlers did not use this.
... Trying to reduce that just to chained calls on S, or conditional and looping
logic for variations in layout.
Lift some declarations to higher scope; or use expressions that avoid local
variables; or even use lambdas for more complicated computation of arguments
for the member functions of S.
Mac and Linux (correctly) allow files to be saved with an arbitrary
file extension, or no file extension at all. For the exported file
to be visible in the export dialog, the dialog must include an optional
wildcard for "All files".
The for loop was only to test if *some* track was selected, and its body only needs to be executed once.
Note that an empty IteratorRange is false and one with something in it is true.
... though harmlessly so. They called to nonstatic member functions of classes
with improper this pointers; though the functions did not use this.
Bind events to nonmember funtions instead. Sometimes just to empty lambdas to
consume the event and ignore it, blocking other handlers.
... it's either the source of the connection that is being destroyed, or other
object (such as an ancestor window) transitively owning it and so causing it to
be destroyed too;
or, the sink is being destroyed, and that sink is a wxEvtHandler (which is
always so for Disconnect, though not for Unbind in case Bind was passed a
member function of a non-wxEvtHandler).
wxWidgets takes care of erasing the connection in such cases.
This removes most calls to Disconnect and Unbind. Many destructors shrank to
nothing.
Notably, in case of popup menu handling, the call to Disconnect is not removable
because the object being destroyed is neither the source nor the sink.
... and similar wx "variadics," which all treat wxString smartly enough that
you don't need this.
Don't need c_str either to convert wxString to const wxChar * because
wxString has a conversion operator that does the same.
Previously this was hard coded to use the online alphamanual.
Some other help-on-errors paths were hardcoded to use the online manual, and did not use local help even if available, so these were changed too.
Also two naming changes in the code:
ShowHelpDialog() became ShowHelp() because it typically shows the help in your browser, only showing the help in a dialog under certain circumstances.
The helpURL parameter became helpPage since it is usually a page name that is then elaborated into a url.
The Link() function became InnerLink().
Some careful http -> https changes made too.
... also gathered various formatting into some routines. Should we regularize
the messages further? That is, consistently put "dB" before or after "RMS"
Also added more i18n-hint comments
... This makes much code agnostic about how other things (functions and
arguments) are typed.
Many of these neeed to become size_t instead of sampleCount.
Now supports stereo tracks. Several tweaks to error messages,
validation logic, and accuracy improvements.
Includes a fix for summary64K (incorrect rms drawn on zoomed
out waveform).
Commit 9e78a41 declared isinf() as std::isinf(), because isinf() was not
declared on Ubuntu 16.04. But now the builds fail on Ubuntu <= 15.10,
because isinf() is declared there:
effects/Contrast.cpp:61:12: error: ‘constexpr bool std::isinf(double)’ conflicts with a previous declaration
using std::isinf;
^
In file included from /usr/include/features.h:364:0,
from /usr/include/assert.h:35,
from /usr/include/wx-3.0/wx/debug.h:14,
from /usr/include/wx-3.0/wx/defs.h:695,
from /usr/include/wx-3.0/wx/event.h:14,
from /usr/include/wx-3.0/wx/window.h:18,
from /usr/include/wx-3.0/wx/nonownedwnd.h:14,
from /usr/include/wx-3.0/wx/toplevel.h:20,
from /usr/include/wx-3.0/wx/dialog.h:14,
from effects/Contrast.h:12,
from effects/Contrast.cpp:13:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:201:1: note: previous declaration ‘int isinf(double)’
__MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
Thus use std::isinf() directly instead of declaring isinf() as
std::isinf().