... confusingly, Envelope already carried its own limiting values, but those
in the TimeTrack were not guaranteed to be the same.
I'm just preserving behavior as I break file dependencies and won't try to fix
that confusion now.
... Which went wrong in some examples of an effect applied to part of an
envelope that contains only one point; the correct result should have
a level 1 in the selection and unchanged levels left and right of it, no
matter whether the sole point was before, in, or after the selection.
Simplification may still remove that sole point yet still leave the levels
outside the selection correct.
... Simplify. Don't assume e->mOffset is zero. Check consistency afterward.
Do not leave responsibility for simplification of discontinuities to higher
level code.
Allow real discontinuities at the end of the insertion; no more readjustment of
times of points.
... Comment in it says that it does not check for discontinuities if it
replaces!
This will not matter in the uses of it internal to the Envelope class, which
will in fact always be proper insertions, having checked first for the presence
of a point.
... And more generally, Envelope::CollapseRegion, should it be reused more
widely, is responsible for removing the points; WaveTrack code is relieved of
that.
... The function defined by the envelope is evaluated exactly at the times of
samples, but not between samples -- instead there is a simple interpolation.
Therefore the curve might not go through the control points when they are not at
sample times.
The exact value of the function defined by the envelope has no influence on
rendering of the sound in between samples. So this can make it clear that
the middle point has no influence at all in case three points are very close.
Drawing of other envelopes (Time track, Equalization curves) is not changed.
... So that even if the time is "slightly" (less than 1/2 sample interval) left
of the discontinuity, the right-hand limit is always used.
Thus this compensates for some roundoff errors when pasting one clip with
an envelope into another.
This overcomes the objections that were in a comment in Envelope::Paste
to making control points with exactly equal times.
And therefore Paste can be rewritten to do so, but that has not happened yet.
Envelope points at exactly equal time coordinates can already be made by
dragging points in the envelope editor.
... Formerly this was done correctly only for cut and delete from WaveTrack,
paste into WaveTrack, and sync-lock adjustment of WaveTrack (either lengthening
or shortening).
Now also properly done for TimeTrack cut and paste, and also for:
Split cut
Split delete
Trim
... To be very sure we can avoid roundoff errors from adding mOffset and
subtracting it again; so that evaluation exactly at a control point time gives
the exact value of that point.
... rather than some of them being relative to the Envelope's offset.
In case of the envelopes used in TimeTrack or Equalization, offset was
always zero, so this doesn't matter, except to make the contract of the
Envelope class more explicit and sensible in isolation.
In case of InsertSpace at least, this does fix an obscure bug, which could
only happen when you have a clip, with an envelope, that starts before zero,
and you select a region overlapping that clip and some other clip, with a void
between, and you use the Join command.
Aren't you relieved that's fixed now?
... for functions in final classes.
override is like const -- it's not necessary, but it helps the compiler to
catch mistakes.
There may be some overriding functions not explicitly declared virtual and I did
not identify such cases, in which I might also add override.
... Should have no effect on generated code, except perhaps some slight faster
virtual function calls. Mostly useful as documentation of design intent.
Tried to mark every one of our classes that inherits from another, or is a
base for others, or has abstract virtual functions, and a few others besides.
... the preference is independent of those in Interface and Recording
preferences, which affect meters, sound activated recordings, time track,
and Plot Spectrum