Commit Graph

66 Commits

Author SHA1 Message Date
James Crook
83ddabc895 Bug 1750 - Equalization: EQ control points can disappear if the points are at the same frequency 2019-08-23 19:28:35 +01:00
Paul Licameli
63350d8573 TimeTrack drawing not dependent on EnvelopeEditor...
... after a static function is moved from EnvelopeEditor to Envelope
2019-06-19 11:35:47 -04:00
Paul Licameli
5ae606cf53 Move TimeTrack's upper and lower range into new BoundedEnvelope...
... 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.
2019-06-10 20:48:38 -04:00
Paul Licameli
d28ae00d88 Remove friends from Envelope 2019-06-10 20:48:38 -04:00
Paul Licameli
7ed99c6e8f Split EnvelopeEditor.cpp from Envelope.cpp...
... Envelope drops down out of the big strongly connected component, the new
piece stays behind
2019-06-10 20:48:38 -04:00
Paul Licameli
548192fcf3 Remove redundant #include-s from .h files...
Redundant, because transitively implied.  But don't do this for inclusions of
Audacity.h or Experimental.h.
2019-05-16 14:58:34 -04:00
Paul Licameli
56f51d8176 Revert "Remove redundant #include-s from .h files..."
This reverts commit b7fe62d170.
2019-05-16 14:33:55 -04:00
Paul Licameli
b7fe62d170 Remove redundant #include-s from .h files...
Redundant, because transitively implied.  But don't do this for inclusions of
Audacity.h or Experimental.h.
2019-05-16 14:15:05 -04:00
Paul Licameli
c982cf6a41 Remove wx/intl.h, wx/brush.h, wx/bitmap.h from headers 2019-03-30 11:45:20 -04:00
Paul Licameli
ec2f26e48c Remove wx/pen.h, wx/thread.h from headers 2019-03-30 10:17:18 -04:00
Paul Licameli
4e9c3cfb5f Remove wx/{dc,tokenzr,tglbtn,statusbr,simplebook}.h from *.h 2019-03-29 06:29:35 -04:00
Paul Licameli
99106e3ed3 Carry more information in TrackPanelDrawingContext; fewer arguments 2018-11-05 09:12:45 -05:00
James Crook
0022e0c06c Bug 1844 - Nyquist effects move subsequent envelope points by selection's length
Also renamed Envelop::Paste to Envelope::PasteEnvelope, since it was hard to find
just its usages, given the many usages of WaveTrack::Paste.
2018-08-07 10:39:18 +01:00
James Crook
edf90d6e2c Add envelope commands
- Added SetEnvelope (which can also delete/clear an envelope.)
- Added GetInfo: Type=Envelope
2018-02-24 14:20:27 -05:00
Paul Licameli
080dd34e61 Get rid of wx object arrays, use std::vector 2018-02-21 19:33:27 -05:00
Paul Licameli
52d8dc1525 Bug1682, maybe: More careful treatment of some Envelope corner cases 2017-07-14 22:49:46 -04:00
Paul Licameli
ada4b6307d Pass more context information into drawing routines 2017-07-09 12:34:27 -04:00
Paul Licameli
333c9aa91d Fix the test for removability of envelope points...
... 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.
2017-06-08 14:37:15 -04:00
Paul Licameli
4c80a074d3 Bug835(cut-then-paste should be no-op): Rewrite Envelope::Paste...
... 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.
2017-05-29 13:53:25 -04:00
Paul Licameli
58e7a94264 Envelope::Paste takes a time tolerance argument 2017-05-29 13:53:25 -04:00
Paul Licameli
02fe963d23 Define consistency check for Envelope, to be used in Paste 2017-05-29 13:53:25 -04:00
Paul Licameli
bd4d2dc31d Rewrite Envelope::InsertSpace 2017-05-29 13:53:25 -04:00
Paul Licameli
0126918fb5 Simplify InsertOrReplaceRelative, always trim when to domain...
... 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.
2017-05-29 13:53:25 -04:00
Paul Licameli
5ff09c2a59 Cut from flat TimeTrack does not leave unnecessary points...
... And more generally, Envelope::CollapseRegion, should it be reused more
widely, is responsible for removing the points; WaveTrack code is relieved of
that.
2017-05-28 00:50:35 -04:00
Paul Licameli
e428425c7d Change the drawing of wave track envelope at high zoom...
... 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.
2017-05-26 14:51:50 -04:00
Paul Licameli
537ccfbc4f Change evaluation of envelope near discontinuities...
... 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.
2017-05-26 14:50:43 -04:00
Paul Licameli
9c7e236442 Prefer "sampleDur" to "sampleTime" for some variable names 2017-05-26 14:50:43 -04:00
Paul Licameli
bcc0bed29a Envelope::SetTrackLen adds a point only when none was present...
... And if points were present, keeps only the leftmost.
2017-05-25 08:15:45 -04:00
Paul Licameli
6c2c2733f9 More Envelope::GetValueRelative; add point for join only as needed 2017-05-25 08:15:45 -04:00
Paul Licameli
aba52bc79e Update envelope properly for TimeTrack and WaveTrack editing...
... 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
2017-05-09 09:22:06 -04:00
Paul Licameli
945e411e2c Partial range copy of Envelope will not leave coincident points 2017-05-09 09:20:31 -04:00
Paul Licameli
f5a7e4ce7c Define private Envelope evaluator functions taking relative time...
... 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.
2017-05-09 09:20:31 -04:00
Paul Licameli
01b99f2849 Remove pointer back to Envelope from EnvPoint 2017-05-09 09:20:31 -04:00
Paul Licameli
d2acf1f3e5 Bug842: rescale clip offsets, envelope times when setting track rate 2017-05-07 11:12:24 -04:00
Paul Licameli
26c4d65bd4 Public Envelope methods all take & return ABSOLUTE time values...
... 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?
2017-05-07 11:00:55 -04:00
Paul Licameli
9c683a4f19 Rename some member functions of Envelope 2017-05-07 11:00:55 -04:00
Paul Licameli
4be19128c0 Better constructors for Envelope 2017-05-07 11:00:55 -04:00
Paul Licameli
3ba1ebc5c0 Remove unused members of Envelope 2017-05-07 11:00:54 -04:00
Paul Licameli
0af9b46eac Move many fields out of Envelope that are needed only during editing 2017-03-17 17:52:31 -04:00
Paul Licameli
81285ee0c1 More const and override 2017-03-17 17:52:20 -04:00
Paul Licameli
9ddb5bb1f3 more use of size_t 2017-03-17 17:52:20 -04:00
Paul Licameli
dcceaca13c Envelope bug 2016-08-12 20:53:38 -04:00
Paul Licameli
70c1d57591 More const qualifications, and mutables, for functions that draw tracks...
... The display related  members that had to become mutable are probably
ones that don't belong in the track classes, ultimately.
2016-02-27 12:35:17 -05:00
Paul Licameli
990080ae7d Replace virtual with override wherever possible; eliminate needless virtual...
... 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.
2016-02-26 12:35:38 -05:00
Paul Licameli
7824e94030 Harmlessly qualify classes as final (or explicitly comment not)...
... 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.
2016-02-24 20:58:30 -05:00
Paul Licameli
56e7653343 "delete"->"DELETE" in comments, easier to find remaining naked operator delete 2016-02-14 18:50:45 -05:00
Paul Licameli
fbc75907dd One less indirection accessing EnvPoint 2016-02-02 11:49:52 -05:00
Paul Licameli
cf45a58fdc dB range is now in Waveforms preferences and view settings, and ...
... the preference is independent of those in Interface and Recording
preferences, which affect meters, sound activated recordings, time track,
and Plot Spectrum
2015-08-15 18:07:29 -04:00
Paul Licameli
e0621819ed Move ENV_DB_RANGE out of Envelope.h; that file can be included in fewer places. 2015-07-28 11:55:52 -04:00
Paul Licameli
7bba4500c4 Move mdBr from TrackPanel to ViewInfo, no more lookup of prefs in Envelope.cpp 2015-07-28 11:53:01 -04:00